Skip to content

Commit acf6f27

Browse files
committed
Update docs for new task and sight_fov
1 parent 2ae59a6 commit acf6f27

6 files changed

Lines changed: 22 additions & 7 deletions

File tree

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ __pycache__/
66
MUJOCO_LOG.TXT
77
;
88
wandb/
9-
logdir/
109
*.ipynb
1110
*h5
1211
traffic_scenarios/
1312
*.log
1413
.nfs*
15-
logdir/
14+
*logdir/
1615
.vscode/
1716
.idea/
1817

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,19 @@ The model backbones are decoupled from CarDreamer tasks or the development sutie
157157
Find `README.md` in the corresponding directory of the algorithm you want to use and follow the instructions to install dependencies for that model and start training. We suggest starting with DreamerV3 as it is showing better performance across our experiments. To train DreamerV3 agents, use
158158

159159
```bash
160+
# Example 1: Use default settings to train an agent
160161
bash train_dm3.sh 2000 0 --task carla_four_lane --dreamerv3.logdir ./logdir/carla_four_lane
162+
# Example 2: Override task and model parameters
163+
bash train_dm3.sh 2000 0 --task carla_right_turn_simple \
164+
--dreamerv3.logdir ./logdir/carla_right_turn_simple \
165+
--dreamerv3.run.steps=5e6
161166
```
162167

163168
The command will launch CARLA at 2000 port, load task a built-in task named `carla_four_lane`, and start the visualization tool at port 9000 (2000+7000) which can be accessed through `http://localhost:9000/`. You can append flags to the command to overwrite yaml configurations.
164169

165170
### Creating Tasks
166171

167-
The section explains how to create CarDreamer tasks in a standalone mode without loading our integrated models. This can be helpful if you want to train and evaluate your own models other than our integrated DreamerV2 and DreamerV3 on CarDreamer tasks.
172+
The section explains how to create CarDreamer tasks in a standalone mode without loading our integrated models. This can be helpful **if you want to train and evaluate your own models** other than our integrated DreamerV2 and DreamerV3 on CarDreamer tasks.
168173

169174
CarDreamer offers a range of built-in task classes, which you can explore in the [CarDreamer Docs: Tasks and Configurations](https://car-dreamer.readthedocs.io/en/latest/tasks.html#tasks-and-environments).
170175

car_dreamer/configs/common.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ env:
7878
shape: [128, 128, 3]
7979
obs_range: 32
8080
ego_offset: 12
81+
# sight_fov = 150 equivalent to [150, 150] for [front, rear] FOV
82+
# Use [150, 90] to mimic human driver views
8183
sight_fov: 150
8284
sight_range: 32
8385
observability: full

docs/source/tasks.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Here is the descriptions of some common configurations in ``car_dreamer/configs/
7575
* ``shape`` (default: ``[128, 128, 3]``): the shape of the birdeye, should follow the form of ``[n, n, 3]``.
7676
* ``obs_range`` (default: ``32``): the range of the birdeye in meter (in unit of CARLA).
7777
* ``ego_offset`` (default: ``12``): the offset of the ego vehicle to the bottom of the birdeye in meter (in unit of CARLA).
78-
* ``sight_fov`` (default: ``150``): the field of view of the camera.
78+
* ``sight_fov`` (default: ``150``): the field of view of the camera. Use single value for the same front and rear FOV. Use 2-tuple to configure two angles, respectively. For example, ``[150, 90]`` can be common settings for human drivers.
7979
* ``sight_range`` (default: ``32``): the maximum visible distance
8080
* ``observability`` (default: ``full``): can be ``full, recursive_fov, fov``. ``full`` means all background vehicles are visible. ``fov`` means only vehicles in the field of view are visible. ``recursive_fov`` means vehicles in the fov of vehicles in ego's fov are also visible.
8181
* ``color_by_obs``: whether to color the vehicles by observability.
@@ -117,6 +117,9 @@ Here is a list of available environments and their supported tasks and configura
117117
.. autoclass:: car_dreamer.CarlaWptEnv
118118
:show-inheritance:
119119

120+
.. autoclass:: car_dreamer.CarlaWptFixedEnv
121+
:show-inheritance:
122+
120123
.. autoclass:: car_dreamer.CarlaFourLaneEnv
121124
:show-inheritance:
122125

@@ -126,9 +129,6 @@ Here is a list of available environments and their supported tasks and configura
126129
.. autoclass:: car_dreamer.CarlaOvertakeEnv
127130
:show-inheritance:
128131

129-
.. autoclass:: car_dreamer.CarlaWptFixedEnv
130-
:show-inheritance:
131-
132132
.. autoclass:: car_dreamer.CarlaLaneMergeEnv
133133
:show-inheritance:
134134

@@ -147,5 +147,8 @@ Here is a list of available environments and their supported tasks and configura
147147
.. autoclass:: car_dreamer.CarlaTrafficLightsEnv
148148
:show-inheritance:
149149

150+
.. autoclass:: car_dreamer.CarlaFollowEnv
151+
:show-inheritance:
152+
150153
.. note::
151154
All configurations mentioned here can also be changed by command line arguments. For example, to change the port number of the CARLA server, you can pass ``--env.world.carla_port <number>``. See :py:func:`car_dreamer.create_task` for more details.

dreamerv3/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ Execute the training script with desired configurations:
2525

2626
```bash
2727
cd ..
28+
# Example 1: Use default settings to train an agent
2829
bash train_dm3.sh 2000 0 --task carla_four_lane --dreamerv3.logdir ./logdir/carla_four_lane
30+
# Example 2: Override task and model parameters
31+
bash train_dm3.sh 2000 0 --task carla_right_turn_simple \
32+
--dreamerv3.logdir ./logdir/carla_right_turn_simple \
33+
--dreamerv3.run.steps=5e6
2934
```
3035

3136
`2000` is the port number of the CARLA server. The script will automatically start the server so you don't need to start it manually.

dreamerv3/dreamerv3.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ defaults:
44
task: dummy_disc
55
logdir: /dev/null
66
replay: uniform
7+
# Use smalelr replay t osave memory; 1e5 can be suffcient for most tasks
78
replay_size: 1e6
89
replay_online: False
910
eval_dir: ""

0 commit comments

Comments
 (0)