Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Commit 052de8a

Browse files
authored
Merge pull request #2 from estherag/rolling
Update blackboard
2 parents e0f1e9e + fc49fa5 commit 052de8a

11 files changed

Lines changed: 340 additions & 228 deletions

File tree

.github/thirdparty.repos

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@ repositories:
22
ThirdParty/EasyNavigation:
33
type: git
44
url: https://github.com/EasyNavigation/EasyNavigation.git
5-
version: rolling
5+
version: rolling
6+
ThirdParty/octomap_ros:
7+
type: git
8+
url: https://github.com/estherag/octomap_ros.git
9+
version: ros2

.github/workflows/rolling.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,18 @@ jobs:
3131
package-name: easynav_octomap_maps_builder
3232
target-ros2-distro: rolling
3333
vcs-repo-file-url: ${GITHUB_WORKSPACE}/.github/thirdparty.repos
34+
skip-tests: true
3435
colcon-defaults: |
35-
{
36-
"test": {
37-
"parallel-workers" : 1
38-
}
39-
}
40-
colcon-mixin-name: coverage-gcc
36+
{
37+
"build": {
38+
"packages-up-to": true,
39+
"mixin": ["coverage-gcc"]
40+
}
41+
}
4142
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
4243

4344
- name: Codecov
44-
uses: codecov/codecov-action@v5.4.2
45+
uses: codecov/codecov-action@v5.4.0
4546
with:
4647
files: ros_ws/lcov/total_coverage.info
4748
flags: unittests

README.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ The `OctomapMapsBuilderNode` subscribes to sensor point cloud topics, processes
1111

1212
## Installation
1313

14-
Clone the repository into your ROS 2 workspace:
14+
Clone the repository into your ROS 2 workspace. Temporarilly you will need to install octomap-ros from a ThirdParties:
15+
1516
```bash
1617
cd ~/ros2_ws/src
1718
git clone https://github.com/EasyNavigation/easynav_octomap_stack.git
19+
vcs import < easynav_octomap_stack/thirdparty.repos
1820
cd ..
1921
rosdep install --from-paths src --ignore-src -r -y
2022
colcon build --packages-select easynav_octomap_maps_builder
@@ -26,16 +28,33 @@ Source your workspace:
2628
```bash
2729
source ~/ros2_ws/install/setup.bash
2830
```
29-
Run the lifecycle node:
30-
```bash
31-
ros2 run easynav_octomap_maps_builder octomap_maps_builder_node
31+
32+
Create a parameter YAML file (e.g., `params.yaml`) with the following content:
33+
34+
```yaml
35+
octomap_maps_builder_node:
36+
ros__parameters:
37+
use_sim_time: true
38+
sensors: [map]
39+
downsample_resolution: 0.1
40+
perception_default_frame: map
41+
map:
42+
topic: map
43+
type: sensor_msgs/msg/PointCloud2
44+
group: points
45+
```
46+
47+
Run the node using the parameter file with this command:
48+
```
49+
ros2 run easynav_octomap_maps_builder octomap_maps_builder_main \
50+
--ros-args --params-file src/easynav_octomap_stack/params.yaml
3251
```
3352

3453
## Parameters
3554

3655
| Parameter | Type | Default | Description |
3756
|-------------------------|--------|--------------|------------------------------------------------|
38-
| `sensor_topic` | string | `"map"` | Topic name for incoming sensor point clouds. |
57+
| `sensors` | list | - | Topic names for incoming sensor point clouds. |
3958
| `downsample_resolution` | double | `1.0` | Downsampling resolution for input point clouds.|
4059
| `perception_default_frame` | string | `"map"` | Default target frame for perception fusion. |
4160
| `sensor_model.max_range`| double | `90.0` | Maximum sensor range for raycasting. |
@@ -46,3 +65,4 @@ ros2 run easynav_octomap_maps_builder octomap_maps_builder_node
4665
| `publish_binary_map` | bool | `true` | Enable publishing of binary octomap message. |
4766
| `publish_full_map` | bool | `true` | Enable publishing of full octomap message. |
4867
| `world_frame_id` | string | `"map"` | Global coordinate frame for map integration. |
68+
Lines changed: 62 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,86 @@
11
cmake_minimum_required(VERSION 3.20)
22
project(easynav_octomap_maps_builder)
33

4-
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
4+
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
55
add_compile_options(-Wall -Wextra -Wpedantic)
66
endif()
77

88
set(CMAKE_CXX_STANDARD 23)
99
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1010
set(CMAKE_CXX_EXTENSIONS OFF)
1111

