-
Notifications
You must be signed in to change notification settings - Fork 165
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
Publishing pointclouds in os_sensor frame is misleading #33
Comments
Yep, agreed. Iirc the code predates the frames defined in the manual. Gonna leave this open for the next major version |
Is there a reason why the frame on the messages can't be changed to the |
Unfortunately, I don't have enough background on why this was the choice but I'll check on the subject. Especially for the ROS2 driver since it is still in the stage of BETA and we need to get this right. |
Based on this documentation, the raw UDP data comes not as XYZ at all, but then can be transformed to the lidar frame, and then transformed to the sensor frame. It will take me some digging in the Ouster SDK to confirm whether it just converts to the lidar frame or also includes the sensor frame. The pointclouds are stamped with the laser data frame in the unofficial driver: https://github.com/ros-drivers/ros2_ouster_drivers/blob/5425ed023d3c1c5293a9af90d2ae81c5df889334/ros2_ouster/src/ouster_driver.cpp#L127, and by making the clouds be stamped in the lidar frame in my fork of this version, I was able to reproduce results I get with the unofficial driver. |
Ok it looks like the ouster sdk (as used by the driver) converts points into the sensor frame, not the data/lidar frame, since it calls |
Ok, I'm pretty sure I got to the bottom of this. The reason for the inconsistency between So based on this, I think this ticket can be closed: I believe this drivers' current behavior is correct. However, it does bring up the following points:
|
Thanks for the digging.
I don't think so. Please, read again my point in the first comment. It is still valid.
In no way. This frame at least allows people to transform the cloud to the frame in which it was actually captured.
That would currently be the only option for ROS 1. Too much code would get broken if the change was done silently. @Samahu please, at least get this right for ROS 2 if it's sill in beta. |
@Aposhian I did briefly look into the ros2_ouster_drivers and they are using the
@peci1 We are considering to introduce an option for users to select the frame of reference as both of you suggested, the default for ROS1 is to maitain the same behavior, for ROS2 we probably want to set the lidar_frame to be the default since this would make it easier for people who are switching from the community driver to the official ros2 driver. |
Sounds good! |
I think the problem is that the community driver stamps the pointclouds with the lidar frame, but it actually transforms them to the sensor frame, so it is lying. You can't make the official driver backward compatible (work with the same TFs) without doing it incorrectly. It seems that there is demand to get pointclouds in the lidar frame, rather than the sensor frame, so I think it does make sense to make this a configuration option. |
Ok I made a draft PR with this configuration option that I will get around to testing sometime. |
@peci1 I am reviewing #127 PR that @Aposhian submitted 3 weeks ago, I agree with the conclusions that @Aposhian made. The driver's current xyz_lut object does transform the points into the sensor frame rather than the lidar frame. I think that just simply changing the Users who need to have the transform into the lidar frame should rather transform the published point cloud from the sensor frame to the lidar frame using Alternatively, we pretty much need to take the same route that @Aposhian made in the linked PR. |
I vote for backporting #127 to ROS 1. That would be the cleanest solution. If you still can make breaking changes to ROS 2 branch, I suggest publishing in Maybe in ROS 1, a warning could be issued if the driver publishes in |
Yeah definitely I have an upcoming upgrade to the ROS2 branch(s) that addresses several issues, one of which is the Back porting some these improvements to ROS1 will follow after I am done with #146. It makes sense to warn the users for the ROS1 since I want to keep the |
I was under the impression that the pointcloud is published already transformed into the sensor frame. Yet, following this discussion, do I understand correctly that the data is published in the sensor frame (while actually being recorded in the lidar frame) here and the transform is published separately? |
No, in ROS1 the data is published in the sensor frame and the |
Because the data was already transformed into |
The object returned by the non-parameterized |
But the lidar points will be continued to be published in the sensor frame? While the users will receive a warning, as indicated in some other comment? To my understanding, the IMU data is also published in the sensor frame, but looking at the imu handler, this doesn't seem to be the case. here? Thanks for your patience, I really appreciate it. |
Yes
The IMU data gets published in the IMU frame, which comes directly from the sensor, no additional transformation is applied to it in the ROS driver. |
I know the documentation describes the situation with frames quite extensively, but generally people expect that raw data from a sensor are published in the acquisition frame. That would be
os_lidar
. But the example ROS node transforms and publishes the data inos_sensor
, which is rotated and shifted in Z.One possible consequence of misinterpreting the frames is usage of the scans in a raytracing pipeline. These pipelines usually take the frame_id of the incoming scan and cast rays from the origin of the given frame. But if the frame is
os_sensor
, the cast rays are invalid because the origin is shifted lower than the real optical origin of the rays.I thus suggest changing the data frame to
os_lidar
. Users who do not care about the origin of observation should not be affected (except receiving the data in a different frame), and users interested in the observation point would get the expected data by default.The text was updated successfully, but these errors were encountered: