ouster-ros
ouster-ros copied to clipboard
Add support for automatic scan ring selection [Humble]
Related Issues & PRs
- https://github.com/ouster-lidar/ouster-ros/issues/237
- https://github.com/ouster-lidar/ouster-ros/issues/239
- https://github.com/ouster-lidar/ouster-ros/pull/236
Summary of Changes
This PR proposes one small enhancement and fixes a missing key in parameters file:
- Extended the
scan_ring
parameter to support an option for automatic zero-altitude angle (middle) ring selection when thescan_ring
parameter is set to a value of-1
. - Added missing
ros__parameters
key for image node inos_sensor_cloud_image_params.yaml
, which prevented launching.
Reasoning
This doesn't solve any currently open issue directly, but proposes an enhancement that could make usage easier for the user. In most cases the most optimal ring to set will be the "middle" one, which could be done automatically on launch. This was already the default behavior for the community ouster driver as well as the velodyne laserscan node. This behavior and parameter usage with value -1
is, therefore, mirroring default behavior from the velodyne laserscan node. The logic for ring estimation was adapted directly from the community ouster driver, using beam_altitude_angles
metadata info.
Validation
- Launch with
scan_ring
set toscan_ring:= -1
(or don't set any to use the driver default):- driver will display an info log message:
from driver node ->
[os_driver-1] [INFO] [1715252789.059746932] [ouster.os_driver]: Scan ring was not specified. Automatically selected the ring that is closest to a zero altitude angle: 63.
from cloud node ->[os_cloud-2] [INFO] [1715252426.238503812] [ouster.os_cloud]: Scan ring was not specified. Automatically selected the ring that is closest to a zero altitude angle: 63.
- the output
LaserScan
will match the middle (zero-altitude angle) ring
- driver will display an info log message:
from driver node ->
- Launch with
scan_ring
set to a ring within the valid range (ex.scan_ring:=0
):- the output
LaserScan
will match the specified ring
- the output
- Launch with
scan_ring
set to any other (invalid) value (ex.scan_ring:=-2
,scan_ring:=100000
):- warning log message with the clamped value will still be shown as before:
value below valid range ->
[os_driver-1] [WARN] [1715254042.767133835] [ouster.os_driver]: Scan ring is set to a value that exceeds available range, please choose a value between 0 and 127. Ring value clamped to: 0.
value above valid range ->[os_driver-1] [WARN] [1715254425.300105852] [ouster.os_driver]: Scan ring is set to a value that exceeds available range, please choose a value between 0 and 127. Ring value clamped to: 127.
- the output
LaserScan
will match the clamped ring value.
- warning log message with the clamped value will still be shown as before:
value below valid range ->
Tested with all provided default launch files:
-
driver.launch.py
-
sensor.composite.launch.py
-
sensor.independent.launch.py
-
sensor.composite.launch.xml
-
sensor.independent.launch.xml
-
sensor_mtp.launch.xml
-
record.composite.launch.xml
-
replay.composite.launch.xml