RobustFieldAutonomyLab / LeGO-LOAM

LeGO-LOAM: Lightweight and Ground-Optimized Lidar Odometry and Mapping on Variable Terrain
BSD 3-Clause "New" or "Revised" License
2.4k stars 1.12k forks source link

Point cloud coordinate offset #122

Closed threeflowermeow closed 5 years ago

threeflowermeow commented 5 years ago

Hi, I used velodyne VLP16 Lidar to collect pcap data, converted it into a bagfile and entered the code. I found that the point cloud coordinate system displayed in rviz after calculation was deviated from the original coordinate system, which looked like the original Lidar coordinate system was rotated 90° counterclockwise. What causes it? I found that atan2(x, y) was used to calculate horizonAngle in projectPointCloud of imageProjection.cpp, why not atan2(y, x)? It is related to the above question? Thanks in advance.

manomitbal commented 5 years ago

Hi @threeflowermeow I am facing the same issue, were you able to find a solution to this? I transforming the final pointcloud the only step?

andre-nguyen commented 5 years ago

The coordinate system from the VLP16 is different from the coordinate system used by the ROS driver velodyne_driver. The ROS driver has x pointing "forwards" i.e. away from the cable. Whereas the original Velodyne VLP16 coordinate frame has x pointing "right", 90 degrees from the cable. This was done to respect the ROS standards.

See here https://github.com/ros-drivers/velodyne/blob/720829573076bf7d7edd4b1de344924fad909049/velodyne_pointcloud/src/lib/rawdata.cc#L288-L291