Skip to content

feat(Ouster): add ouster lidar support#456

Open
Samahu wants to merge 68 commits into
tier4:mainfrom
Samahu:add-ouster-lidar-support
Open

feat(Ouster): add ouster lidar support#456
Samahu wants to merge 68 commits into
tier4:mainfrom
Samahu:add-ouster-lidar-support

Conversation

@Samahu

@Samahu Samahu commented Jun 18, 2026

Copy link
Copy Markdown

PR Type

  • New Feature

Related Links

Closes #212
Replaces #433
Replaces #436
Replaces #440

Description

The PR resolves all the complaints around the previous attempts, #422, #436, #440. It reduces the number of files required to add support to ouster from 500+ to less than 200 files including the decoders code

In addition, this PR update to ouster-sdk 0.16.2 which adds support for REV8 hardware and color lidar support.
The being said, the driver doesn't yet parse and publish color information even when the sensor supports it.

Review Procedure

  • You no longer need to pull submodules
  • You can build the branch using the following command:
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=1 --packages-up-to nebula_ouster
  • Edit the provided sensor_model.param.yaml and set the sensor_ip and dest_ip to match your environment
  • Launch the sensor using the command
ros2 launch nebula_ouster ouster_launch_all_hw.xml sensor_model:=ouster_sensor

Remarks

Pre-Review Checklist for the PR Author

PR Author should check the checkboxes below when creating the PR.

  • Assign PR to reviewer

Checklist for the PR Reviewer

Reviewers should check the checkboxes below before approval.

  • Commits are properly organized and messages are according to the guideline
  • (Optional) Unit tests have been written for new behavior
  • PR title describes the changes

Post-Review Checklist for the PR Author

PR Author should check the checkboxes below before merging.

  • All open points are addressed and tracked via issues or tickets

CI Checks

  • Build and test for PR: Required to pass before the merge.

@Samahu

Samahu commented Jun 18, 2026

Copy link
Copy Markdown
Author

With regard to sample bag files, I already provided one for FW 3.2 in this comment: #436 (comment)

I will upload one soon for FW 4.0

@Samahu Samahu changed the title feat(Ouster): Add ouster lidar support feat(Ouster): add ouster lidar support Jun 18, 2026
@mojomex

mojomex commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

@Samahu Thank you! Given ROS buildfarm issues with submodules / .repos / FetchContent, the vendored SDK indeed seems like the best option.

Just some very minor feedback before diving into the review:

  • The Autoware project (which we are closely aligned with) uses a convention where lib is project-owned library code, and vendor is used to mark vendored code, so I'd prefer lib/ouster-sdk be renamed to vendor/ouster-sdk.
  • Linters like pre-commit and spell-check-differential are currently scanning ouster-sdk and auto-fixing it which is not desired, since it's vendored code. Could you try and exclude vendor/* dirs from those linters?
  • Could you add a small script, or README section on how to update the vendored Ouster SDK? I feel it is important for maintainers to effortlessly upgrade/pull in any fixes from upstream.

Thank you for your continued cooperation!

@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 24.22907% with 344 lines in your changes missing coverage. Please review.
✅ Project coverage is 24.22%. Comparing base (50b6a0b) to head (4c2a64f).
⚠️ Report is 1 commits behind head on main.

