ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org

# Reading data from the shifted laser, as if it was in the middle

I have algorithms that use raw data from laser [-pi/2;pi/2]. Earlier, the laser was in the middle of the robot. Now it has been moved closer to the left front edge and rotated by pi/4.

What is the best way to transform data from a shifted laser so that it would be visible like the laser was in the middle? I suppose, I have to use tf, but I don't know how exactly.

I'm using ROS Kinetic.

EDIT.

One of the algorithm are used raw data from laser (LaserScan/ranges) for simple avoiding obstacles, that react different depending on the occupied area. I have one treshold that qualifies thing as an obstacle in area and return if its free or not. Very similar to this image:

And now the laser is shifted, and I want to use my old algorithm to work, as if it was in the middle. Know I'm using the law of cosines to change the tresholds, but maybe there is a way, to "just" tranform the data from laser.

edit retag close merge delete

You are correct that TF is the way to do this, however you will need to tell us more about your application before we can help you. What are you using to process the laser data and what is it being used for?

( 2019-02-04 10:47:43 -0600 )edit

( 2019-02-04 16:51:13 -0600 )edit

Sort by ยป oldest newest most voted

The laser scan message effectively stores a type of 2D point cloud in a compressed way. If your algorithm is working with this type of message directly then I don't think there is an easy way of adjusting it's position and not changing the algorithm.

You have two options that I can see:

1, Change the algorithm to use a point cloud message type and translate the points into the original frame the sensor was in.

2, Change the algorithm so that the segments it detects obstacles in can be shifted based upon a translation from the TF system.

I would think option 1 would be the easiest to implement, there are already nodes to convert laser scan messages into point clouds. So you would only have to modify the input stage of your algorithm.

Hope this makes sense.

more