ros / geometry2

A set of ROS packages for keeping track of coordinate transforms.
190 stars 275 forks source link

Data loss during transformation of pointcloud #508

Closed s-niket closed 3 years ago

s-niket commented 3 years ago

Hi,

I have setup my robot with a 2D LiDAR sensor with the move_base and I am having difficulties in generating the local_costmap.

I published the pointcloud that is generated upon conversion from the LaserScan message and I have posted images of them below.

I visualized the pointclouds before and after the transformation and observed data loss. The transformation between the two frames is:

$ rosrun tf tf_echo odom base_link
At time 1619556273.000
- Translation: [-0.822, 0.263, 0.000]
- Rotation: in Quaternion [-0.003, 0.002, -0.054, 0.999]
            in RPY (radian) [-0.007, 0.004, -0.109]
            in RPY (degree) [-0.415, 0.252, -6.237]

The link below shows the section of the costmap_2d node that utilizes transformation of pointclouds using tf2. https://github.com/ros-planning/navigation/blob/noetic-devel/costmap_2d/src/observation_buffer.cpp#L108-L139

The image below shows the two sets of messages. The smaller points are the raw data from the laser scanner and the larger points are after the conversion from LaserScan to PointCloud2 message and a transformation of pointcloud.

https://drive.google.com/file/d/1IweSaX5EKuy9a0xKIBfyEvJ9W8j6SZ5v/view

Any help is appreciated, thank you!

s-niket commented 3 years ago

The issue wasn't related to the transformation, it was the thresholding done in Z axis after the transformation that caused the loss of half the points