Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/thirdparty.repos
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ repositories:
ThirdParty/EasyNavigation:
type: git
url: https://github.com/EasyNavigation/EasyNavigation.git
version: rolling
version: rolling
ThirdParty/octomap_ros:
type: git
url: https://github.com/estherag/octomap_ros.git
version: ros2
15 changes: 8 additions & 7 deletions .github/workflows/rolling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,18 @@ jobs:
package-name: easynav_octomap_maps_builder
target-ros2-distro: rolling
vcs-repo-file-url: ${GITHUB_WORKSPACE}/.github/thirdparty.repos
skip-tests: true
colcon-defaults: |
{
"test": {
"parallel-workers" : 1
}
}
colcon-mixin-name: coverage-gcc
{
"build": {
"packages-up-to": true,
"mixin": ["coverage-gcc"]
}
}
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml

- name: Codecov
uses: codecov/codecov-action@v5.4.2
uses: codecov/codecov-action@v5.4.0
with:
files: ros_ws/lcov/total_coverage.info
flags: unittests
Expand Down
30 changes: 25 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ The `OctomapMapsBuilderNode` subscribes to sensor point cloud topics, processes

## Installation

Clone the repository into your ROS 2 workspace:
Clone the repository into your ROS 2 workspace. Temporarilly you will need to install octomap-ros from a ThirdParties:

```bash
cd ~/ros2_ws/src
git clone https://github.com/EasyNavigation/easynav_octomap_stack.git
vcs import < easynav_octomap_stack/thirdparty.repos
cd ..
rosdep install --from-paths src --ignore-src -r -y
colcon build --packages-select easynav_octomap_maps_builder
Expand All @@ -26,16 +28,33 @@ Source your workspace:
```bash
source ~/ros2_ws/install/setup.bash
```
Run the lifecycle node:
```bash
ros2 run easynav_octomap_maps_builder octomap_maps_builder_node

Create a parameter YAML file (e.g., `params.yaml`) with the following content:

```yaml
octomap_maps_builder_node:
ros__parameters:
use_sim_time: true
sensors: [map]
downsample_resolution: 0.1
perception_default_frame: map
map:
topic: map
type: sensor_msgs/msg/PointCloud2
group: points
```

Run the node using the parameter file with this command:
```
ros2 run easynav_octomap_maps_builder octomap_maps_builder_main \
--ros-args --params-file src/easynav_octomap_stack/params.yaml
```

## Parameters

| Parameter | Type | Default | Description |
|-------------------------|--------|--------------|------------------------------------------------|
| `sensor_topic` | string | `"map"` | Topic name for incoming sensor point clouds. |
| `sensors` | list | - | Topic names for incoming sensor point clouds. |
| `downsample_resolution` | double | `1.0` | Downsampling resolution for input point clouds.|
| `perception_default_frame` | string | `"map"` | Default target frame for perception fusion. |
| `sensor_model.max_range`| double | `90.0` | Maximum sensor range for raycasting. |
Expand All @@ -46,3 +65,4 @@ ros2 run easynav_octomap_maps_builder octomap_maps_builder_node
| `publish_binary_map` | bool | `true` | Enable publishing of binary octomap message. |
| `publish_full_map` | bool | `true` | Enable publishing of full octomap message. |
| `world_frame_id` | string | `"map"` | Global coordinate frame for map integration. |

107 changes: 62 additions & 45 deletions easynav_octomap_maps_builder/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,83 +1,86 @@
cmake_minimum_required(VERSION 3.20)
project(easynav_octomap_maps_builder)

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

set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# Dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_lifecycle REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(easynav_common REQUIRED)
find_package(octomap_msgs REQUIRED)
find_package(octomap_ros REQUIRED)
find_package(pcl_conversions REQUIRED)
find_package(pcl_ros REQUIRED)
find_package(visualization_msgs REQUIRED)

find_package(PCL REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})

find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()
find_package(OCTOMAP REQUIRED)


set(dependencies
rclcpp
rclcpp_lifecycle
sensor_msgs
tf2
tf2_ros
octomap_ros
octomap_msgs
pcl_conversions
pcl_ros
easynav_common
)


include_directories(include)


# Library
# Main library
add_library(${PROJECT_NAME} SHARED
src/easynav_octomap_maps_builder/OctomapMapsBuilderNode.cpp
)
ament_target_dependencies(${PROJECT_NAME} ${dependencies})

target_link_libraries(${PROJECT_NAME}
${OCTOMAP_LIBRARIES}
${PCL_LIBRARIES}
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>
${octomap_ros_INCLUDE_DIRS}
)

# Executable
add_executable(octomap_maps_builder_main src/octomap_maps_builder_main.cpp)
ament_target_dependencies(octomap_maps_builder_main ${dependencies})
target_link_libraries(octomap_maps_builder_main ${PROJECT_NAME})

# Install headers
install(DIRECTORY include/
DESTINATION include/
# Link against ROS2 targets and external libs
target_link_libraries(${PROJECT_NAME} PUBLIC
${octomap_msgs_TARGETS}
${octomap_ros_TARGETS}
${sensor_msgs_TARGETS}
${visualization_msgs_TARGETS}
${OCTOMAP_LIBRARIES}
${OCTOMATH_LIBRARIES}
easynav_common::easynav_common
pcl_conversions::pcl_conversions
pcl_ros::bag_to_pcd_lib
pcl_ros::combined_pointcloud_to_pcd_lib
pcl_ros::pcd_to_pointcloud_lib
pcl_ros::pcl_ros_filter
pcl_ros::pcl_ros_filters
pcl_ros::pcl_ros_tf
pcl_ros::pointcloud_to_pcd_lib
rclcpp::rclcpp
rclcpp_lifecycle::rclcpp_lifecycle
sensor_msgs::sensor_msgs_library
tf2::tf2
tf2_geometry_msgs::tf2_geometry_msgs
tf2_ros::static_transform_broadcaster_node
tf2_ros::tf2_ros
)

# Install targets
install(TARGETS
${PROJECT_NAME}
octomap_maps_builder_main
# Install library and headers
install(
DIRECTORY include/
DESTINATION include/${PROJECT_NAME}
)
install(
TARGETS ${PROJECT_NAME}
EXPORT export_${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib/${PROJECT_NAME}
)

# Main executable
add_executable(octomap_maps_builder_main src/octomap_maps_builder_main.cpp)
target_link_libraries(octomap_maps_builder_main PUBLIC
${PROJECT_NAME}
)

# Tests
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
Expand All @@ -89,9 +92,23 @@ if(BUILD_TESTING)
add_subdirectory(tests)
endif()

# Export
ament_export_include_directories(include)
# Export for downstream
ament_export_include_directories(include/${PROJECT_NAME})
ament_export_libraries(${PROJECT_NAME})
ament_export_dependencies(${dependencies})
ament_export_targets(export_${PROJECT_NAME})
ament_export_dependencies(
rclcpp
rclcpp_lifecycle
sensor_msgs
tf2
tf2_ros
tf2_geometry_msgs
easynav_common
octomap_msgs
octomap_ros
pcl_conversions
pcl_ros
visualization_msgs
)

ament_package()
Loading