❌ Your patch check has failed because the patch coverage (24.22%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #456       +/-   ##
===========================================
- Coverage   40.18%   24.22%   -15.96%     
===========================================
  Files         132        9      -123     
  Lines       10293      454     -9839     
  Branches     5402      139     -5263     
===========================================
- Hits         4136      110     -4026     
+ Misses       3799      340     -3459     
+ Partials     2358        4     -2354     
Flag Coverage Δ
nebula_ouster 24.22% <24.22%> (?)
nebula_ouster_common 24.22% <24.22%> (?)
nebula_ouster_decoders 24.22% <24.22%> (?)
nebula_ouster_hw_interfaces 24.22% <24.22%> (?)
total ?

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Samahu

Samahu commented Jun 19, 2026

Copy link
Copy Markdown
Author

@Samahu Thank you! Given ROS buildfarm issues with submodules / .repos / FetchContent, the vendored SDK indeed seems like the best option.

Just some very minor feedback before diving into the review:

  • The Autoware project (which we are closely aligned with) uses a convention where lib is project-owned library code, and vendor is used to mark vendored code, so I'd prefer lib/ouster-sdk be renamed to vendor/ouster-sdk.
  • Linters like pre-commit and spell-check-differential are currently scanning ouster-sdk and auto-fixing it which is not desired, since it's vendored code. Could you try and exclude vendor/* dirs from those linters?
  • Could you add a small script, or README section on how to update the vendored Ouster SDK? I feel it is important for maintainers to effortlessly upgrade/pull in any fixes from upstream.

Thank you for your continued cooperation!

At @mojomex I have resolved all the above comments.

@Samahu Samahu marked this pull request as ready for review June 19, 2026 16:07
@Samahu

Samahu commented Jun 19, 2026

Copy link
Copy Markdown
Author

Note that I went back to the moment before pre-commit-ci[autofix] did formatting edits the the sdk code and started from there.

@mojomex mojomex requested review from drwnz and mojomex June 22, 2026 07:12

@mojomex mojomex left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I think this is already really close to what we imagined. I left a few small comments and will test behavior once they are addressed. Please also add an Ouster section to docs/ - just supported sensors and their params, similar to the other vendors are enough.

Please let me know if anything is unclear about Nebula's internal interfaces etc.

Comment thread src/nebula_ouster/nebula_ouster/config/ouster_sensor.param.yaml
Comment thread src/nebula_ouster/nebula_ouster/launch/ouster_launch_all_hw.xml Outdated
Comment thread src/nebula_ouster/nebula_ouster/launch/ouster_launch_all_hw.xml Outdated
Comment thread src/nebula_ouster/nebula_ouster/launch/nebula_ouster.launch.xml Outdated
Comment thread src/nebula_ouster/nebula_ouster_decoders/package.xml Outdated
Comment thread src/nebula_ouster/nebula_ouster/src/ouster_ros_wrapper.cpp Outdated
Comment thread src/nebula_ouster/nebula_ouster/src/ouster_ros_wrapper.cpp Outdated
Comment thread src/nebula_ouster/nebula_ouster/src/ouster_ros_wrapper.cpp Outdated
@Samahu

Samahu commented Jun 23, 2026

Copy link
Copy Markdown
Author

I have resolved 70-80% of the comments .. The CI fails due to spell-check, the majority of these spell checks stems from ouster-sdk code .. but we decided to minimize edits to ouster-sdk code.. The Github workflow pulls the spell-check rules from an external URL (in autoware) .. how should I approach this problem?

@Samahu Samahu requested a review from mojomex June 23, 2026 05:58
@mojomex

mojomex commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

@Samahu Thank you for addressing the feedback! For spell-check, don't worry about it - I'll PR a fix to your branch.

@Samahu

Samahu commented Jun 25, 2026

Copy link
Copy Markdown
Author

Ok, I pushed another update wiring OusterCalibrationData between ouster-ros-wrapper package and the decoder. The http sensor communication is now done completely outside of the decoder code.

@Samahu

Samahu commented Jun 29, 2026

Copy link
Copy Markdown
Author

Ok, I pushed another update wiring OusterCalibrationData between ouster-ros-wrapper package and the decoder. The http sensor communication is now done completely outside of the decoder code.

There was a pre-commit.ci - pr check that was failing that I did not notice before but I have that fixed. Let me know if there is anything missing on our part to proceed with PR getting merged.

@Samahu

Samahu commented Jul 1, 2026

Copy link
Copy Markdown
Author

I have resolved the failing codecov checks by adding ^/vendor* to the exclusion list and rebased the branch at the same time. Can we run the CI again to verify these changes resolve the issue and see if there are more?

@Samahu

Samahu commented Jul 7, 2026

Copy link
Copy Markdown
Author

any update

@marioney

marioney commented Jul 9, 2026

Copy link
Copy Markdown

Hi @Samahu thanks for this. We're also interested in this Feature and are willing to test it in our setup.

Samahu and others added 7 commits July 9, 2026 13:56
The CI build failed because find_package(libzip REQUIRED) was resolving
to the system libzip-config.cmake, which references /usr/bin/zipcmp (from
the libzip-tools package, not installed in CI).

Fix: prepend the ouster-sdk cmake directory to CMAKE_MODULE_PATH before
the find_package call so that the bundled Findlibzip.cmake (which uses
pkg-config to find libzip and avoids the broken targets) is used instead.
pre-commit-ci Bot and others added 21 commits July 9, 2026 13:56
…hout tests

- Add explicit patch status (target: 80%, threshold: 5%) to prevent
  default patch check from failing on new code
- Add src/nebula_ouster/.* to ignore list since ouster packages don't
  have CI test infrastructure yet
- Add test_ouster_decoder.cpp with tests for:
  - Empty packet error handling
  - Callback not set error handling
  - Invalid packet size error handling
  - Valid lidar packet decode
  - Set/replace pointcloud callback
  - Lidar packet size getter
  - DecodeError to_cstr conversion
  - Performance counters recording
  - Move construction

- Add test_ouster_calibration_data.cpp with tests for:
  - Load from string (success and empty)
  - Load from file (success, not found, empty)
  - Save to file (success and invalid path)

- Update CMakeLists.txt for both packages to register tests
- Add test dependencies to package.xml files
- Fix BUILD_TESTING save/restore around ouster-sdk subdirectory
- Revert nebula_ouster exclusion from .codecov.yml
@Samahu Samahu force-pushed the add-ouster-lidar-support branch from 1ab3019 to 0d9b29e Compare July 9, 2026 20:56
@Samahu

Samahu commented Jul 9, 2026

Copy link
Copy Markdown
Author

resolved codecov complaints and rebased again

@Samahu

Samahu commented Jul 13, 2026

Copy link
Copy Markdown
Author

Can we run the CI one more time to confirm the codecov has been fixed?

@mojomex mojomex left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for the long wait and thank you for your patience! We were quite swamped internally 🙇

Code is looking really good, no new feedback!
One small build change I'd like to request:

In CI, we're using colcon build --packages-up-to to build Nebula, which works for this PR. However, many projects using Nebula are just using colcon build, and that fails:

Starting >>> ouster-sdk
--- stderr: ouster-sdk
CMake Error at CMakeLists.txt:92 (add_subdirectory):
  add_subdirectory given source "ouster_pcap" which is not an existing
  directory.


CMake Error at CMakeLists.txt:96 (add_subdirectory):
  add_subdirectory given source "ouster_osf" which is not an existing
  directory.


CMake Error at CMakeLists.txt:97 (add_subdirectory):
  add_subdirectory given source "thirdparty/zpng" which is not an existing
  directory.


CMake Error at CMakeLists.txt:102 (add_subdirectory):
  add_subdirectory given source "ouster_viz" which is not an existing
  directory.


CMake Error at CMakeLists.txt:106 (add_subdirectory):
  add_subdirectory given source "ouster_mapping" which is not an existing
  directory.


---
Failed   <<< ouster-sdk [0.79s, exited with code 1]

Upon closer inspection, the src/nebula_ouster/vendor/ouster-sdk/CMakeLists.txt doesn't seem to be used at all. Instead, nebula_ouster_decoders etc. point to the SDK paths they need.

Possible fixes are:

  • remove the CMakeLists.txt so Colcon doesn't recognize it as a package
  • place a COLCON_IGNORE file in src/nebula_ouster/vendor/
  • make the package buildable and link nebula_ouster_... against the built SDK

Also, since there's no default calibration data, I was not able to test on the packets from #436 (comment) . I saw that the unit tests are using ouster::sdk::core::default_sensor_info(ouster::sdk::core::LidarMode::_512x10) to get some generic data. Is it possible to make this an official fallback when no calibration data exists?

max_hz: 12.0
num_frame_transition: 1
packet_liveness:
timeout_ms: 1000

@mojomex mojomex Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) I think this is fine not to expose to users. We usually know that the min. frequency of the sensor is e.g. 10Hz (100ms period), so any threshold at or below that is fine. Too low and we run into scheduling effects, so I'd set it to 100ms for now.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this same issue, building the package fails due to the subfolders missing.

