-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
172 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# MIT License | ||
# | ||
# Copyright (C) 2023. Huawei Technologies Co., Ltd. All rights reserved. | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in | ||
# all copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
# THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# MIT License | ||
# | ||
# Copyright (C) 2023. Huawei Technologies Co., Ltd. All rights reserved. | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in | ||
# all copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
# THE SOFTWARE. | ||
from pathlib import Path | ||
|
||
DEFAULT_CONFIG = str((Path(__file__).parent / "config.yaml").absolute()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# smarts/benchmark/driving_smarts_v0/config.yaml | ||
--- | ||
benchmark: | ||
name: "Driving SMARTS V0" | ||
message: | # A useful message given at the start of the benchmark. | ||
This is a cleaned up version of the Driving SMARTS benchmark. | ||
Using `TargetPose` agent action has an applied 28m/s cap for agent motion. | ||
Using `RelativeTargetPose` agent action, the constraint is inbuilt into the action space. | ||
If bubble_env is not installed, please install the bubble_env repository: | ||
```bash | ||
# set $REPOS to wherever you wish to store the repository. | ||
git lfs clone https://bitbucket.org/malban/bubble_env.git $REPOS/bubble_env | ||
# read $REPOS/README.md and follow those instructions | ||
pip install $REPOS/bubble_env | ||
``` | ||
For history see: | ||
- https://codalab.lisn.upsaclay.fr/competitions/6618 | ||
- https://smarts-project.github.io/archive/2022_nips_driving_smarts/ | ||
eval_episodes: 50 | ||
shared_env_kwargs: | ||
seed: 42 | ||
headless: true | ||
envs: | ||
bubble: # reserved for bubble env | ||
loc: "smarts.env:driving-smarts-competition-bubble-env-v0" | ||
scenarios: | ||
- 6 | ||
- 4 | ||
- 42 | ||
standard: | ||
loc: "smarts.env:driving-smarts-competition-v0" | ||
scenarios: | ||
- 1_to_2lane_left_turn_c | ||
- 1_to_2lane_left_turn_t | ||
- 3lane_merge_multi_agent | ||
- 3lane_merge_single_agent | ||
- 3lane_cruise_multi_agent | ||
- 3lane_cruise_single_agent | ||
- 3lane_cut_in | ||
- 3lane_overtake | ||
kwargs: | ||
seed: 42 | ||
# kwargs: | ||
# naturalistic: # reserved for driving_smarts_competition_naturalistic-v0 | ||
# loc: "smarts.env:driving_smarts_competition_naturalistic-v0" | ||
# kwargs: | ||
# scenario_dirs: | ||
# - "./scenarios/naturalistic/waymo" | ||
# - "./scenarios/naturalistic/ngsim" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
from textwrap import dedent | ||
from typing import Optional | ||
|
||
import gymnasium as gym | ||
|
||
|
||
def checked_bubble_env_v0( | ||
traffic_mode="traffic_A", | ||
action_space="Direct", | ||
img_meters: int = 64, | ||
img_pixels: int = 256, | ||
headless: bool = True, | ||
seed: int = 42, | ||
**kwargs, | ||
): | ||
|
||
try: | ||
import bubble_env_contrib | ||
except ImportError as err: | ||
raise ImportError( | ||
""" | ||
Bubble env is not installed. | ||
If bubble_env is not installed, please install the bubble_env repository: | ||
```bash | ||
# set $REPOS to wherever you wish to store the repository. | ||
git lfs clone https://bitbucket.org/malban/bubble_env.git $REPOS/bubble_env | ||
# read $REPOS/README.md and follow those instructions | ||
cd - | ||
pip install $REPOS/bubble_env | ||
``` | ||
""", | ||
"Install bubble_env", | ||
) from err | ||
|
||
env = gym.make( | ||
"bubble_env_contrib:bubble_env-v1", | ||
action_space=action_space, | ||
img_meters=img_meters, | ||
img_pixels=img_pixels, | ||
headless=headless, | ||
seed=seed, | ||
traffic_mode=traffic_mode, | ||
) | ||
return env |