nutonomy / nuscenes-devkit

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

weird lidar-sample correspondence #995

Closed poodarchu closed 9 months ago

poodarchu commented 9 months ago

I try to extract sweeps using the nuscenes api.

Screenshot 2023-10-06 at 7 20 41 PM

If I use lidar_data's "next" key to obtain the next lidar scan, and use the "sample_token" of the next lidar scane to get its sample, then I find that next_sample["data"]["LIDAR_TOP"] is different from next_lidar["token"].

Screenshot 2023-10-06 at 7 38 34 PM

whyekit-motional commented 9 months ago

@poodarchu when you use "sample_data" to retrieve the next lidar scan, it gets the next immediate lidar scan

In contrast, when you use "sample_token" to retrieve the next lidar scan, it gets the lidar scan of the next keyframe (which is approx. 0.05 secs away)

poodarchu commented 9 months ago

next_lidar is retrieved by nusc.get("sample_data"), and it contains a "sample_token" key. So why a non-key frame links to next key sample?

whyekit-motional commented 9 months ago

That refers to the "nearest" sample which the non-keyframe sweep is associate with

A better indicator of whether the sweep belongs to a keyframe is the is_key_frame key

poodarchu commented 9 months ago

in fact, for a key lidar frame K, its next lidar sample L is closer to K's corresponding sample, not its next sample.