Example Scene¶
This page contains a complete example scene in JSON format that can be used as a template or for testing.
Complete Scene JSON¶
The following JSON represents a simple scene with:
An ego vehicle with a 3-frame trajectory
One camera sensor
One LiDAR sensor
One radar sensor
One dynamic vehicle actor
example_scene.json¶
{
"ego_vehicle": {
"trajectory": {
"timestamps": [0.0, 1.0, 2.0],
"object2world": [
[
[1.0, 0.0, 0.0, 0.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 1.0]
],
[
[1.0, 0.0, 0.0, 10.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 1.0]
],
[
[1.0, 0.0, 0.0, 20.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 1.0]
]
],
"angular_velocity": null,
"linear_velocity": null
},
"sensors": {
"cameras": [
{
"id": 1,
"name": "Front Camera",
"camera_model": "pinhole",
"distortion_parameters": {
"p1": 0.0,
"p2": 0.0,
"k1": 0.0,
"k2": 0.0,
"k3": 0.0,
"k4": 0.0,
"k5": null,
"k6": null,
"k0": null,
"p0": null,
"s1": null,
"s2": null,
"s3": null,
"sx1": null,
"sy1": null
},
"extrinsics": [
[1.0, 0.0, 0.0, 0.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 1.0]
],
"trajectory": {
"timestamps": [0.0, 1.0, 2.0],
"object2world": [
[
[1.0, 0.0, 0.0, 0.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 1.0]
],
[
[1.0, 0.0, 0.0, 10.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 1.0]
],
[
[1.0, 0.0, 0.0, 20.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 1.0]
]
],
"angular_velocity": null,
"linear_velocity": null
},
"intrinsics": {
"fx": 1000.0,
"fy": 1000.0,
"cx": 640.0,
"cy": 360.0,
"skew": 0.0,
"height": 720.0,
"width": 1280.0
},
"images_data": [
{
"filepath": "camera/00000000.png",
"timestamp": 0.0,
"undistorded": true,
"rolling_shutter": {
"readout_time": 0.0,
"readout_direction": "global"
}
},
{
"filepath": "camera/00000001.png",
"timestamp": 1.0,
"undistorded": true,
"rolling_shutter": {
"readout_time": 0.0,
"readout_direction": "global"
}
},
{
"filepath": "camera/00000002.png",
"timestamp": 2.0,
"undistorded": true,
"rolling_shutter": {
"readout_time": 0.0,
"readout_direction": "global"
}
}
]
}
],
"lidars": [
{
"id": 1,
"name": "top_lidar",
"extrinsics": [
[1.0, 0.0, 0.0, 0.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 1.5],
[0.0, 0.0, 0.0, 1.0]
],
"intrinsics": {
"lidar_type": "rotating",
"rotation_type": "clockwise",
"vertical_fov": 0.785398,
"horizontal_fov": 6.283185,
"horizontal_resolution": 0.01,
"vertical_resolution": {
"vertical_resolution": 0.01,
"elevation_channel_mapping": null
},
"max_range": 100.0,
"min_range": 0.1,
"horizontal_beam_divergence": null,
"vertical_beam_divergence": null
},
"trajectory": {
"timestamps": [0.0, 1.0, 2.0],
"object2world": [
[
[1.0, 0.0, 0.0, 0.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 1.5],
[0.0, 0.0, 0.0, 1.0]
],
[
[1.0, 0.0, 0.0, 10.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 1.5],
[0.0, 0.0, 0.0, 1.0]
],
[
[1.0, 0.0, 0.0, 20.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 1.5],
[0.0, 0.0, 0.0, 1.0]
]
],
"angular_velocity": null,
"linear_velocity": null
},
"lidar_pcds_data": [
{
"filepath": "lidar/00000000.ply",
"timestamp": 0.0,
"egomotion_compensated": true,
"has_missing_points": false
},
{
"filepath": "lidar/00000001.ply",
"timestamp": 1.0,
"egomotion_compensated": true,
"has_missing_points": false
},
{
"filepath": "lidar/00000002.ply",
"timestamp": 2.0,
"egomotion_compensated": true,
"has_missing_points": false
}
],
"min_cut_off_range": 1.5
}
],
"radars": [
{
"id": 1,
"name": "front_radar",
"extrinsics": [
[1.0, 0.0, 0.0, 2.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.5],
[0.0, 0.0, 0.0, 1.0]
],
"intrinsics": {
"range": 200.0,
"azimuth_fov": 1.0472,
"elevation_fov": 0.5236,
"azimuth_resolution": [[0.0, 0.01], [0.5236, 0.02]],
"elevation_resolution": null,
"min_speed_resolution": -50.0,
"max_speed_resolution": 50.0
},
"trajectory": {
"timestamps": [0.0, 1.0, 2.0],
"object2world": [
[
[1.0, 0.0, 0.0, 2.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.5],
[0.0, 0.0, 0.0, 1.0]
],
[
[1.0, 0.0, 0.0, 12.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.5],
[0.0, 0.0, 0.0, 1.0]
],
[
[1.0, 0.0, 0.0, 22.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.5],
[0.0, 0.0, 0.0, 1.0]
]
],
"angular_velocity": null,
"linear_velocity": null
},
"radar_pcds_data": [
{
"filepath": "radar/00000000.ply",
"timestamp": 0.0
},
{
"filepath": "radar/00000001.ply",
"timestamp": 1.0
},
{
"filepath": "radar/00000002.ply",
"timestamp": 2.0
}
]
}
]
}
},
"actors": [
{
"id": 1,
"name": "Vehicle_001",
"dimensions": {
"length": 4.5,
"width": 2.0,
"height": 1.5
},
"boxtype": "vehicle",
"original_boxtype": "sedan",
"dynamic": true,
"trajectory": {
"timestamps": [0.0, 1.0, 2.0],
"object2world": [
[
[1.0, 0.0, 0.0, 30.0],
[0.0, 1.0, 0.0, 3.5],
[0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 1.0]
],
[
[1.0, 0.0, 0.0, 38.0],
[0.0, 1.0, 0.0, 3.5],
[0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 1.0]
],
[
[1.0, 0.0, 0.0, 46.0],
[0.0, 1.0, 0.0, 3.5],
[0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 1.0]
]
],
"angular_velocity": null,
"linear_velocity": null
},
"description": "A sedan traveling in the adjacent lane",
"original_id": null
}
]
}
Loading the Example¶
To load and work with this example:
from mimic_data_api import Scene
# Copy the JSON above to a file named "example_scene.json"
# Then load it:
with open("example_scene.json", "r") as f:
scene = Scene.model_validate_json(f.read())
# Inspect the loaded scene
print(f"Ego trajectory frames: {len(scene.ego_vehicle.trajectory.timestamps)}")
print(f"Cameras: {len(scene.ego_vehicle.sensors.cameras)}")
print(f"LiDARs: {len(scene.ego_vehicle.sensors.lidars or [])}")
print(f"Radars: {len(scene.ego_vehicle.sensors.radars or [])}")
print(f"Actors: {len(scene.actors)}")
Scene Visualization¶
The scene described above represents:
Time: t=0s Time: t=2s
y (left) y (left)
^ ^
| |
-----+------> x (forward) -----+------> x (forward)
| |
[Actor] [Actor]
x=30m, y=3.5m x=46m, y=3.5m
(adjacent lane) (adjacent lane)
[Ego] [Ego]
x=0m, y=0m x=20m, y=0m
(origin) (moved forward)
The ego vehicle travels forward at 10 m/s, while the actor vehicle (in the adjacent lane at y=3.5m) travels at 8 m/s.
Minimal Scene Example¶
A minimal valid scene with just a camera:
{
"ego_vehicle": {
"trajectory": {
"timestamps": [0.0],
"object2world": [
[[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]
],
"angular_velocity": null,
"linear_velocity": null
},
"sensors": {
"cameras": [
{
"id": 1,
"name": "camera",
"camera_model": "pinhole",
"distortion_parameters": {
"p1": 0, "p2": 0, "k1": 0, "k2": 0, "k3": 0, "k4": 0
},
"extrinsics": [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]],
"trajectory": {
"timestamps": [0.0],
"object2world": [
[[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]
],
"angular_velocity": null,
"linear_velocity": null
},
"intrinsics": {
"fx": 500, "fy": 500, "cx": 320, "cy": 240,
"skew": 0, "height": 480, "width": 640
},
"images_data": [
{
"filepath": "image.png",
"timestamp": 0.0,
"undistorded": true,
"rolling_shutter": {
"readout_time": 0.0,
"readout_direction": "global"
}
}
]
}
],
"lidars": null,
"radars": null
}
},
"actors": []
}
This minimal example contains the bare minimum required fields for a valid scene.