Ask Your Question
0

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 2021-04-22 08:33:29 -0500

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

try:
            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
0

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 51 times

Last updated: Jun 05