Getting LiDAR data and saving to .csv

Typically: "How do I... ", "How can I... " questions
Post Reply
yeesh
Posts: 2
Joined: 07 Aug 2024, 21:20

Getting LiDAR data and saving to .csv

Post by yeesh »

Hi,

I have currently mounted a Hokuyo URG 04LX UG01 proximity sensor on my robot and I am trying to collect data in Polar Coordinates from it for 2D LiDAR to map an environment. I have already made said environment and established connection, but when I tried to save it doesn't look like it's getting data correctly or it may be that I set it up wrong.

It would be great if anyone could share how to collect and save 2D LiDAR data in Polar (theta, r, as I would like to use it to make a grid map with this script below: https://github.com/AtsushiSakai/PythonR ... rid_map.py

Thank you!

fferri
Posts: 1297
Joined: 09 Sep 2013, 19:28

Re: Getting LiDAR data and saving to .csv

Post by fferri »

In the sensor script you already have the angle variable, and p[1],p[2],p[3] which are the coordinates of the point (you can compute vector length to figure out the distance, so you have polar coordinates.

Thos coordinates are correct, as confirmed by the lines that you can see by setting showLines=true in the sensor's script.

yeesh
Posts: 2
Joined: 07 Aug 2024, 21:20

Re: Getting LiDAR data and saving to .csv

Post by yeesh »

I see what you're saying. Thank you for your guidance!

Post Reply