Continuous map for a scene?


Is it possible to get a continuous static map for an entire scene (in the form of an image ). I can take the map of each sample in a scene and join them with the difference in distance moved by the ego vehicle between frames, but i wanted to know if there was an easier way to do this

@Naveed I’m not quite sure what you mean, but you could get all the ego poses on the map by doing something like:


Alternatively, you could see if the map expansion has a function that does what you want:

Instead of having 3 different images of static maps like this from a sample


Would something like this be possible?

You could try this (note that you would need the map expansion):

from nuscenes.nuscenes import NuScenes
nusc = NuScenes(version='v1.0-mini', verbose=False)

# Render ego poses.
nusc_map_bos = NuScenesMap(dataroot='/data/sets/nuscenes', map_name='boston-seaport')
ego_poses = nusc_map_bos.render_egoposes_on_fancy_map(nusc, scene_tokens=[nusc.scene[1]['token']], verbose=False)

The above should give you:

This is awesome. Thank you so much for this. Would it be possible to also render the location of the vehicles surrounding the ego vehicle in the same map?

There’s no such functionality within the devkit at the moment, but you could possibly add some code to retrieve all the agents for each sample (and store them somewhere for rendering later) within this for loop within render_egoposes_on_fancy_map:

One way to get the boxes for each sample is:

# Get boxes in lidar frame.
_, boxes, _ = nusc.get_sample_data(sample_data_token, use_flat_vehicle_coordinates=True)

This is great. However for my case I have vehicles on an occupancy grid map, and wanted to visualize them on the global map. Is there any specific function that transforms the vehicle from a sensor coordinate system to the global coordinate system?

@Naveed do check out the description for sample_annotation here:

All location data is given with respect to the global coordinate system.

The boxes are already stored in the global coordinate system

1 Like