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

Add support for automatic scan ring selection [Humble] #323

Open
wants to merge 2 commits into
base: ros2
Choose a base branch
from

Conversation

Imaniac230
Copy link

Related Issues & PRs

Summary of Changes

This PR proposes one small enhancement and fixes a missing key in parameters file:

  1. Extended the scan_ring parameter to support an option for automatic zero-altitude angle (middle) ring selection when the scan_ring parameter is set to a value of -1.
  2. Added missing ros__parameters key for image node in os_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

  1. Launch with scan_ring set to scan_ring:= -1 (or don't set any to use the driver default):
    1. 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.
    2. the output LaserScan will match the middle (zero-altitude angle) ring
  2. Launch with scan_ring set to a ring within the valid range (ex. scan_ring:=0):
    1. the output LaserScan will match the specified ring
  3. Launch with scan_ring set to any other (invalid) value (ex. scan_ring:=-2, scan_ring:=100000):
    1. 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.
    2. the output 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

…ing if set to a default value of -1.

* When specifying value -1 for the scan_ring parameter, the node will automatically choose the ring that is closest to a zero altitude angle.
* Updated launch options to use the automatic selection with value -1 as default.
* Fixed some typos in parameters descriptions.
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.

None yet

1 participant