Hi everyone.
I’m facing some problems with the ROS2 basic in 5 Days Rosject.
My question is. How can i know the right indexes for the /laser ranges field?
Hi everyone.
I’m facing some problems with the ROS2 basic in 5 Days Rosject.
My question is. How can i know the right indexes for the /laser ranges field?
Hi @LorenzoDagostino ,
I had the same doubt when I first worked on the robot. So I am going to tell you how I figured it out.
echo
from /laser
topic : ros2 topic echo /laser
and get one single message.angle_max
, angle_min
and angle_increment
. Use these 3 values to calculate the angular range of the scanner - it could be a 360 degree scanner or 180 degree scanner. [The rosject uses a 360 degree scanner, by the way!]angle_min
is your initial value in the ranges
and angle_max
is the final value in your ranges
. So for a 360 degree sensor with 720 values in ranges, 0 corresponds to angle_min
and 719 corresponds to angle_max
. angle_increment
is the least count for angle measurement - it could be 0.5 degrees or 1 degree step.Now, for the quick answer:
360 degree scanner with 720 ranges [0 degrees on the back]:
0 or 719 = back, 180 = right, 360 = front, 540 = left
360 degree laser with 360 ranges [0 degrees on the back]:
0 or 359 = back, 90 = right, 180 = front, 270 = left
I hope this helps.
Regards,
Girish
This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.