1.nuScenes数据集标注格式的说明:
https://www.freesion.com/article/5775777514/
2.根据json文件进行读取数据路径
https://blog.youkuaiyun.com/weixin_38362784/article/details/105841035
3.根据数据路径读取点云数据
https://blog.youkuaiyun.com/qq_37983000/article/details/109341670
4.官方api说明
https://scale.com/open-datasets/nuscenes/tutorial
坐标系说明:世界坐标系的轴的方向与IMU坐标系的轴的方向相同,所以如果需要将点云数据转换到世界坐标系,首先需要将点云数据转到IMU,然后再从IMU转到世界坐标系.
在 nusc.get('sample_data', sample_json['data'][ sensor]时,会返回对应的sensor_sample_data_json数据
结果如:
sample_data {
"token": <str> -- Unique record identifier.
"sample_token": <str> -- Foreign key. Sample to which this sample_data is associated.
"ego_pose_token": <str> -- Foreign key.
"calibrated_sensor_token": <str> -- Foreign key.
"filename": <str> -- Relative path to data-blob on disk.
"fileformat": <str> -- Data file format.
"width": <int> -- If the sample data is an image, this is the image width in pixels.
"height": <int> -- If the sample data is an image, this is the image height in pixels.
"timestamp": <int> -- Unix time stamp.
"is_key_frame": <bool> -- True if sample_data is part of key_frame, else False.
"next": <str> -- Foreign key. Sample data from the same sensor that follows this in time. Empty if end of scene.
"prev": <str> -- Foreign key. Sample data from the same sensor that precedes this in time. Empty if start of scene.
}
然后根据nusc.get('calibrated_sensor', sensor_sample_data_json['calibrated_sensor_token'])获取对应的calibrated_sensor_json文件,结果如
calibrated_sensor {
"token": <str> -- Unique record identifier.
"sensor_token": <str> -- Foreign key pointing to the sensor type.
"translation": <float> [3] -- Coordinate system origin in meters: x, y, z.
"rotation": <float> [4] -- Coordinate system orientation as quaternion: w, x, y, z.
"camera_intrinsic": <float> [3, 3] -- Intrinsic camera calibration. Empty for sensors that are not cameras.
}
则此时的translation和rotation就是对应的平移,旋转关系,利用自带的源码geometry_utils中的transform_matrix,可以得到旋转平移矩阵,采用类里面的transform()方法实现对点云从雷达坐标系到IMU坐标系的转换,然后再利用ego_pose实现从IMU坐标系到世界坐标系的转换.