Skip to content

Commit 90b8385

Browse files
Eloquent pr test (#13)
* 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
1 parent c9481ef commit 90b8385

File tree

8 files changed

+322
-329
lines changed

8 files changed

+322
-329
lines changed

‎CMakeLists.txt‎

Lines changed: 94 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,114 @@
1-
cmake_minimum_required(VERSION 2.8.3)
1+
cmake_minimum_required(VERSION 3.5)
22
project(nonpersistent_voxel_layer)
33

4-
find_package(catkin REQUIRED
5-
COMPONENTS
6-
cmake_modules
7-
dynamic_reconfigure
8-
geometry_msgs
9-
laser_geometry
10-
map_msgs
11-
message_filters
12-
message_generation
13-
nav_msgs
14-
pcl_conversions
15-
pcl_ros
16-
pluginlib
17-
roscpp
18-
sensor_msgs
19-
std_msgs
20-
tf
21-
visualization_msgs
22-
voxel_grid
23-
costmap_2d
24-
)
25-
26-
find_package(PCL REQUIRED)
27-
remove_definitions(-DDISABLE_LIBUSB-1.0)
4+
if(NOT WIN32)
5+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
6+
endif()
7+
8+
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
9+
add_compile_options(-Wall -Wextra -Wpedantic)
10+
endif()
11+
12+
find_package(ament_cmake REQUIRED)
13+
find_package(geometry_msgs REQUIRED)
14+
find_package(laser_geometry REQUIRED)
15+
find_package(map_msgs REQUIRED)
16+
find_package(message_filters REQUIRED)
17+
find_package(nav_msgs REQUIRED)
18+
find_package(nav2_msgs REQUIRED)
19+
find_package(pcl_conversions REQUIRED)
20+
find_package(pluginlib REQUIRED)
21+
find_package(sensor_msgs REQUIRED)
22+
find_package(rclcpp REQUIRED)
23+
find_package(std_msgs REQUIRED)
24+
find_package(tf2 REQUIRED)
25+
find_package(tf2_ros REQUIRED)
26+
find_package(visualization_msgs REQUIRED)
27+
find_package(nav2_voxel_grid REQUIRED)
28+
find_package(nav2_costmap_2d REQUIRED)
2829
find_package(Eigen3 REQUIRED)
29-
find_package(Boost REQUIRED COMPONENTS system thread)
30+
31+
find_package(PCL REQUIRED COMPONENTS filters common)
32+
if(NOT "${PCL_LIBRARIES}" STREQUAL "")
33+
# This package fails to build on Debian Stretch with a linking error against
34+
# 'Qt5::Widgets'. This is a transitive dependency that comes in to PCL via
35+
# the PCL dependency on VTK. However, we don't actually care about the Qt
36+
# dependencies for this package, so just remove them. This is similar to the
37+
# workaround in https://github.com/ros-perception/perception_pcl/pull/151,
38+
# and can be removed when Stretch goes out of support.
39+
list(REMOVE_ITEM PCL_LIBRARIES
40+
"vtkGUISupportQt"
41+
"vtkGUISupportQtOpenGL"
42+
"vtkGUISupportQtSQL"
43+
"vtkGUISupportQtWebkit"
44+
"vtkViewsQt"
45+
"vtkRenderingQt")
46+
endif()
47+
48+
set(dependencies
49+
geometry_msgs
50+
laser_geometry
51+
map_msgs
52+
message_filters
53+
nav_msgs
54+
pcl_conversions
55+
pluginlib
56+
sensor_msgs
57+
nav2_msgs
58+
rclcpp
59+
std_msgs
60+
tf2
61+
tf2_ros
62+
visualization_msgs
63+
nav2_voxel_grid
64+
nav2_costmap_2d)
65+
66+
set(library_name nonpersistent_voxel_layer_core)
67+
68+
add_definitions(${EIGEN3_DEFINITIONS})
69+
3070
include_directories(
3171
include
32-
${catkin_INCLUDE_DIRS}
33-
${EIGEN3_INCLUDE_DIRS}
3472
${PCL_INCLUDE_DIRS}
35-
${Boost_INCLUDE_DIRS}
73+
${EIGEN3_INCLUDE_DIRS}
3674
)
3775

38-
add_definitions(${EIGEN3_DEFINITIONS})
76+
add_library(${library_name} SHARED
77+
plugins/nonpersistent_voxel_layer.cpp
78+
)
3979

40-
# dynamic reconfigure
41-
generate_dynamic_reconfigure_options(
42-
cfg/NonPersistentVoxelPlugin.cfg
80+
target_compile_definitions(${library_name} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")
81+
82+
target_link_libraries(${library_name}
83+
${PCL_LIBRARIES}
84+
${EIGEN3_LIBRARIES}
4385
)
4486

45-
catkin_package(
46-
INCLUDE_DIRS
47-
include
48-
LIBRARIES nonpersistent_voxel_layer
49-
CATKIN_DEPENDS
50-
dynamic_reconfigure
51-
geometry_msgs
52-
laser_geometry
53-
map_msgs
54-
costmap_2d
55-
message_filters
56-
message_runtime
57-
nav_msgs
58-
pcl_ros
59-
pluginlib
60-
roscpp
61-
sensor_msgs
62-
std_msgs
63-
tf
64-
visualization_msgs
65-
voxel_grid
66-
DEPENDS
67-
PCL
68-
EIGEN3
69-
Boost
87+
ament_target_dependencies(${library_name}
88+
${dependencies}
7089
)
7190

72-
add_library(nonpersistent_voxel_layer
73-
plugins/nonpersistent_voxel_layer.cpp
91+
if(BUILD_TESTING)
92+
find_package(ament_lint_auto REQUIRED)
93+
ament_lint_auto_find_test_dependencies()
94+
endif()
95+
96+
install(TARGETS ${library_name}
97+
ARCHIVE DESTINATION lib
98+
LIBRARY DESTINATION lib
99+
RUNTIME DESTINATION lib
74100
)
75-
add_dependencies(nonpersistent_voxel_layer ${PROJECT_NAME}_gencfg)
76-
target_link_libraries(nonpersistent_voxel_layer ${catkin_LIBRARIES})
77101

78-
install(TARGETS
79-
nonpersistent_voxel_layer
80-
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
81-
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
102+
install(DIRECTORY example
103+
DESTINATION share
82104
)
83105

84106
install(FILES costmap_plugins.xml
85-
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
107+
DESTINATION share
86108
)
87109

88-
install(DIRECTORY include/nonpersistent_voxel_layer/
89-
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
90-
PATTERN ".svn" EXCLUDE
91-
)
110+
ament_export_include_directories(include)
111+
ament_export_libraries(${library_name})
112+
ament_export_dependencies(${dependencies})
113+
pluginlib_export_plugin_description_file(nav2_costmap_2d costmap_plugins.xml)
114+
ament_package()

‎README.md‎

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,54 @@
1-
# 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/)
1+
# 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/)
22

33
<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>
44

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

77
Bloom released, install via
88

99
```
10-
sudo apt-get update && sudo apt-get install ros-kinetic-nonpersistent-voxel-layer
10+
sudo apt-get update && sudo apt-get install ros-eloquent-nonpersistent-voxel-layer
1111
```
1212

1313
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.
1414

15-
Build and tested on ROS1 Kinetic, verified working in Indigo and Melodic
16-
1715
http://wiki.ros.org/nonpersistent_voxel_grid
1816

1917
## Example Use
2018

2119
### in costmap commons
2220
```
23-
nonpersisting_obstacle_layer:
24-
enabled: true
25-
track_unknown_space: true
26-
max_obstacle_height: 1.8
27-
unknown_threshold: 15
28-
mark_threshold: 2
29-
combination_method: 1
30-
obstacle_range: 3.0
31-
origin_z: 0.
32-
z_resolution: 0.05
33-
z_voxels: 16
34-
publish_voxel_map: true
35-
observation_sources: rgbd
36-
rgbd:
37-
data_type: PointCloud2
38-
topic: camera/depth/points
39-
marking: true
40-
min_obstacle_height: 0.7
41-
max_obstacle_height: 1.7
21+
global_costmap:
22+
global_costmap:
23+
ros__parameters:
24+
nonpersisting_obstacle_layer:
25+
enabled: true
26+
track_unknown_space: true
27+
max_obstacle_height: 1.8
28+
unknown_threshold: 15
29+
mark_threshold: 2
30+
combination_method: 1
31+
obstacle_range: 3.0
32+
origin_z: 0.
33+
z_resolution: 0.05
34+
z_voxels: 16
35+
publish_voxel_map: true
36+
observation_sources: rgbd
37+
rgbd:
38+
data_type: PointCloud2
39+
topic: camera/depth/points
40+
marking: true
41+
min_obstacle_height: 0.7
42+
max_obstacle_height: 1.7
4243
```
4344
### in list of plugins for local/global
4445
```
45-
plugins:
46-
- {name: nonpersisting_obstacle_layer, type: "costmap_2d::NonPersistentVoxelLayer"}
46+
global_costmap:
47+
global_costmap:
48+
ros__parameters:
49+
use_sim_time: True
50+
plugin_names: ["static_layer", "nonpersisting_obstacle_layer"]
51+
plugin_types: ["nav2_costmap_2d::StaticLayer", "nav2_costmap_2d::NonPersistentVoxelLayer"]
4752
```
4853

4954
## parameters

‎cfg/NonPersistentVoxelPlugin.cfg‎

Lines changed: 0 additions & 22 deletions
This file was deleted.

‎costmap_plugins.xml‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
<class_libraries>
2-
<library path="lib/libnonpersistent_voxel_layer">
3-
<class type="costmap_2d::NonPersistentVoxelLayer" base_class_type="costmap_2d::Layer">
4-
<description>Similar to voxel costmap, but 3D stored data is not saved between iterations.</description>
5-
</class>
6-
</library>
7-
</class_libraries>
1+
<library path="nonpersistent_voxel_layer_core">
2+
<class name="nav2_costmap_2d/NonPersistentVoxelLayer" type="nav2_costmap_2d::NonPersistentVoxelLayer" base_class_type="nav2_costmap_2d::Layer">
3+
<description>Similar to voxel costmap, but 3D stored data is not saved between iterations.</description>
4+
</class>
5+
</library>

‎example/costmap_config.yaml‎

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
1-
# in costmap commons
2-
nonpersisting_obstacle_layer:
3-
enabled: true
4-
track_unknown_space: true
5-
max_obstacle_height: 1.7
6-
unknown_threshold: 15
7-
mark_threshold: 0
8-
combination_method: 1
9-
obstacle_range: 3.0
10-
origin_z: 0.2
11-
z_resolution: 0.1
12-
z_voxels: 16
13-
publish_voxel_map: true
14-
observation_sources: rgbd
15-
rgbd:
16-
data_type: PointCloud2
17-
topic: camera/depth/points
18-
marking: true
19-
min_obstacle_height: 0.7
20-
max_obstacle_height: 1.7
1+
global_costmap:
2+
global_costmap:
3+
ros__parameters:
4+
# in costmap commons
5+
nonpersisting_obstacle_layer:
6+
enabled: true
7+
track_unknown_space: true
8+
max_obstacle_height: 1.7
9+
unknown_threshold: 15
10+
mark_threshold: 0
11+
combination_method: 1
12+
obstacle_range: 10.0
13+
origin_z: 0.0
14+
z_resolution: 0.05
15+
z_voxels: 16
16+
publish_voxel_map: true
17+
observation_sources: rgbd
18+
rgbd:
19+
data_type: PointCloud2
20+
topic: camera/depth/points
21+
marking: true
22+
min_obstacle_height: 0.0
23+
max_obstacle_height: 1.7
2124

22-
# in list of plugins for local/global
23-
plugins:
24-
- {name: nonpersisting_obstacle_layer, type: "costmap_2d::NonPersistentVoxelLayer"}
25+
# in list of plugins for local/global
26+
plugins:
27+
- {name: nonpersisting_obstacle_layer, type: "nav2_costmap_2d/NonPersistentVoxelLayer"}

0 commit comments

Comments
 (0)