Skip to content

Commit 035b54b

Browse files
Merge pull request #6 from Formula-Electric-Belgium/ouster-lidar-ros2
Ouster lidar ros2
2 parents 1e246e7 + 6cc8306 commit 035b54b

34 files changed

+739
-250
lines changed

.github/workflows/docker-image.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,18 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17+
exclude:
18+
- ros_distro: iron
1719
ros_distro:
1820
- rolling
1921
- humble
2022
- iron
2123
- jazzy
24+
- kilted
2225
rmw_imp:
2326
- rmw_fastrtps_cpp
2427
- rmw_cyclonedds_cpp
28+
- rmw_zenoh_cpp
2529
steps:
2630
- uses: actions/checkout@v4
2731
with:

CHANGELOG.rst

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,25 @@ Changelog
55
[unreleased]
66
============
77
* [BUGFIX]: correctly align timestamps to the generated point cloud.
8-
* Added support to enable **loop** for pcap replay + other replay config.
9-
* Added a new launch file parameter ``pub_static_tf`` that allows users to turn off the braodcast
8+
* [BUGFIX]: NEAR_IR data is not populated with data for organized point clouds that have no range.
9+
* Add support to enable **loop** for pcap replay + other replay config.
10+
* Add a new launch file parameter ``pub_static_tf`` that allows users to turn off the braodcast
1011
of sensor TF transforms.
12+
* Introduce a new topic ``/ouster/telemetry`` that publishes ``ouster_ros::Telemetry`` messages,
13+
the topic can be turned on/off by including the token ``TLM`` in the flag ``proc_mask`` launch arg.
14+
* Add a new launch file parameter ``min_scan_valid_columns_ratio`` to allow users to set the minimum
15+
ratio of valid columns in a scan for it to be processed. Default value is ``0.0``.
16+
* Update where ouster-ros and ouster_client include directories get installed so that those headers
17+
can be included externally.
18+
* Add ``storage`` launch parameter to ``record.launch.xml``
19+
* Add a padding-free point type of ``PointXYZI`` under ``ouster_ros`` namespace contrary to the pcl
20+
version ``pcl::PointXYZI`` for bandwith sensitive applications.
21+
* [BUGFIX]: Use the node clock to ensure messages report sim time in replay mode.
22+
* Introduce a new param ``v_reduction`` that allows reducing the number of beams count of the published
23+
point cloud
24+
* Allow users to use ``Zenoh`` with the supplied Dockerfile and add it to the CI pipeline.
25+
* Introduce a new capability to suppress certain range measurements of the point cloud by providing
26+
a mask image to the driver through the ``mask_path`` launch file argument.
1127

1228

1329
ouster_ros v0.13.2

Dockerfile

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,29 @@ ARG ROS_DISTRO=rolling
22
ARG RMW_IMPLEMENTATION=rmw_fastrtps_cpp
33

44
FROM ros:${ROS_DISTRO}-ros-core AS build-env
5+
ARG RMW_IMPLEMENTATION
6+
ARG ROS_DISTRO
57
ENV DEBIAN_FRONTEND=noninteractive \
68
RMW_IMPLEMENTATION=${RMW_IMPLEMENTATION} \
79
BUILD_HOME=/var/lib/build \
810
OUSTER_ROS_PATH=/opt/ros2_ws/src/ouster-ros
911

10-
RUN set -xue \
11-
# Turn off installing extra packages globally to slim down rosdep install
12-
&& echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/01norecommend \
13-
&& apt-get update \
14-
&& apt-get install -y \
15-
build-essential \
16-
cmake \
17-
fakeroot \
18-
dpkg-dev \
19-
debhelper \
20-
python3-rosdep \
21-
python3-rospkg \
22-
python3-bloom \
23-
python3-colcon-common-extensions
12+
RUN set -xue && \
13+
apt-get update && \
14+
apt-get install -y \
15+
build-essential \
16+
cmake \
17+
fakeroot \
18+
dpkg-dev \
19+
python3-rosdep \
20+
python3-rospkg \
21+
python3-bloom \
22+
python3-colcon-common-extensions
2423

2524
RUN if [ "$RMW_IMPLEMENTATION" = "rmw_cyclonedds_cpp" ]; then \
2625
apt-get install -y ros-${ROS_DISTRO}-rmw-cyclonedds-cpp; \
26+
elif [ "$RMW_IMPLEMENTATION" = "rmw_zenoh_cpp" ]; then \
27+
apt-get install -y ros-${ROS_DISTRO}-rmw-zenoh-cpp; \
2728
fi
2829

2930
# Set up non-root build user
@@ -50,9 +51,8 @@ WORKDIR ${BUILD_HOME}
5051
RUN set -xe \
5152
&& mkdir src \
5253
&& cp -R $OUSTER_ROS_PATH ./src
53-
54-
5554
FROM build-env
55+
ARG ROS_DISTRO
5656

