UT-Austin-RPL / Coopernaut

Coopernaut: End-to-End Driving with Cooperative Perception for Networked Vehicles
69 stars 15 forks source link

Lidar point cloud coordinate #12

Open ruiiu opened 2 months ago

ruiiu commented 2 months ago

Thanks for sharing the code. I have a question:

I am using open3d to visualize the lidar data. If doing the following transform of the lidar point cloud in point_transformer_loader.py, the point cloud data looks different from the generated video 0_0_hud_info.mp4 in the bird eye view that the car is driving,

lidar[:,2] = -lidar[:,2]
def pc_to_car_alignment(_pc):
        # Car alignment is a weird coordinate, upside down
        # Rest assured this is the right matrix, double checked
        alignment = np.array([[0, 1, 0],
                                [-1, 0, 0],
                                [0, 0, -1]])
        return np.matmul(_pc, alignment)
lidar = Utils.pc_to_car_alignment(lidar)

if i only do lidar[:,1] = -lidar[:,1], but not do pc_to_car_alignment, the view looks consistent as in the hud_info video.

cuijiaxun commented 2 months ago

It is because pygame coordinate is different from world coordinate (x,y are swapped), while the pc_to_car_alignment is doing 1. swap x, y 2. make the lidar upside down. Let me know if it causes any issues running the experiments - I know it is lame, so I am fixing it in the new version of the project.