Add support for automatic scan ring selection [Humble] #323
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.
Related Issues & PRs
Summary of Changes
This PR proposes one small enhancement and fixes a missing key in parameters file:
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
.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, usingbeam_altitude_angles
metadata info.Validation
scan_ring
set toscan_ring:= -1
(or don't set any to use the driver default):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.
LaserScan
will match the middle (zero-altitude angle) ringscan_ring
set to a ring within the valid range (ex.scan_ring:=0
):LaserScan
will match the specified ringscan_ring
set to any other (invalid) value (ex.scan_ring:=-2
,scan_ring:=100000
):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.
LaserScan
will match the clamped ring value.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