12-
# Dependencies
1312
find_package(ament_cmake REQUIRED)
1413
find_package(rclcpp REQUIRED)
1514
find_package(rclcpp_lifecycle REQUIRED)
1615
find_package(sensor_msgs REQUIRED)
1716
find_package(tf2 REQUIRED)
1817
find_package(tf2_ros REQUIRED)
18+
find_package(tf2_geometry_msgs REQUIRED)
1919
find_package(easynav_common REQUIRED)
2020
find_package(octomap_msgs REQUIRED)
2121
find_package(octomap_ros REQUIRED)
2222
find_package(pcl_conversions REQUIRED)
2323
find_package(pcl_ros REQUIRED)
2424
find_package(visualization_msgs REQUIRED)
25-
2625
find_package(PCL REQUIRED)
27-
include_directories(${PCL_INCLUDE_DIRS})
28-
29-
find_package(ament_cmake_auto REQUIRED)
30-
ament_auto_find_build_dependencies()
3126
find_package(OCTOMAP REQUIRED)
3227

33-
34-
set(dependencies
35-
rclcpp
36-
rclcpp_lifecycle
37-
sensor_msgs
38-
tf2
39-
tf2_ros
40-
octomap_ros
41-
octomap_msgs
42-
pcl_conversions
43-
pcl_ros
44-
easynav_common
45-
)
46-
47-
48-
include_directories(include)
49-
50-
51-
# Library
28+
# Main library
5229
add_library(${PROJECT_NAME} SHARED
5330
src/easynav_octomap_maps_builder/OctomapMapsBuilderNode.cpp
5431
)
55-
ament_target_dependencies(${PROJECT_NAME} ${dependencies})
5632

57-
target_link_libraries(${PROJECT_NAME}
58-
${OCTOMAP_LIBRARIES}
59-
${PCL_LIBRARIES}
33+
target_include_directories(${PROJECT_NAME} PUBLIC
34+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
35+
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>
36+
${octomap_ros_INCLUDE_DIRS}
6037
)
6138

62-
# Executable
63-
add_executable(octomap_maps_builder_main src/octomap_maps_builder_main.cpp)
64-
ament_target_dependencies(octomap_maps_builder_main ${dependencies})
65-
target_link_libraries(octomap_maps_builder_main ${PROJECT_NAME})
66-
67-
# Install headers
68-
install(DIRECTORY include/
69-
DESTINATION include/
39+
# Link against ROS2 targets and external libs
40+
target_link_libraries(${PROJECT_NAME} PUBLIC
41+
${octomap_msgs_TARGETS}
42+
${octomap_ros_TARGETS}
43+
${sensor_msgs_TARGETS}
44+
${visualization_msgs_TARGETS}
45+
${OCTOMAP_LIBRARIES}
46+
${OCTOMATH_LIBRARIES}
47+
easynav_common::easynav_common
48+
pcl_conversions::pcl_conversions
49+
pcl_ros::bag_to_pcd_lib
50+
pcl_ros::combined_pointcloud_to_pcd_lib
51+
pcl_ros::pcd_to_pointcloud_lib
52+
pcl_ros::pcl_ros_filter
53+
pcl_ros::pcl_ros_filters
54+
pcl_ros::pcl_ros_tf
55+
pcl_ros::pointcloud_to_pcd_lib
56+
rclcpp::rclcpp
57+
rclcpp_lifecycle::rclcpp_lifecycle
58+
sensor_msgs::sensor_msgs_library
59+
tf2::tf2
60+
tf2_geometry_msgs::tf2_geometry_msgs
61+
tf2_ros::static_transform_broadcaster_node
62+
tf2_ros::tf2_ros
7063
)
7164

72-
# Install targets
73-
install(TARGETS
74-
${PROJECT_NAME}
75-
octomap_maps_builder_main
65+
# Install library and headers
66+
install(
67+
DIRECTORY include/
68+
DESTINATION include/${PROJECT_NAME}
69+
)
70+
install(
71+
TARGETS ${PROJECT_NAME}
72+
EXPORT export_${PROJECT_NAME}
7673
ARCHIVE DESTINATION lib
7774
LIBRARY DESTINATION lib
7875
RUNTIME DESTINATION lib/${PROJECT_NAME}
7976
)
8077

78+
# Main executable
79+
add_executable(octomap_maps_builder_main src/octomap_maps_builder_main.cpp)
80+
target_link_libraries(octomap_maps_builder_main PUBLIC
81+
${PROJECT_NAME}
82+
)
83+
8184
# Tests
8285
if(BUILD_TESTING)
8386
find_package(ament_lint_auto REQUIRED)
@@ -89,9 +92,23 @@ if(BUILD_TESTING)
8992
add_subdirectory(tests)
9093
endif()
9194

92-
# Export
93-
ament_export_include_directories(include)
95+
# Export for downstream
96+
ament_export_include_directories(include/${PROJECT_NAME})
9497
ament_export_libraries(${PROJECT_NAME})
95-
ament_export_dependencies(${dependencies})
98+
ament_export_targets(export_${PROJECT_NAME})
99+
ament_export_dependencies(
100+
rclcpp
101+
rclcpp_lifecycle
102+
sensor_msgs
103+
tf2
104+
tf2_ros
105+
tf2_geometry_msgs
106+
easynav_common
107+
octomap_msgs
108+
octomap_ros
109+
pcl_conversions
110+
pcl_ros
111+
visualization_msgs
112+
)
96113

97114
ament_package()

0 commit comments

Comments
 (0)