ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

why the hokuyo lidar show the walls curve and not straight

asked 2018-11-08 10:46:52 -0600

asmigox gravatar image

updated 2018-11-08 10:50:03 -0600

gvdhoorn gravatar image

i have a hokuyo lidar ubg-04lx-f01 and i generate a pointcloud with laserscan. I move the LIDAR up and down i get register. the problem is when i put the PCL into a 3D point cloud processing software (cloud compare), the points that represent walls looks like a curve and not straight like is it. Anybody can help with this one pls. the problem could be in the code ? i have a part of the code

self.tabla_datos = PointCloud()
angles_azimuth = np.linspace(msg.angle_min, msg.angle_max, len(msg.ranges))
self.coord_x = msg.ranges * np.cos(angles_azimuth) * np.sin(np.deg2rad(self.angles_elevation))
self.coord_y = msg.ranges * np.sin(angles_azimuth) * np.sin(np.deg2rad(self.angles_elevation))
self.coord_z = msg.ranges * np.cos(np.deg2rad(self.angles_elevation))

for i in range(0, len(self.coord_z)):
    point = Point32()
    point.x = self.coord_x[i]
    point.y = self.coord_y[i]
    point.z = self.coord_z[i]
    self.tabla_datos.points.append(point)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-11-08 11:15:56 -0600

The reason you're getting a curved wall is that you're trig is a bit off.

You want to multiply your X and Y values by the cosine of the elevation not the sine. And the Z value wants to by the range multiplied by the sine of your elevation.

Having said that you can achieve this using the laser assembler package and all the hard work is done for you.

Hope this helps.

edit flag offensive delete link more

Comments

i just changed it and looks worse... still with the curve. once you mentioned me use laser assembler, but the idea its publishing position while the laser scan. This is why i dont use laser assembler

asmigox gravatar image asmigox  ( 2018-11-08 11:36:07 -0600 )edit

i cant resolve it yet. If i'll send you the full code. would you take a look it? sorry if i sound rude. give me and e-mail pls. regards

asmigox gravatar image asmigox  ( 2018-11-10 11:08:24 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-11-08 10:46:52 -0600

Seen: 308 times

Last updated: Nov 08 '18