5757
SHELL ["/bin/bash", "-c"]
5858

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Official ROS driver for Ouster sensors
22

33
[ROS1 (melodic/noetic)](https://github.com/ouster-lidar/ouster-ros/tree/master) |
4-
[ROS2 (rolling/humble/iron/jazzy)](https://github.com/ouster-lidar/ouster-ros/tree/ros2) |
4+
[ROS2 (rolling/humble/iron/jazzy/kilted)](https://github.com/ouster-lidar/ouster-ros/tree/ros2) |
55
[ROS2 (galactic/foxy)](https://github.com/ouster-lidar/ouster-ros/tree/ros2-foxy)
66

77
<p style="float: right;"><img width="20%" src="docs/images/logo.png" /></p>
88

99
| ROS Version | Build Status (Linux) |
1010
|:-----------:|:------:|
1111
| ROS1 (melodic/noetic) | [![melodic/noetic](https://github.com/ouster-lidar/ouster-ros/actions/workflows/docker-image.yml/badge.svg?branch=master)](https://github.com/ouster-lidar/ouster-ros/actions/workflows/docker-image.yml)
12-
| ROS2 (rolling/humble/iron/jazzy) | [![rolling/humble/iron/jazzy](https://github.com/ouster-lidar/ouster-ros/actions/workflows/docker-image.yml/badge.svg?branch=ros2)](https://github.com/ouster-lidar/ouster-ros/actions/workflows/docker-image.yml)
12+
| ROS2 (rolling/humble/iron/jazzy/kilted) | [![rolling/humble/iron/jazzy/kilted](https://github.com/ouster-lidar/ouster-ros/actions/workflows/docker-image.yml/badge.svg?branch=ros2)](https://github.com/ouster-lidar/ouster-ros/actions/workflows/docker-image.yml)
1313
| ROS2 (galactic/foxy) | [![galactic/foxy](https://github.com/ouster-lidar/ouster-ros/actions/workflows/docker-image.yml/badge.svg?branch=ros2-foxy)](https://github.com/ouster-lidar/ouster-ros/actions/workflows/docker-image.yml)
1414

1515
- [Official ROS driver for Ouster sensors](#official-ros-driver-for-ouster-sensors)
@@ -57,9 +57,9 @@ You can obtain detailed specs sheet about the sensors and obtain updated FW thro
5757
[downloads](https://ouster.com/downloads) section.
5858

5959
## Requirements
60-
This branch is only intended for use with **Rolling**, **Humble**, **Iron** and **Jazzy** ROS 2 distros.
61-
Please refer to ROS 2 online documentation on how to setup ROS on your machine before proceeding with
62-
the remainder of this guide.
60+
This branch is only intended for use with **Rolling**, **Humble**, **Iron**, **Jazzy** and **Kilted**
61+
ROS 2 distros. Please refer to ROS 2 online documentation on how to setup ROS on your machine before
62+
proceeding with the remainder of this guide.
6363

6464
> **Note**
6565
> If you have _rosdep_ tool installed on your system you can then use the following command to get all
@@ -77,7 +77,7 @@ sudo apt install -y \
7777
ros-$ROS_DISTRO-tf2-eigen \
7878
ros-$ROS_DISTRO-rviz2
7979
```
80-
where `$ROS_DISTRO` can be either ``rolling``, ``humble``, ``iron`` or ``jazzy``.
80+
where `$ROS_DISTRO` can be either ``rolling``, ``humble``, ``iron``, ``jazzy`` or ``kilted``.
8181

8282
> **Note**
8383
> Installing `ros-$ROS_DISTRO-rviz` package is optional in case you didn't need to visualize the
@@ -120,7 +120,7 @@ git clone -b ros2 --recurse-submodules https://github.com/ouster-lidar/ouster-ro
120120

121121
Next to compile the driver you need to source the ROS environemt into the active termainl:
122122
```bash
123-
source /opt/ros/<ros-distro>/setup.bash # replace ros-distro with 'rolling', 'humble', 'iron' or 'jazzy'
123+
source /opt/ros/<ros-distro>/setup.bash # replace ros-distro with 'rolling', 'humble', 'iron', 'jazzy' or `kilted`
124124
```
125125

126126
Finally, invoke `colcon build` command from within the catkin workspace as shown below:
@@ -136,7 +136,15 @@ colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
136136
> **FastDDS** is usually the default ros middleware on most platforms, please follow the
137137
[Guide](https://docs.ros.org/en/humble/Installation/DDS-Implementations/Working-with-Eclipse-CycloneDDS.html)
138138
to learn how to enable **CycloneDDS** on your platform.
139-
> We are yet to evaluate Zeonh performance against the ouster-ros driver for later distros.
139+
> The **Zeonh** ROS middleware is now available for use with ouster-ros driver from Humble and afterwards
140+
> (exlcuding Iron). Zenoh have received great feedback from the ROS community but that's in general, we don't
141+
> have a comparative analysis against the other middlewares, to enable Zenoh:
142+
> ```bash
143+
> sudo apt install ros-${ROS_DISTRO}-rmw-zenoh-cpp
144+
> export RMW_IMPLEMENTATION=rmw_zenoh_cpp
145+
> ```
146+
> then follow the instructions here and rebuild the ouster-ros driver (clean build).
147+
140148
141149
Once the build succeeds, you must source the _install_ folder of your ros2 workspace to add launch
142150
commands to your environment:

ouster-ros/CMakeLists.txt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ find_package(Eigen3 REQUIRED)
2121
find_package(PCL REQUIRED COMPONENTS common)
2222
find_package(pcl_conversions REQUIRED)
2323
find_package(tf2_eigen REQUIRED)
24+
find_package(OpenCV REQUIRED)
2425

2526
# ==== Options ====
2627
add_compile_options(-Wall -Wextra)
@@ -52,7 +53,9 @@ find_package(OusterSDK REQUIRED)
5253
set(BUILD_SHARED_LIBS ${_SAVE_BUILD_SHARED_LIBS})
5354

5455
# catkin adds all include dirs to a single variable, don't try to use targets
55-
include_directories(${_ouster_ros_INCLUDE_DIRS})
56+
include_directories(
57+
${_ouster_ros_INCLUDE_DIRS}
58+
${OpenCV_INCLUDE_DIRS})
5659

5760
# use only MPL-licensed parts of eigen
5861
add_definitions(-DEIGEN_MPL2_ONLY)
@@ -86,6 +89,7 @@ target_link_libraries(ouster_ros_library
8689
pcl_common
8790
# PRIVATE (unsupported)
8891
-Wl,--whole-archive ${OUSTER_TARGET_LINKS} -Wl,--no-whole-archive
92+
${OpenCV_LIBRARIES}
8993
)
9094

9195
# helper method to construct ouster-ros components
@@ -231,9 +235,16 @@ install(
231235

232236
install(
233237
DIRECTORY
234-
${_ouster_ros_INCLUDE_DIRS}
238+
include/${PROJECT_NAME}/
235239
DESTINATION
236-
.
240+
include/${PROJECT_NAME}/
241+
)
242+
243+
install(
244+
DIRECTORY
245+
ouster-sdk/ouster_client/include/ouster
246+
ouster-sdk/ouster_client/include/optional-lite/nonstd
247+
DESTINATION include
237248
)
238249

239250
install(

ouster-ros/config/community_driver_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ ouster_driver:
5151
# IMG|PCL|IMU|SCAN
5252
# PCL
5353
#
54-
proc_mask: IMG|PCL|IMU|SCAN
54+
proc_mask: IMG|PCL|IMU|SCAN|TLM

ouster-ros/config/driver_params.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ ouster/os_driver:
6161
# broadcast the TF transforms for the imu/sensor/lidar frames. Prevent the
6262
# driver from broadcasting TF transforms by setting this parameter to False.
6363
pub_static_tf: true
64-
# proc_mask[optional]: use any combination of the 4 flags IMG, PCL, IMU and
65-
# SCAN to enable or disable their respective messages.
66-
proc_mask: IMU|PCL|SCAN|IMG|RAW
64+
# proc_mask[optional]: use any combination of the 6 flags IMG, PCL, IMU, SCAN
65+
# RAW and TLM to enable or disable their respective messages.
66+
proc_mask: IMU|PCL|SCAN|IMG|RAW|TLM
6767
# scan_ring[optional]: use this parameter in conjunction with the SCAN flag
6868
# to select which beam of the LidarScan to use when producing the LaserScan
6969
# message. Choose a value the range [0, sensor_beams_count).
@@ -72,7 +72,8 @@ ouster/os_driver:
7272
# data QoS. This is preferrable for production but default QoS is needed for
7373
# rosbag. See: https://github.com/ros2/rosbag2/issues/125
7474
use_system_default_qos: false
75-
# point_type[optional]: choose from: {original, native, xyz, xyzi, xyzir}
75+
# point_type[optional]: choose from: {original, native, xyz, xyzi, o_xyzi,
76+
# yzir}
7677
# Here is a breif description of each option:
7778
# - original: This uses the original point representation ouster_ros::Point
7879
# of the ouster-ros driver.
@@ -82,6 +83,7 @@ ouster/os_driver:
8283
# - xyz: the simplest point type, only has {x, y, z}
8384
# - xyzi: same as xyz point type but adds intensity (signal) field. this
8485
# type is not compatible with the low data profile.
86+
# - o_xyzi: same as xyzi point type but doesn't add the extra 4 padding bytes.
8587
# - xyzir: same as xyzi type but adds ring (channel) field.
8688
# this type is same as Velodyne point cloud type
8789
# this type is not compatible with the low data profile.
@@ -115,3 +117,11 @@ ouster/os_driver:
115117
min_range: 0.0
116118
# max_range[optional]: maximum lidar range to consider (meters).
117119
max_range: 1000.0
120+
# v_reduction[optional]: vertical beam reduction; available options: {1, 2, 4, 8, 16}.
121+
v_reduction: 1
122+
# min_scan_valid_columns_ratio[optional]: The minimum ratio of valid columns for
123+
# processing the LidarScan [0, 1]. default is 0%
124+
min_scan_valid_columns_ratio: 0.0
125+
# mask_path[optional]: path to an image file that will be used to mask parts of the
126+
# pointcloud.
127+
mask_path: ''

ouster-ros/config/metadata-qos-override.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
depth: 1
44
reliability: reliable
55
durability: transient_local
6+
7+
/os_node/metadata:
8+
history: keep_last
9+
depth: 1
10+
reliability: reliable
11+
durability: transient_local

ouster-ros/config/os_sensor_cloud_image_params.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ ouster/os_cloud:
3030
pub_static_tf: true
3131
timestamp_mode: '' # this value needs to match os_sensor/timestamp_mode
3232
ptp_utc_tai_offset: -37.0 # UTC/TAI offset in seconds to apply when using TIME_FROM_PTP_1588
33-
proc_mask: IMU|PCL|SCAN # pick IMU, PCL, SCAN or any combination of the three options
33+
proc_mask: IMU|PCL|SCAN|TLM # pick IMU, PCL, SCAN, TLM or any combination of the 4 options
3434
use_system_default_qos: false # needs to match the value defined for os_sensor node
3535
scan_ring: 0 # Use this parameter in conjunction with the SCAN flag and choose a
3636
# value the range [0, sensor_beams_count)
37-
point_type: original # choose from: {original, native, xyz, xyzi, xyzir}
37+
point_type: original # choose from: {original, native, xyz, xyzi, o_xyzi, xyzir}
3838
ouster/os_image:
3939
use_system_default_qos: false # needs to match the value defined for os_sensor node

ouster-ros/include/ouster_ros/common_point_types.h

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,52 @@ namespace ouster_ros {
1616
representation that we readily support.
1717
*/
1818

19+
/*
20+
* Same as Apollo point cloud type
21+
* @remark XYZIT point type is not compatible with RNG15_RFL8_NIR8/LOW_DATA
22+
* udp lidar profile.
23+
*/
24+
struct EIGEN_ALIGN16 _Ouster_PointXYZI {
25+
union EIGEN_ALIGN16 {
26+
float data[4];
27+
struct {
28+
float x;
29+
float y;
30+
float z;
31+
float intensity;
32+
};
33+
};
34+
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
35+
};
36+
37+
struct PointXYZI : public _Ouster_PointXYZI {
38+
39+
inline PointXYZI(const _Ouster_PointXYZI& pt)
40+
{
41+
x = pt.x; y = pt.y; z = pt.z;
42+
intensity = pt.intensity;
43+
}
44+
45+
inline PointXYZI()
46+
{
47+
x = y = z = 0.0f; data[3] = 1.0f;
48+
intensity = 0.0f;
49+
}
50+
51+
inline const auto as_tuple() const {
52+
return std::tie(x, y, z, intensity);
53+
}
54+
55+
inline auto as_tuple() {
56+
return std::tie(x, y, z, intensity);
57+
}
58+
59+
template<size_t I>
60+
inline auto& get() {
61+
return std::get<I>(as_tuple());
62+
}
63+
};
64+
1965
/*
2066
* Same as Velodyne point cloud type
2167
* @remark XYZIR point type is not compatible with RNG15_RFL8_NIR8/LOW_DATA
@@ -60,6 +106,13 @@ struct PointXYZIR : public _PointXYZIR {
60106

61107
// clang-format off
62108

109+
POINT_CLOUD_REGISTER_POINT_STRUCT(ouster_ros::PointXYZI,
110+
(float, x, x)
111+
(float, y, y)
112+
(float, z, z)
113+
(float, intensity, intensity)
114+
)
115+
63116
/* common point types */
64117
POINT_CLOUD_REGISTER_POINT_STRUCT(ouster_ros::PointXYZIR,
65118
(float, x, x)

0 commit comments

Comments
 (0)