X Y and Z coordinates in LaserScan
How can I get the three points from the LaserScan?
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
The points in the LaserScan message are stores in polar coordinates in a fairly compressed way to save space.
You'll need to loop through the ranges array calculating the angle for that specific point using the equation:
angle = angle_min + (i * angle_increment)
where i is the index within the ranges array.
This will give you the polar coordinate of the point which you can convert to a 2D Cartesian point using the usual method here. The Z coordinates of laser scan points are always zero because this message type stores 2D horizontal laser scan data.
Hope this helps.
Asked: 2018-10-01 03:49:16 -0600
Seen: 3,384 times
Last updated: Oct 01 '18
Do you mean the X Y Z coordinates of an obstacle detected by your laser ?
@S.Yildiz sorry if I sound rude but I saw you posting a lot of questions and it seems to me like you're not even trying to search for the answer first by yourself. There is a chance somebody else has already asked this question in the past. This applies for any other forum like stackoverflow etc.
No I'm searching for answers but can't find any. Then my last hope is the forum. And I'm also a newby, so please understand my position.
@S.Yildiz ok no problem, I get it. I was at the same place some time ago. I was just ensuring you're at least trying on your own. Wish you luck with your project.