nutonomy / nuscenes-devkit

The devkit of the nuScenes dataset.
https://www.nuScenes.org
Other
2.25k stars 620 forks source link

How to transform one point cloud on the time of t-1 to the point cloud coordinate on the time of t? #873

Closed emilyemliyM closed 1 year ago

emilyemliyM commented 1 year ago

HI, how to transform one point cloud on the time of t-1 to the point cloud coordinate on the time of t?

whyekit-motional commented 1 year ago

@emilyemliyM an example of how to transform a point cloud from some time tn to t0 can be found here: https://github.com/nutonomy/nuscenes-devkit/blob/9cba5925dc51b5c855252ee031eee5d6422f556b/python-sdk/nuscenes/utils/data_classes.py#L115

Modifying it to work for transforming a point cloud from from tn to some other time tm should be relatively trivial - in particular, you would need to get ref_from_car and car_from_global from tm (rather than t0)

emilyemliyM commented 1 year ago

@emilyemliyM an example of how to transform a point cloud from some time tn to t0 can be found here:

https://github.com/nutonomy/nuscenes-devkit/blob/9cba5925dc51b5c855252ee031eee5d6422f556b/python-sdk/nuscenes/utils/data_classes.py#L115

Modifying it to work for transforming a point cloud from from tn to some other time tm should be relatively trivial - in particular, you would need to get ref_from_car and car_from_global from tm (rather than t0)

Hi, really thanks to the reply.

I have another question about the param in the setting: what's the meaning of the "ref_chan"? Does it mean "Lidar" string or a token , or anything else? How to use it? Could I have an example of the use of the function?

image

whyekit-motional commented 1 year ago

@emilyemliyM the input for ref_chan would be the sensor name (as a str) you want to map the point clouds to (e.g. LIDAR_TOP, RADAR_FRONT)

You can see an example usage here: https://github.com/nutonomy/nuscenes-devkit/blob/9bc2f9e74d8a3dd27ef6ce83336508dd8926f867/python-sdk/nuscenes/nuscenes.py#L1293

emilyemliyM commented 1 year ago

@emilyemliyM an example of how to transform a point cloud from some time tn to t0 can be found here:

https://github.com/nutonomy/nuscenes-devkit/blob/9cba5925dc51b5c855252ee031eee5d6422f556b/python-sdk/nuscenes/utils/data_classes.py#L115

Modifying it to work for transforming a point cloud from from tn to some other time tm should be relatively trivial - in particular, you would need to get ref_from_car and car_from_global from tm (rather than t0)

Thanks for the reply! I want to know that does this method work for two keyframes of point cloud data as well? I want to conduct the coordinate transform between two key frames.

Thanks !

whyekit-motional commented 1 year ago

Yes, it should work for two keyframes, as long as your provide the appropriate transformation matrices