ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Issue with converting laser scan readings from base_scan frame to odom frame

asked 2021-04-22 08:32:37 -0500

Vignesh_93 gravatar image

updated 2022-05-28 17:06:40 -0500

lucasw gravatar image

ROS developers and robotic enthusiasts

Recently I was involved in some assignments of tracking robots as a part of cooperative robots project. The major task was to cluster the readings of a master robot to identify a slave robot and track its position. In order to do so one would have a base idea to convert the reading from base_Scan frame of the master robot to the odom frame of the master and then track the centre of the slave robot. The following library has been used

            transform = self.tf_buffer.lookup_transform(self.odom_frame, self.laser_frame, rospy.Time(0), rospy.Duration(0.5))
        except(tf2_ros.LookupException, tf2_ros.ExtrapolationException):
            rospy.loginfo('Cannot transform')
        transformed = do_transform_cloud(cloud_out, transform)
        xyz_array = ros_numpy.point_cloud2.pointcloud2_to_xyz_array(transformed)

So basically what it does is, listening to the transform between laser frame to the odom frame and converts the point cloud data (cloud_out) from laser frame to odom frame. where cloud_out is the projected point cloud data from the laser scan data.

Now the issue I observe is that the transformed point cloud readings are not coinciding with the laser scan data when I plot it in rviz. As and when the master robot moves there is an offset created with respect to the laser scan data.

Looking forward to get some this msytery solved...

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-06-05 08:58:02 -0500

Vignesh_93 gravatar image

Closing this as the issue was with the frame id. When publishing the point cloud, it is always advised to publish the point clouds with respect to a fixed frame. In my case it was the odom frame..

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2021-04-22 08:32:37 -0500

Seen: 510 times

Last updated: Jun 05 '21