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

Possible mismatch in angle_min, angle_max, angle_increment and number of data points in LaserScan message #138

Open
nielsvd opened this issue Jun 7, 2023 · 0 comments

Comments

@nielsvd
Copy link

nielsvd commented Jun 7, 2023

In attempting to combine the ouster_driver with a SLAM algorithm, it came to my attention that, in the /scan topic, there may be a mismatch between:

  • msg.angle_min
  • msg.angle_max
  • msg.angle_increment
  • msg.ranges.size() or equivalently, msg.intensities.size()

The SLAM algorithm in question asserts the following condition (up to floating-point precision):
msg.angle_max == msg.angle_min + msg.angle_increment * (msg.ranges.size() - 1)
I.e., by (msg.ranges.size() - 1) the number of "gaps" between data points determines the angle increment, and not the number of data points itself. I suppose that makes sense, in particular if you would generalize to non-360 degree scans. As can be seen in

msg.angle_increment = 2 * M_PI / ouster::sensor::n_cols_of_lidar_mode(mdata.mode);
... in the driver the "number of data points" is used to compute the angle increment, and the lines above are equivalent to msg.angle_increment = (msg.angle_max - msg.angle_min) / msg.ranges.size().

Say there is indeed a mismatch, there could be an error in at least three of the data fields mentioned above. Currently, I'm not familiar enough with the device and the driver to determine which one should be fixed:

  • msg.angle_min = -M_PI + msg.angle_increment,
  • msg.angle_max = M_PI - msg.angle_increment,
  • msg.angle_increment = 2 * M_PI / (ouster::sensor::n_cols_of_lidar_mode(mdata.mode) - 1),
  • technically, msg.ranges could be extended with an additional data point (repeating the first one).
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

No branches or pull requests

1 participant