Skip to content
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

ROS2 foxy compatibility mode #149

Merged
merged 9 commits into from
Jun 28, 2023
Merged

Conversation

Samahu
Copy link
Contributor

@Samahu Samahu commented Jun 15, 2023

Related Issues & PRs

Summary of Changes

  • Build compatibility mode with Steve Macenski's implementation of Ouster driver for ROS2
  • Combine the functionality of os_sensor and os_cloud into a single node/component named os_driver
  • Retain the os_sensor and os_cloud for backward compatibility and also still be able to record the raw packets
  • Add unit tests around the ThreadSafeRingBuffer
  • Add an option to select the frame of reference when publishing point cloud and use lidar_frame by default
  • Provide topic mapping that is compatible with Steve Macenski's Ouster ROS2 driver
    • Provide support for parsing Steve's Ouster ROS2 yaml format
      • Partially support proc_mask handling (all flags supported excluding the IMG)
    • Create and utilize an RVIZ config file that immediately maps to the topics of the community driver
  • Add the ability to publish sensor_msgs::msg::LaserScan
    • Added a scan_ring parameter to enable picking a specific ring.
  • Add ability to override QoS settings
  • Factored out the functionality of OusterImage and integrate into OusterDriver same as os_cloud

Performance

Still in the process of running a full benchmark but in general the current data shows the following:

  • Improved overall performance over the current mainline driver when using the new os_driver node (a reduction in CPU utilization by 30%)
  • Improved overall performance and stability over the community driver when using os_driver node (a reduction in CPU utilization by 15-20%)

Validation

Old Interface Maintained

The three launch commands should be fully preserved under the new changes

# regular launch
ros2 launch ouster_ros sensor.launch.xml    \
    sensor_hostname:=<sensor host name>
# record
ros2 launch ouster_ros record.launch.xml    \
    sensor_hostname:=<sensor host name>     \
    bag_file:=<optional bag file name>      \
    metadata:=<json file name>              # optional
# replay
ros2 launch ouster_ros replay.launch.xml    \
    bag_file:=<path to rosbag file>         \
    metadata:=<json file name>              # optional if bag file has /metadata topic

Single Node (os_sensor+os_cloud+os_image)

To use the new combined node os_driver run the launch file driver.launch.py as shown below but please find the driver_config.yaml and adjust to match your sensor settings:

ros2 launch ouster_ros driver.launch.py

Single Node (Compatibility Mode)

To have the same topic names as the community driver use driver_launch.py launch file instead, this launch file points to the community_driver_config.yaml and it should work seamlessly except for the IMG option of proc_mask parameter (all flags should work as expected)

ros2 launch ouster_ros driver_launch.py

proc_mask flags

  • When running in a single node test enabling \ disabling individual flags for the proc_mask.
    • For example enable only the IMU, SCAN, IMG and PCL.
    • Watch that only the specific message of the enabled message type actually gets published

Alternate QoS settings

  • Test enabling \ disabling the use_system_default_qos
    Note that when setting use_system_default_qos to true RViz won't be able to display the point cloud by default.
    You would need to select /ouster/points topic and adjust the policy to be reliable.

Alternate PointCloud frame

  • Test altering point_cloud_frame between os_lidar and os_sensor
    Altering between the two should be clearly reflected in the the rendered point cloud in RVIZ

Sensor Lifecycle Management

  • Connect the sensor, then invoke the /ouster/reset service
    ros2 service call /ouster/reset std_srvs/srv/Empty
    • Watch point cloud update pauses for couple of second while the sensor restarts then the node resumes normally.
  • Connect to the sensor, open the sensor configuration change and apply any change except the udp_lidar_profile.
    • Watch the os_driver node detects the change and re-adapts accordingly.
  • Connect to the sensor, open the sensor configuration change and change the udp_lidar_profile.
    • Watch the sensor, generates few errors and then performs successfully re-activates itself.

- remove deprecated methods + naming nits
-  Added notes to size(), empty(), full()
-  Expose scan_ring param and update relevant params description
- Added ImageProcessor to support IMG flag
- Define new argument scan_ring
- Re-formatting CHANGELOG a bit
- Add missing parameter declaration
- Apply && to accepted method of ThreadSafeRingBuffer +  nits and code formatting
- Update CHANGELOG.rst and package version
- Update minimal readme file and utilize os_driver by default
- Add proc_mask to xml file
- Remove experminal marker from set_config and reset ros services
- Expose use_system_default_qos parameter to xml launch file and use proper defaults
- Rename the file os_sensor_cloud_image_params to os_sensor_cloud_image_params.yaml and update corresponding launch files
- More detailed explanation about the IMG node
- Add minor note
- Add the ability to override current qos settings
- Reduce sync operations + restore sensor reset/reactivation
- Add support for the selecting IMU
- Create topics/subs when their respective flags enabled
- Parse proc_mask and hook to launch files and config
- Restor os_cloud_node ability to process point clouds
- Refactor a bit and add the ability to process and publish point clouds and laser scans
- Incorporate LaserScan message composition
- Fix build issue
- Formatting imu and lidar packet handlers
- Factor out tf transforms broadcast
- Provide support for parsing the community driver params file with approprite launch file
- Formatting os_sensor and os_driver
- Keep transforms in Lidar Frame by default with option to switch
- Add an option to select the point_cloud frame
- Quick hook up of the ThreadSafeRingBuffer for os_sensor and os_driver
- Add one more case to the unit test of ThreadSafeRingBuffer
- Adding unit tests for the ThreadSafeRingBuffer
- Move down pragma once in the handlers
- Added os_driver which combines os_sensor and os_cloud
- Added required launch files
- Better abstraction of classes
- Simplified threading logic
- Added thread safe implemention of ring buffer (not hooked yet)
- Factoring out Imu and Lidar packets handling
@Samahu Samahu marked this pull request as ready for review June 23, 2023 00:05
@Samahu Samahu merged commit 09409f0 into ros2-foxy Jun 28, 2023
2 checks passed
@Samahu Samahu deleted the ros2-foxy-compatibility-mode branch June 28, 2023 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants