Skip to content

Commit

Permalink
Eloquent pr test (#13)
Browse files Browse the repository at this point in the history
* initial dashing port

* fixing initialization declare

* linting

* bump dashing to 2.0.1 to release in dashing

* bump test (#12)

* bump test

* adding build icon and test deps

* include updated build icon

* adding eloquent updates
  • Loading branch information
SteveMacenski authored Dec 18, 2019
1 parent c9481ef commit 90b8385
Show file tree
Hide file tree
Showing 8 changed files with 322 additions and 329 deletions.
165 changes: 94 additions & 71 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,91 +1,114 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.5)
project(nonpersistent_voxel_layer)

find_package(catkin REQUIRED
COMPONENTS
cmake_modules
dynamic_reconfigure
geometry_msgs
laser_geometry
map_msgs
message_filters
message_generation
nav_msgs
pcl_conversions
pcl_ros
pluginlib
roscpp
sensor_msgs
std_msgs
tf
visualization_msgs
voxel_grid
costmap_2d
)

find_package(PCL REQUIRED)
remove_definitions(-DDISABLE_LIBUSB-1.0)
if(NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(ament_cmake REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(laser_geometry REQUIRED)
find_package(map_msgs REQUIRED)
find_package(message_filters REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(nav2_msgs REQUIRED)
find_package(pcl_conversions REQUIRED)
find_package(pluginlib REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(visualization_msgs REQUIRED)
find_package(nav2_voxel_grid REQUIRED)
find_package(nav2_costmap_2d REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(Boost REQUIRED COMPONENTS system thread)

find_package(PCL REQUIRED COMPONENTS filters common)
if(NOT "${PCL_LIBRARIES}" STREQUAL "")
# This package fails to build on Debian Stretch with a linking error against
# 'Qt5::Widgets'. This is a transitive dependency that comes in to PCL via
# the PCL dependency on VTK. However, we don't actually care about the Qt
# dependencies for this package, so just remove them. This is similar to the
# workaround in https://github.com/ros-perception/perception_pcl/pull/151,
# and can be removed when Stretch goes out of support.
list(REMOVE_ITEM PCL_LIBRARIES
"vtkGUISupportQt"
"vtkGUISupportQtOpenGL"
"vtkGUISupportQtSQL"
"vtkGUISupportQtWebkit"
"vtkViewsQt"
"vtkRenderingQt")
endif()

set(dependencies
geometry_msgs
laser_geometry
map_msgs
message_filters
nav_msgs
pcl_conversions
pluginlib
sensor_msgs
nav2_msgs
rclcpp
std_msgs
tf2
tf2_ros
visualization_msgs
nav2_voxel_grid
nav2_costmap_2d)

set(library_name nonpersistent_voxel_layer_core)

add_definitions(${EIGEN3_DEFINITIONS})

include_directories(
include
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
)

add_definitions(${EIGEN3_DEFINITIONS})
add_library(${library_name} SHARED
plugins/nonpersistent_voxel_layer.cpp
)

# dynamic reconfigure
generate_dynamic_reconfigure_options(
cfg/NonPersistentVoxelPlugin.cfg
target_compile_definitions(${library_name} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")

target_link_libraries(${library_name}
${PCL_LIBRARIES}
${EIGEN3_LIBRARIES}
)

catkin_package(
INCLUDE_DIRS
include
LIBRARIES nonpersistent_voxel_layer
CATKIN_DEPENDS
dynamic_reconfigure
geometry_msgs
laser_geometry
map_msgs
costmap_2d
message_filters
message_runtime
nav_msgs
pcl_ros
pluginlib
roscpp
sensor_msgs
std_msgs
tf
visualization_msgs
voxel_grid
DEPENDS
PCL
EIGEN3
Boost
ament_target_dependencies(${library_name}
${dependencies}
)

add_library(nonpersistent_voxel_layer
plugins/nonpersistent_voxel_layer.cpp
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

install(TARGETS ${library_name}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib
)
add_dependencies(nonpersistent_voxel_layer ${PROJECT_NAME}_gencfg)
target_link_libraries(nonpersistent_voxel_layer ${catkin_LIBRARIES})

install(TARGETS
nonpersistent_voxel_layer
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
install(DIRECTORY example
DESTINATION share
)

install(FILES costmap_plugins.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
DESTINATION share
)

install(DIRECTORY include/nonpersistent_voxel_layer/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
PATTERN ".svn" EXCLUDE
)
ament_export_include_directories(include)
ament_export_libraries(${library_name})
ament_export_dependencies(${dependencies})
pluginlib_export_plugin_description_file(nav2_costmap_2d costmap_plugins.xml)
ament_package()
57 changes: 31 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,54 @@
# nonpersistent_voxel_layer [![Build Status](http://build.ros.org/buildStatus/icon?job=Kbin_uX64__navigation__ubuntu_xenial_amd64__binary)](http://build.ros.org/job/Kdev__nonpersistent_voxel_layer__ubuntu_xenial_amd64/)
# nonpersistent_voxel_layer [![Build Status](http://build.ros2.org/buildStatus/icon?job=Edev__nonpersistent_voxel_layer__ubuntu_bionic_amd64)](http://build.ros2.org/job/Edev__nonpersistent_voxel_layer__ubuntu_bionic_amd64/)

<a href="https://www.buymeacoffee.com/stevemacenski" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>

ROS drop in replacement to the voxel layer which does not persist readings through iterations when ray tracing or map maintenance is undesirable.
ROS2 drop in replacement to the voxel layer which does not persist readings through iterations when ray tracing or map maintenance is undesirable.

Bloom released, install via

```
sudo apt-get update && sudo apt-get install ros-kinetic-nonpersistent-voxel-layer
sudo apt-get update && sudo apt-get install ros-eloquent-nonpersistent-voxel-layer
```

Created in response to need for a rolling local costmap layer to not persist readings due to a specific sensor being used. After looking through the community, it seems several people on ros answers have asked for a similar tool. This is to make that possible. This also helps with sensors like sonars, blob marking, radars, etc that aren't dense enough to clear effectively.

Build and tested on ROS1 Kinetic, verified working in Indigo and Melodic

http://wiki.ros.org/nonpersistent_voxel_grid

## Example Use

### in costmap commons
```
nonpersisting_obstacle_layer:
enabled: true
track_unknown_space: true
max_obstacle_height: 1.8
unknown_threshold: 15
mark_threshold: 2
combination_method: 1
obstacle_range: 3.0
origin_z: 0.
z_resolution: 0.05
z_voxels: 16
publish_voxel_map: true
observation_sources: rgbd
rgbd:
data_type: PointCloud2
topic: camera/depth/points
marking: true
min_obstacle_height: 0.7
max_obstacle_height: 1.7
global_costmap:
global_costmap:
ros__parameters:
nonpersisting_obstacle_layer:
enabled: true
track_unknown_space: true
max_obstacle_height: 1.8
unknown_threshold: 15
mark_threshold: 2
combination_method: 1
obstacle_range: 3.0
origin_z: 0.
z_resolution: 0.05
z_voxels: 16
publish_voxel_map: true
observation_sources: rgbd
rgbd:
data_type: PointCloud2
topic: camera/depth/points
marking: true
min_obstacle_height: 0.7
max_obstacle_height: 1.7
```
### in list of plugins for local/global
```
plugins:
- {name: nonpersisting_obstacle_layer, type: "costmap_2d::NonPersistentVoxelLayer"}
global_costmap:
global_costmap:
ros__parameters:
use_sim_time: True
plugin_names: ["static_layer", "nonpersisting_obstacle_layer"]
plugin_types: ["nav2_costmap_2d::StaticLayer", "nav2_costmap_2d::NonPersistentVoxelLayer"]
```

## parameters
Expand Down
22 changes: 0 additions & 22 deletions cfg/NonPersistentVoxelPlugin.cfg

This file was deleted.

12 changes: 5 additions & 7 deletions costmap_plugins.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<class_libraries>
<library path="lib/libnonpersistent_voxel_layer">
<class type="costmap_2d::NonPersistentVoxelLayer" base_class_type="costmap_2d::Layer">
<description>Similar to voxel costmap, but 3D stored data is not saved between iterations.</description>
</class>
</library>
</class_libraries>
<library path="nonpersistent_voxel_layer_core">
<class name="nav2_costmap_2d/NonPersistentVoxelLayer" type="nav2_costmap_2d::NonPersistentVoxelLayer" base_class_type="nav2_costmap_2d::Layer">
<description>Similar to voxel costmap, but 3D stored data is not saved between iterations.</description>
</class>
</library>
49 changes: 26 additions & 23 deletions example/costmap_config.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
# in costmap commons
nonpersisting_obstacle_layer:
enabled: true
track_unknown_space: true
max_obstacle_height: 1.7
unknown_threshold: 15
mark_threshold: 0
combination_method: 1
obstacle_range: 3.0
origin_z: 0.2
z_resolution: 0.1
z_voxels: 16
publish_voxel_map: true
observation_sources: rgbd
rgbd:
data_type: PointCloud2
topic: camera/depth/points
marking: true
min_obstacle_height: 0.7
max_obstacle_height: 1.7
global_costmap:
global_costmap:
ros__parameters:
# in costmap commons
nonpersisting_obstacle_layer:
enabled: true
track_unknown_space: true
max_obstacle_height: 1.7
unknown_threshold: 15
mark_threshold: 0
combination_method: 1
obstacle_range: 10.0
origin_z: 0.0
z_resolution: 0.05
z_voxels: 16
publish_voxel_map: true
observation_sources: rgbd
rgbd:
data_type: PointCloud2
topic: camera/depth/points
marking: true
min_obstacle_height: 0.0
max_obstacle_height: 1.7

# in list of plugins for local/global
plugins:
- {name: nonpersisting_obstacle_layer, type: "costmap_2d::NonPersistentVoxelLayer"}
# in list of plugins for local/global
plugins:
- {name: nonpersisting_obstacle_layer, type: "nav2_costmap_2d/NonPersistentVoxelLayer"}
Loading

0 comments on commit 90b8385

Please sign in to comment.