Skip to content

Commit

Permalink
Merge pull request #274 from motional/nuplan-devkit-v1.2-release
Browse files Browse the repository at this point in the history
Nuplan devkit v1.2 release
  • Loading branch information
patk-motional authored Apr 27, 2023
2 parents 630f9d3 + 3966f55 commit ce3c323
Show file tree
Hide file tree
Showing 355 changed files with 15,012 additions and 2,742 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,20 @@ ENV NUPLAN_MAPS_ROOT=/data/sets/nuplan/maps \

RUN bash -c 'mkdir -p {$NUPLAN_MAPS_ROOT,$NUPLAN_DATA_ROOT,$NUPLAN_EXP_ROOT}'

ARG NUPLAN_DATA_ROOT_S3_URL
ARG NUPLAN_MAPS_ROOT_S3_URL
ARG NUPLAN_CHALLENGE_DATA_ROOT_S3_URL
ARG NUPLAN_CHALLENGE_MAPS_ROOT_S3_URL
ARG NUPLAN_SERVER_S3_ROOT_URL
ARG S3_TOKEN_DIR
ARG NUPLAN_DATA_STORE

ENV NUPLAN_DATA_ROOT $NUPLAN_DATA_ROOT
ENV NUPLAN_MAPS_ROOT $NUPLAN_MAPS_ROOT
ENV NUPLAN_DB_FILES /data/sets/nuplan/nuplan-v1.1/mini
ENV NUPLAN_DB_FILES /data/sets/nuplan/nuplan-v1.1/splits/mini
ENV NUPLAN_MAP_VERSION "nuplan-maps-v1.0"
ENV NUPLAN_DATA_STORE $NUPLAN_DATA_STORE
ENV NUPLAN_S3_PROFILE "default"
ENV NUPLAN_DATA_ROOT_S3_URL $NUPLAN_DATA_ROOT_S3_URL
ENV NUPLAN_MAPS_ROOT_S3_URL $NUPLAN_MAPS_ROOT_S3_URL
ENV NUPLAN_DATA_ROOT_S3_URL $NUPLAN_CHALLENGE_DATA_ROOT_S3_URL
ENV NUPLAN_MAPS_ROOT_S3_URL $NUPLAN_CHALLENGE_MAPS_ROOT_S3_URL
ENV NUPLAN_SERVER_S3_ROOT_URL $NUPLAN_SERVER_S3_ROOT_URL
ENV S3_TOKEN_DIR $S3_TOKEN_DIR

Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pipeline{
BAZEL_OPTS = "--local_cpu_resources=8 --jobs=8 --remote_cache=http://bazel-cache.ci.motional.com:80 --remote_upload_local_results=true"

NUPLAN_DATA_ROOT = "/data/sets/nuplan"
NUPLAN_DB_FILES = "/data/sets/nuplan/nuplan-v1.1/mini"
NUPLAN_DB_FILES = "/data/sets/nuplan/nuplan-v1.1/splits/mini"
NUPLAN_MAPS_ROOT = "/data/sets/nuplan/maps"
NUPLAN_MAP_VERSION = "nuplan-maps-v1.0"
NUPLAN_EXP_ROOT = "/tmp/exp/nuplan"
Expand Down
17 changes: 13 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,24 @@ ______________________________________________________________________

</div>

______________________________________________________________________
## Sensor Data Release
#### IMPORTANT: The file structure has changed! Please check [Dataset Setup](https://github.com/motional/nuplan-devkit/blob/master/docs/dataset_setup.md) page for the updated file structure.
- The nuPlan sensor data for the v1.1 dataset has been released. Please download the latest dataset from the nuPlan [page](https://www.nuscenes.org/nuplan#download).
- Due to the size of the sensor data, it will be released gradually. This first set of sensor data are the blobs corresponding to nuPlan mini.
- A short tutorial for the sensor data is provided `nuplan_sensor_data_tutorial.ipynb` to get you started.
______________________________________________________________________
## Planning challenges
#### The nuPlan Planning Competition is live!
#### The challenge will be presented as part of the [New Advances On Autonomous Driving](https://opendrivelab.com/event/cvpr23_ADworkshop) workshop at CVPR 2023
#### The nuPlan Dataset v1.1 has been released. Please download the latest dataset from the nuPlan [page](https://www.nuscenes.org/nuplan#download).
#### IMPORTANT: The Planning Challenge will be using devkit version 1.2 from now on. Submissions generated from version v1.1 should remain compatible. However, please double-check by submitting to the warm-up phase.
- The nuPlan Planning Competition is live!
- The challenge will be presented as part of the [New Advances On Autonomous Driving](https://opendrivelab.com/event/cvpr23_ADworkshop) workshop at CVPR 2023
- The nuPlan Dataset v1.1 has been released. Please download the latest dataset from the nuPlan [page](https://www.nuscenes.org/nuplan#download).
______________________________________________________________________

## Changelog
- February 15th 2023
- April 25th 2023
* v1.2 Devkit: The nuPlan sensor data have been released! Improved feature caching and nuBoard dashboard functionality. Changed dataset file structure, data interfaces now allow retrieval of sensor data. Pinned several packages including hydra, numpy and sqlalchemy.
- January 20th 2023
* v1.1 Devkit: The official nuPlan Challenge Release. Optimized training caching, simulation improvements, shapely 2.0 update.
- Oct 13th 2022
* v1.1 Dataset: Full nuPlan dataset - improved route plan, traffic light status, mission goal and more!
Expand Down
File renamed without changes.
16 changes: 15 additions & 1 deletion docs/baselines.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,18 @@ go based on the distance between itself and a given agent. Of course, it is wise

Hence, the IDMPlanner uses breadth-first search to find the path towards the mission goal, and the IDM policy describes how far along that path the planner should be.

Link to the [code](https://github.com/motional/nuplan-devkit/blob/master/nuplan/planning/simulation/planner/idm_planner.py)
Link to the [code](https://github.com/motional/nuplan-devkit/blob/master/nuplan/planning/simulation/planner/idm_planner.py)

## UrbanDriverOpenLoopModel (MLPlanner)
The UrbanDriverOpenLoopModel functions as an example trained machine learning planner using the `MLPlanner` interface.
The implementation is an open-loop version of L5Kit's [implementation](https://github.com/woven-planet/l5kit/blob/master/l5kit/l5kit/planning/vectorized/open_loop_model.py)
of ["Urban Driver: Learning to Drive from Real-world Demonstrations Using Policy Gradients"](https://woven-planet.github.io/l5kit/urban_driver.html)
adapted to the nuPlan framework.

The model processes vectorized agent and map inputs into local feature descriptors that
are passed to a global attention mechanism for yielding a predicted ego trajectory. The model is trained using imitation
learning to match expert trajectories available in the nuPlan dataset. Some amount of data augmentation is performed on
the agents and expert trajectory provided during training to mitigate data distribution drift encountered during
closed-loop simulation.

Link to the [code](https://github.com/motional/nuplan-devkit/blob/master/nuplan/planning/training/modeling/models/urban_driver_open_loop_model.py)
10 changes: 5 additions & 5 deletions docs/competition.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ The main focus of the nuPlan planning challenge is to evaluate a motion planning
### Competition Timeline

* January 30th, 2023 - Warm-up phase and Test phase opens for submission
* May 18th, 2023 - Competition closes
* May 19th, 2023 - Finalists are announced and invited to share their code with us for verification
* May 19th, 2023 - Competition closes
* May 26th, 2023 - Finalists are announced and invited to share their code with us for verification
* June 2th, 2023 - Winners are announced
* June 18th, 2023 - The competition results are presented at the [New Advances On Autonomous Driving](https://opendrivelab.com/event/cvpr23_ADworkshop) workshop at CVPR 2023
* June 18th, 2023 - The competition results are presented at the [End-to-End Autonomous Driving](https://opendrivelab.com/event/cvpr23_ADworkshop) workshop at CVPR 2023


### How to enter
Expand Down Expand Up @@ -76,7 +76,7 @@ and the data is not taken from the test split. The metrics and the overall score

Start: January 30th, 2023

End: May 18th, 2023
End: May 19th, 2023

#### Test Phase
The results from the test phase will be used to determine the winners of each challenge. All submissions will be evaluated on a
Expand All @@ -87,7 +87,7 @@ submit a maximum of three submissions.

Start: January 30th, 2023

End: May 18th, 2023
End: May 19th, 2023

### Challenges

Expand Down
44 changes: 34 additions & 10 deletions docs/dataset_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,40 @@ The final hierarchy should look as follows (depending on the splits downloaded a
│   └── 9.17.1937
│   └── map.gpkg
└── nuplan-v1.1
   ├── mini
   │ ├── 2021.05.12.22.00.38_veh-35_01008_01518.db
   │ ├── 2021.06.09.17.23.18_veh-38_00773_01140.db
   │ ├── ...
   │ └── 2021.10.11.08.31.07_veh-50_01750_01948.db
   └── trainval
   ├── 2021.05.12.22.00.38_veh-35_01008_01518.db
   ├── 2021.06.09.17.23.18_veh-38_00773_01140.db
   ├── ...
   └── 2021.10.11.08.31.07_veh-50_01750_01948.db
   ├── splits
   │ ├── mini
   │ │ ├── 2021.05.12.22.00.38_veh-35_01008_01518.db
   │ │ ├── 2021.06.09.17.23.18_veh-38_00773_01140.db
   │ │ ├── ...
   │ │ └── 2021.10.11.08.31.07_veh-50_01750_01948.db
   │ └── trainval
   │ ├── 2021.05.12.22.00.38_veh-35_01008_01518.db
   │ ├── 2021.06.09.17.23.18_veh-38_00773_01140.db
   │ ├── ...
   │ └── 2021.10.11.08.31.07_veh-50_01750_01948.db
   └── sensor_blobs
   ├── 2021.05.12.22.00.38_veh-35_01008_01518
   │ ├── CAM_F0
   │ │ ├── c082c104b7ac5a71.jpg
   │ │ ├── af380db4b4ca5d63.jpg
   │ │ ├── ...
   │ │ └── 2270fccfb44858b3.jpg
   │ ├── CAM_B0
   │ ├── CAM_L0
   │ ├── CAM_L1
   │ ├── CAM_L2
   │ ├── CAM_R0
   │ ├── CAM_R1
   │ ├── CAM_R2
   │ └──MergedPointCloud
   │ ├── 03fafcf2c0865668.pcd
   │ ├── 5aee37ce29665f1b.pcd
   │ ├── ...
   │ └── 5fe65ef6a97f5caf.pcd
   │
   ├── 2021.06.09.17.23.18_veh-38_00773_01140
   ├── ...
   └── 2021.10.11.08.31.07_veh-50_01750_01948
```

If you want to use another folder, you can set the corresponding [environment variable](https://github.com/motional/nuplan-devkit/blob/master/docs/installation.md).
2 changes: 1 addition & 1 deletion nuplan/cli/db_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
cli = typer.Typer()

NUPLAN_DATA_ROOT = os.getenv('NUPLAN_DATA_ROOT', "/data/sets/nuplan/")
NUPLAN_DB_VERSION = f'{NUPLAN_DATA_ROOT}/nuplan-v1.1/mini/2021.07.16.20.45.29_veh-35_01095_01486.db'
NUPLAN_DB_VERSION = f'{NUPLAN_DATA_ROOT}/nuplan-v1.1/splits/mini/2021.07.16.20.45.29_veh-35_01095_01486.db'


def _ensure_file_downloaded(data_root: str, potentially_remote_path: str) -> str:
Expand Down
Empty file added nuplan/cli/test/__init__.py
Empty file.
1 change: 1 addition & 0 deletions nuplan/common/actor_state/test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ py_library(
"//nuplan/common/actor_state:agent",
"//nuplan/common/actor_state:car_footprint",
"//nuplan/common/actor_state:ego_state",
"//nuplan/common/actor_state:ego_temporal_state",
"//nuplan/common/actor_state:oriented_box",
"//nuplan/common/actor_state:state_representation",
"//nuplan/common/actor_state:tracked_objects_types",
Expand Down
42 changes: 36 additions & 6 deletions nuplan/common/actor_state/test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,47 @@ def get_sample_ego_state(center: Optional[StateSE2] = None, time_us: Optional[in
)


def get_sample_agent(token: str = 'test', agent_type: TrackedObjectType = TrackedObjectType.VEHICLE) -> Agent:
def get_sample_agent(
token: str = 'test',
agent_type: TrackedObjectType = TrackedObjectType.VEHICLE,
num_past_states: Optional[int] = 1,
num_future_states: Optional[int] = 1,
) -> Agent:
"""
Creates a sample Agent, the token and agent type can be specified for various testing purposes.
:return: A sample Agent
:param token: The unique token to assign to the agent.
:param agent_type: Classification of the agent.
:param num_past_states: How many states to generate in the past trajectory. With None, that will be assigned to
the past_trajectory otherwise the current state + num_past_states will be added.
:param num_future_states: How many states to generate in the future trajectory. If `None` is passed, `None` will
be assigned to the predictions; otherwise the current state + num_future_states will be added.
:return: A sample Agent.
"""
initial_timestamp = 10
sample_oriented_box = get_sample_oriented_box()
return Agent(
agent_type,
get_sample_oriented_box(),
metadata=SceneObjectMetadata(timestamp_us=10, track_token=token, track_id=None, token=token),
sample_oriented_box,
metadata=SceneObjectMetadata(timestamp_us=initial_timestamp, track_token=token, track_id=None, token=token),
velocity=StateVector2D(0.0, 0.0),
predictions=[
PredictedTrajectory(1.0, [Waypoint(time_point=TimePoint(10), oriented_box=get_sample_oriented_box())])
],
PredictedTrajectory(
1.0,
[
Waypoint(time_point=TimePoint(initial_timestamp + i * 5), oriented_box=sample_oriented_box)
for i in range(num_future_states + 1)
],
)
]
if num_future_states is not None
else None,
past_trajectory=PredictedTrajectory(
1.0,
[
Waypoint(time_point=TimePoint(initial_timestamp - i * 5), oriented_box=sample_oriented_box)
for i in reversed(range(num_past_states + 1))
],
)
if num_past_states is not None
else None,
)
2 changes: 1 addition & 1 deletion nuplan/common/actor_state/vehicle_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def __str__(self) -> str:

def get_pacifica_parameters() -> VehicleParameters:
"""
:return VehicleParameters containing parameters of Pacifica Vehicle
:return VehicleParameters containing parameters of Pacifica Vehicle.
"""
return VehicleParameters(
vehicle_name="pacifica",
Expand Down
6 changes: 6 additions & 0 deletions nuplan/common/actor_state/waypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ def __eq__(self, other: Any) -> bool:
and other.velocity == self._velocity
)

def __repr__(self) -> str:
"""
:return: A string describing the object.
"""
return self.__class__.__qualname__ + "(" + ', '.join([f"{f}={v}" for f, v in self.__dict__.items()]) + ")"

@property
def center(self) -> StateSE2:
"""
Expand Down
2 changes: 2 additions & 0 deletions nuplan/common/geometry/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ py_library(
"//nuplan/common/actor_state:oriented_box",
"//nuplan/common/actor_state:state_representation",
"//nuplan/common/actor_state:vehicle_parameters",
requirement("numpy"),
requirement("scipy"),
requirement("shapely"),
],
)

Expand Down
2 changes: 1 addition & 1 deletion nuplan/common/geometry/interpolate_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def interpolate_past_waypoints(

# Extract desired time stamps
end_timestamp = waypoints[-1].time_us
start_timestamp = int(end_timestamp - horizon_len_s * 1e6)
start_timestamp = max(int(end_timestamp - horizon_len_s * 1e6), 0)
target_timestamps, num_future_boxes = _compute_desired_time_steps(
start_timestamp, end_timestamp, horizon_len_s=horizon_len_s, interval_s=interval_s
)
Expand Down
16 changes: 12 additions & 4 deletions nuplan/common/geometry/test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ py_library(
srcs = ["__init__.py"],
)

py_library(
py_test(
name = "test_compute",
size = "small",
srcs = ["test_compute.py"],
deps = [
"//nuplan/common/actor_state:oriented_box",
"//nuplan/common/actor_state:state_representation",
"//nuplan/common/geometry:compute",
requirement("numpy"),
requirement("shapely"),
],
)

Expand All @@ -28,21 +32,25 @@ py_test(
],
)

py_library(
py_test(
name = "test_convert",
size = "small",
srcs = ["test_convert.py"],
deps = [
"//nuplan/common/actor_state:state_representation",
"//nuplan/common/geometry:convert",
requirement("numpy"),
],
)

py_library(
py_test(
name = "test_transform",
size = "small",
srcs = ["test_transform.py"],
deps = [
"//nuplan/common/actor_state:state_representation",
"//nuplan/common/geometry:transform",
requirement("numpy"),
],
)

Expand All @@ -61,7 +69,7 @@ py_test(
],
deps = [
"//nuplan/common/geometry:interpolate_tracked_object",
"//nuplan/common/utils/testing:nuplan_test",
"//nuplan/common/utils/test_utils:nuplan_test",
"//nuplan/planning/utils/serialization:from_scene",
requirement("pytest"),
],
Expand Down
Loading

0 comments on commit ce3c323

Please sign in to comment.