How to find the front position of a LaserScan

Hi there, I am facing an issue with basic rosject, everything is running fine but is there a way to find laserscan values, I mean how can I find whether the front is 0 or 90 and right? Thanks

First you need to check the axis of the laser. For that use rviz to see if the “x” axis of the laser frame is going in the same direction as the “x” axis of the robot base.
If it is, that means that the center of measurement of the laser goes into the front direction of the robot.

Now you need to know which laser measurement number is the one on that direction.
In order to find that info, you need to listen to one message of laser, that is, listen to a LaserScan by doing:
rostopic echo -n1 /laser_Scan_topic

You will see the content of a single laser measurement. Also, the message contains the information that you are requesting. For that you need to check the min_angle and the max_angle. Also, you need to get the number of laser points the laser is delivering (you can compute that from the angle_step and the other two values).

With all that info, you can find if the front is ray number 0 or ray number 90 or else


This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.