0
$\begingroup$

Rosanswers logo

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:

image description http://www.theconstructsim.com/wp-content/uploads/2018/01/53.png

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.


Originally posted by grzegorz.f-16 on ROS Answers with karma: 18 on 2019-02-04

Post score: 0


Original comments

Comment by PeteBlackerThe3rd on 2019-02-04:
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?

Comment by grzegorz.f-16 on 2019-02-04:
I've added some description.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by PeteBlackerThe3rd with karma: 9529 on 2019-02-04

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.