# why the hokuyo lidar show the walls curve and not straight

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))

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 close merge delete

Sort by ยป oldest newest most voted

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.

more

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

( 2018-11-08 11:36:07 -0500 )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

( 2018-11-10 11:08:24 -0500 )edit