Converting /scan data for Lidar that is not centered on Robot
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?
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.
Yeah that sounds like the way to go. Thanks. If you make this into an answer I will mark it good!!
@pitosalas Done