is this the write script, I am use scene to extract the data and I believe i am talking all the possible sample I can take. However, scene 0 has 404 samples, I am extracting data for 5 radars with same script but why then the number of pointclouds is different ?
indent preformatted text by 4 spacesfrom
nuscenes import NuScenes
import os.path as osp
import numpy as np
from tqdm import tqdm
from pyquaternion import Quaternion
from PIL import Image
import csv
from nuscenes.utils.data_classes import RadarPointCloud
import matplotlib.pyplot as plt
from nuscenes.utils.geometry_utils import view_points
import the data
nusc = NuScenes(version=‘v1.0-mini’, dataroot=‘D:/Download/Pro2/NUSCENE’, verbose=True)
nusc.list_scenes()
my_scene = nusc.scene[0]
#print(my_scene)
scene_token = my_scene[‘token’]
plt.show()
#print(scene_token)
channel1 = ‘RADAR_FRONT’
channel2 = ‘RADAR_FRONT_LEFT’
channel3 = ‘RADAR_FRONT_RIGHT’
channel4 = ‘RADAR_BACK_LEFT’
channel5 = ‘RADAR_BACK_RIGHT’
channel6 = ‘CAM_FRONT’
scene_rec = nusc.get(‘scene’, scene_token)
start_sample_rec = nusc.get(‘sample’, scene_rec[‘first_sample_token’])
sd_rec1 = nusc.get(‘sample_data’, start_sample_rec[‘data’][channel1])
sd_rec2 = nusc.get(‘sample_data’, start_sample_rec[‘data’][channel2])
sd_rec3 = nusc.get(‘sample_data’, start_sample_rec[‘data’][channel3])
sd_rec4 = nusc.get(‘sample_data’, start_sample_rec[‘data’][channel4])
sd_rec5 = nusc.get(‘sample_data’, start_sample_rec[‘data’][channel5])
sd_rec6 = nusc.get(‘sample_data’, start_sample_rec[‘data’][channel6])
Make list of frames
cur_sd_rec1 = sd_rec1
sd_tokens1 = []
while cur_sd_rec1[‘next’] != ‘’:
cur_sd_rec1 = nusc.get(‘sample_data’, cur_sd_rec1[‘next’])
sd_tokens1.append(cur_sd_rec1[‘token’])
for sd_token1 in tqdm(sd_tokens1):
sc_rec1 = nusc.get(‘sample_data’, sd_token1)
sample_rec1 = nusc.get(‘sample’, sc_rec1[‘sample_token’])
radar_token1 = sd_rec1[‘token’]
radar_rec1 = nusc.get(‘sample_data’, radar_token1)
pc1 = RadarPointCloud.from_file(osp.join(nusc.dataroot, radar_rec1[‘filename’]))