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.
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
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:
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!