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

Converting /scan data for Lidar that is not centered on Robot

asked 2022-08-22 06:05:28 -0600

pitosalas gravatar image

My Lidar is not centered over the Robot/ Generally for SLAM and AMCL I think that's ok because if you have the tfs set up correctly then Slam and AMCL will take it into account.

However, I am using /scan messages which give me, let’s say, 360 numbers, corresponding to the distance of an obstacle from the lidar. To know the distance from the robot, I need to do a little converting, involving some trigonometry, using information that I get from tf.

This must be a solved problem. Can someone give me a pointer perhaps?

edit retag flag offensive close merge delete

Comments

I suggest subscribing to the /scan topic and then converting those polar coordinates to Cartesian coordinates. Once you have Cartesian coordinates as XYZ values, you can transform those points simply by one matrix multiplication.

ravijoshi gravatar image ravijoshi  ( 2022-08-23 02:44:27 -0600 )edit

Yeah that sounds like the way to go. Thanks. If you make this into an answer I will mark it good!!

pitosalas gravatar image pitosalas  ( 2022-08-23 14:07:04 -0600 )edit
ravijoshi gravatar image ravijoshi  ( 2022-08-23 23:08:44 -0600 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2022-08-23 23:08:16 -0600

ravijoshi gravatar image

I suggest subscribing to the /scan topic and then converting those polar coordinates to Cartesian coordinates.

Once you have Cartesian coordinates as XYZ values, you can transform these points simply by one matrix multiplication.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-08-22 06:05:28 -0600

Seen: 96 times

Last updated: Aug 23 '22