-
Notifications
You must be signed in to change notification settings - Fork 97
feat(Ouster): implement nebula's Ouster port as a submodule #436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Samahu
wants to merge
22
commits into
tier4:main
Choose a base branch
from
Samahu:add-ouster-lidar-support-via-submodule
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 13 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
893e49d
Implement nebula's Ouster port as a submodule
Samahu b4ef2ac
ci(pre-commit): autofix
pre-commit-ci[bot] 56dfd0f
Address cpplint complaints
Samahu 60a5dd2
Update to a working branch
Samahu 3b9c37b
Revert back to master branch on OusterSDK side and correct default pa…
Samahu d4de693
Support retrieving ouster-sdk from an external dependency_ws directory
Samahu c716333
Test out adding zipcmp as a dependency
Samahu 7b1cab2
fix libzip dependency and curl
Samahu ddc13a1
Fix stringop-overflow error
Samahu 0480e96
Fix stringop-overflow error
Samahu c1d6467
Supress spelling error
Samahu b2f016c
Merge pull request #3 from Samahu/add-ouster-lidar-support-via-submod…
Samahu 1edc9ce
ci(pre-commit): autofix
github-actions[bot] d7bfe2b
Switch to using git submodules instead of the vcs import + Update rel…
Samahu c994c51
ci(pre-commit): autofix
github-actions[bot] b7b24bf
Bump version numbers
Samahu 22ed451
Add ouster-sdk submodule ref
Samahu d43fb71
Add Ouster coverage flags and hw_interface unit tests
Copilot aacde34
Address code review: add error checking in test helpers
Copilot 8363961
Use configured IP address in the test and set REUSEADDR and REUSEPORT…
Samahu 751e137
Merge pull request #5 from Samahu/copilot/fix-coverage-drop-in-lidar-…
Samahu f2810f3
ci(pre-commit): autofix
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # Nebula ouster sensor package | ||
|
|
||
| A minimal template sensor package for the Nebula LiDAR driver framework. | ||
|
|
||
| ## Purpose | ||
|
|
||
| This package is a starting point for adding new sensor support to Nebula. It compiles, launches, | ||
| and exercises the ROS packet/pointcloud pipeline with intentionally minimal behavior. | ||
|
|
||
| The ouster decoder does not invent fake sensor geometry. It only counts packets, reports a scan | ||
| boundary every 10 packets, and emits an empty pointcloud for that scan. Replace that logic with | ||
| real packet parsing and scan-cutting for your sensor. | ||
|
|
||
| ## Package structure | ||
|
|
||
| The ouster sensor consists of four packages: | ||
|
|
||
| - **nebula_ouster_common** - Common definitions and configuration structures | ||
| - **nebula_ouster_decoders** - Packet decoder and driver implementation | ||
| - **nebula_ouster_hw_interfaces** - Hardware interface for sensor communication | ||
| - **nebula_ouster** - ROS 2 wrapper and launch files | ||
|
|
||
| ## Building | ||
|
|
||
| ```bash | ||
| colcon build --packages-up-to nebula_ouster | ||
| ``` | ||
|
|
||
| ## Running | ||
|
|
||
| ```bash | ||
| # Online mode (with hardware) | ||
| ros2 launch nebula_ouster nebula_ouster.launch.xml | ||
| # Offline mode (replay from rosbag) | ||
| ros2 launch nebula_ouster nebula_ouster.launch.xml launch_hw:=false | ||
| ``` | ||
|
|
||
| ## Using as a template | ||
|
|
||
| For detailed instructions on how to use this package as a template for adding a new sensor, please refer to the [Integration guide](../../docs/integration_guide.md). | ||
|
|
||
| The guide covers: | ||
|
|
||
| 1. Cloning and renaming the package | ||
| 2. Implementing sensor-specific logic | ||
| 3. Verifying the new implementation | ||
|
|
||
| ## Key components | ||
|
|
||
| ### Configuration (`*_common`) | ||
|
|
||
| - `OusterSensorConfiguration` - Minimal sensor-specific settings for an IP-based sensor | ||
|
|
||
| ### Decoder (`*_decoders`) | ||
|
|
||
| - `OusterDecoder` - Minimal decoder stub with packet counting and scan-boundary callbacks | ||
| - `PacketDecodeResult` - Decoder output containing metadata/error and performance counters | ||
| - `DecodeError` - Decoder error codes for packet handling failures | ||
|
|
||
| ### Hardware interface (`*_hw_interfaces`) | ||
|
|
||
| - `OusterHwInterface` - Sensor communication interface | ||
|
|
||
| ### ROS wrapper | ||
|
|
||
| - `OusterRosWrapper` - ROS 2 node wrapping the driver | ||
| - Point cloud publisher on `/points` | ||
| - Packet publish/replay topic on `/packets` (`nebula_msgs/msg/NebulaPackets`) depending on | ||
| runtime mode (`launch_hw` parameter) | ||
|
|
||
| ## Reference implementation | ||
|
|
||
| This package provides a template structure for adding new sensor support. For complete examples, | ||
| refer to existing sensor packages like `nebula_hesai` or `nebula_velodyne`. | ||
|
|
||
| **For detailed integration instructions, see the [Integration guide](../../docs/integration_guide.md) in the documentation.** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| cmake_minimum_required(VERSION 3.20) | ||
| project(nebula_ouster) | ||
|
|
||
| find_package(autoware_cmake REQUIRED) | ||
| autoware_package() | ||
|
|
||
| # Ouster | ||
| add_library( | ||
| ouster_ros_wrapper SHARED | ||
| src/ouster_ros_wrapper.cpp) | ||
|
|
||
| set(_nebula_ouster_sdk_candidates | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/../../../ouster-sdk" | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/../../../dependency_ws/ouster-sdk" | ||
| ) | ||
|
|
||
| set(_nebula_ouster_sdk "") | ||
| foreach(_candidate IN LISTS _nebula_ouster_sdk_candidates) | ||
| if(EXISTS "${_candidate}/CMakeLists.txt") | ||
| set(_nebula_ouster_sdk "${_candidate}") | ||
| break() | ||
| endif() | ||
| endforeach() | ||
|
|
||
| if(_nebula_ouster_sdk STREQUAL "") | ||
| message(FATAL_ERROR | ||
| "nebula_ouster_decoders: ouster-sdk is missing. Checked: ${_nebula_ouster_sdk_candidates}") | ||
| endif() | ||
|
|
||
| set(BUILD_SENSOR ON CACHE BOOL "Ouster SDK: sensor module" FORCE) | ||
| set(BUILD_PCAP OFF CACHE BOOL "Ouster SDK: pcap" FORCE) | ||
| set(BUILD_OSF OFF CACHE BOOL "Ouster SDK: osf" FORCE) | ||
| set(BUILD_VIZ OFF CACHE BOOL "Ouster SDK: visualizer" FORCE) | ||
| set(BUILD_MAPPING OFF CACHE BOOL "Ouster SDK: mapping" FORCE) | ||
| set(BUILD_TESTING OFF CACHE BOOL "Ouster SDK: tests" FORCE) | ||
| set(BUILD_EXAMPLES OFF CACHE BOOL "Ouster SDK: examples" FORCE) | ||
| set(BUILD_PYTHON_MODULE OFF CACHE BOOL "Ouster SDK: python" FORCE) | ||
|
|
||
| add_subdirectory("${_nebula_ouster_sdk}" "${CMAKE_CURRENT_BINARY_DIR}/ouster-sdk-build") | ||
|
|
||
| if(TARGET ouster_client) | ||
| target_compile_options(ouster_client PRIVATE -Wno-pedantic) | ||
| if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||
| target_compile_options(ouster_client PRIVATE -Wno-error=stringop-overflow) # cspell:ignore stringop | ||
| endif() | ||
| endif() | ||
| if(TARGET ouster_sensor) | ||
| target_compile_options(ouster_sensor PRIVATE -Wno-pedantic) | ||
| endif() | ||
|
|
||
| target_include_directories( | ||
| ouster_ros_wrapper | ||
| PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
| $<BUILD_INTERFACE:${_nebula_ouster_sdk}/ouster_client/include/optional-lite> | ||
| $<BUILD_INTERFACE:${_nebula_ouster_sdk}/ouster_sensor/include> | ||
| $<INSTALL_INTERFACE:include>) | ||
|
|
||
| target_link_libraries( | ||
| ouster_ros_wrapper | ||
| PUBLIC diagnostic_updater::diagnostic_updater | ||
| nebula_ouster_decoders::nebula_ouster_decoders | ||
| nebula_ouster_hw_interfaces::nebula_ouster_hw_interfaces | ||
| nebula_core_ros::nebula_core_ros | ||
| PRIVATE ouster_client | ||
| ouster_sensor) | ||
| ament_target_dependencies( | ||
| ouster_ros_wrapper | ||
| PUBLIC | ||
| diagnostic_msgs | ||
| nebula_msgs | ||
| rclcpp | ||
| rclcpp_components | ||
| sensor_msgs | ||
| std_msgs) | ||
|
|
||
| rclcpp_components_register_node(ouster_ros_wrapper PLUGIN "nebula::ros::OusterRosWrapper" | ||
| EXECUTABLE ouster_ros_wrapper_node) | ||
|
|
||
| install( | ||
| TARGETS ouster_ros_wrapper | ||
| EXPORT export_ouster_ros_wrapper | ||
| LIBRARY DESTINATION lib) | ||
| install(DIRECTORY include/${PROJECT_NAME}/ DESTINATION include/${PROJECT_NAME}) | ||
|
|
||
| install(DIRECTORY config launch DESTINATION share/${PROJECT_NAME}) | ||
|
|
||
| ament_export_include_directories("include/${PROJECT_NAME}") | ||
| ament_export_targets(export_ouster_ros_wrapper) | ||
|
|
||
| ament_export_dependencies( | ||
| diagnostic_msgs | ||
| diagnostic_updater | ||
| nebula_core_common | ||
| nebula_ouster_common | ||
| nebula_core_decoders | ||
| nebula_ouster_decoders | ||
| nebula_core_hw_interfaces | ||
| nebula_ouster_hw_interfaces | ||
| nebula_core_ros | ||
| nebula_msgs | ||
| rclcpp_components | ||
| sensor_msgs | ||
| std_msgs) | ||
|
|
||
| ament_package() | ||
40 changes: 40 additions & 0 deletions
40
src/nebula_ouster/nebula_ouster/config/ouster_sensor.param.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # Ouster Sensor ROS 2 Parameters | ||
| # This file contains example parameters for the Ouster LiDAR sensor. | ||
| # Copy and modify this file for your specific sensor model. | ||
|
|
||
| /**: | ||
| ros__parameters: | ||
| # ROS wrapper configuration | ||
| sensor_model: OS0-64 | ||
| launch_hw: true | ||
| frame_id: ouster_lidar | ||
| use_sensor_extrinsics: false | ||
|
|
||
| # Network configuration | ||
| connection: | ||
| sensor_ip: 169.254.119.211 | ||
| host_ip: 169.254.242.38 | ||
| data_port: 7502 | ||
| filter_sender_ip: true | ||
|
|
||
| # Decoder configuration | ||
| fov: | ||
| azimuth: | ||
| min_deg: 0.0 | ||
| max_deg: 360.0 | ||
| elevation: | ||
| min_deg: -90.0 | ||
| max_deg: 90.0 | ||
|
|
||
| # Diagnostics configuration | ||
| diagnostics: | ||
| pointcloud_publish_rate: | ||
| frequency_ok: | ||
| min_hz: 9.0 | ||
| max_hz: 11.0 | ||
| frequency_warn: | ||
| min_hz: 8.0 | ||
| max_hz: 12.0 | ||
| num_frame_transition: 1 | ||
| packet_liveness: | ||
| timeout_ms: 1000 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.