Even if I change the lines in the CMakeLists.txt to disable those options I get a large list of additional errors regarding the ouster_json.hpp

...
--- stderr: ouster-sdk                                                                                                                                               
In file included from /workspaces/autoware_iv/src/sensor_component/external/nebula/src/nebula_ouster/vendor/ouster-sdk/ouster_client/src/sensor_info.cpp:14:
/workspaces/autoware_iv/src/sensor_component/external/nebula/src/nebula_ouster/vendor/ouster-sdk/thirdparty/ouster_json.hpp:102:25: error: ‘is_same_vz’ is not a member of ‘std’; did you mean ‘is_same’?
  102 |                   !std::is_same_vz<std::decay_t<T>, json> &&
      |                         ^~~~~~~~~~
      |                         is_same

....

@mojomex

mojomex commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

@marioney Hey, that's awesome to hear! It would mean a lot to us if you could test this PR with your Ouster sensor and comment if it was successful, or if there were any issues that need addressing.

@mojomex

mojomex commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

@Samahu Not for this PR, but has Ouster previously looked into packaging Ouster SDK for ROS buildfarm? There's quite a few _vendor packages for other libraries, and it would potentially be a nice solution to our submodule vs. FetchContent vs. copy discussion.

@Samahu

Samahu commented Jul 13, 2026

Copy link
Copy Markdown
Author

@Samahu Not for this PR, but has Ouster previously looked into packaging Ouster SDK for ROS buildfarm? There's quite a few _vendor packages for other libraries, and it would potentially be a nice solution to our submodule vs. FetchContent vs. copy discussion.

I don't see it happening in the near term. Unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do you have plans to support Ouster sensor

4 participants