Skip to content

Commit cfddfb9

Browse files
authored
Merge pull request #132 from ucla-mobility/develop
Develop
2 parents b8f9eaa + 5ff7f6e commit cfddfb9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+872
-209
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,5 @@ opencda/evaluation_figures/
147147
evaluation_outputs/
148148
docs/tmp.py
149149
data_dumping
150+
video_dumping
151+

docs/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ for the latest release.
4545
:caption: Additional Information
4646

4747
md_files/contributor.md
48+
md_files/release_history.md
4849
modules
4950

5051

docs/md_files/getstarted.md

+12-9
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ OpenCDA provides benchmark scenarios that researchers can use directly without a
44
scenario testings only need one line of command:
55
```she
66
cd ~/OpenCDA
7-
python opencda.py -t scenario_name --aply_ml --record
7+
python opencda.py -t scenario_name -v carla_version --apply_ml --record
88
```
99
Parameters explanation:
1010
* `-t`: The name of the tesitng scenario. A python script with the same name should exist in
1111
`opencda/scenario_testing/` to construct the simulation, and a yaml file with the same name should exist in
1212
`opencda/scenario_testing/config_yaml/` to define the simulation parameters.
13+
* `-v --version`: Define the CARLA simulator version, default 0.9.11. Right now only 0.9.11 and 0.9.12 are supported.
14+
We need this as there are some api changes from 0.9.11 to 0.9.12.
1315
* `--apply_ml` (Optional): A flag to indicate whether a deep learning model needs to be loaded. If this flag is
1416
set, Pytorch will be imported.
1517
* `--record` (Optional): A flag to indicate whether to record this simulation. [Check here for more details](https://carla.readthedocs.io/en/latest/adv_recorder/).
@@ -18,9 +20,10 @@ Below we will demonstrate some examples of running the benchmark testings in Ope
1820

1921
---
2022
### Single Vehicle Test
23+
**Notice: <strong> Change -v 0.9.11 to -v 0.9.12 if you are using CARLA 0.9.12.</strong>
2124
#### 1. Two-lane highway test
2225
```sh
23-
python opencda.py -t single_2lanefree_carla
26+
python opencda.py -t single_2lanefree_carla -v 0.9.11
2427
```
2528
In this scenario , a single Connected Automated Vehicle will be spawned at a 2-lane highway customized map. This
2629
CAV will try to reach the assigned destination with a desired speed of 100km/h and manage to safely interact
@@ -36,7 +39,7 @@ If you want to activate the perception module, please check [Yaml Defining Rules
3639

3740
#### 2. Town06 test (Pytorch required)
3841
```sh
39-
python opencda.py -t single_town06_carla --apply_ml
42+
python opencda.py -t single_town06_carla -v 0.9.11 --apply_ml
4043
```
4144
The apply_ml flag will import the pytorch library and load Yolov5 model (<strong>Thus Pytorch is required</strong>) for object detection. Thus, in this
4245
scenario, the <strong>perception</strong>, localization, planning and control modules will all be activated.
@@ -46,7 +49,7 @@ scenario, the <strong>perception</strong>, localization, planning and control mo
4649

4750
#### 3. Town06 Co-simulation test (Pytorch and Sumo required)
4851
```sh
49-
python opencda.py -t single_town06_cosim --apply_ml
52+
python opencda.py -t single_town06_cosim -v 0.9.11 --apply_ml
5053
```
5154
This scenario applies <strong>Sumo</strong> to generate the traffic flow instead of using Carla traffic manager.
5255
Yolov5 and simple Lidar fusion are used to detect object 3D bounding box. Therefore, both
@@ -57,15 +60,15 @@ Pytorch and Sumo are required to install to run this benchmark test.
5760
### Cooperative Driving Test
5861
#### 1. Platooning stability test
5962
```sh
60-
python opencda.py -t platoon_stability_2lanefree_carla
63+
python opencda.py -t platoon_stability_2lanefree_carla -v 0.9.11
6164
```
6265
In this scenario, a platoon with 4 members will be placed at the 2-lane highway map. The platoon leader will dramatically increases
6366
and decreases its speed to test whether the members can still keep the desired time gap. In this way, the platoon
6467
stability is verified.
6568

6669
#### 2. Cooperative merge and joining a platoon
6770
```sh
68-
python opencda.py -t platoon_joining_2lanefree_carla
71+
python opencda.py -t platoon_joining_2lanefree_carla -v 0.9.11
6972
```
7073
In this scenario, a platoon will drive on the mainline together with a mixed traffic flow. A single CAV will come from the
7174
merging lane, communicate with the platoon to cooperatively merge into the mainline, and simultaneously join the platoon.
@@ -74,14 +77,14 @@ merging lane, communicate with the platoon to cooperatively merge into the mainl
7477

7578
#### 3. Cooperative merge and joining a platoon under co-simulation (SUMO required)
7679
```sh
77-
python opencda.py -t platoon_joining_2lanefree_cosim
80+
python opencda.py -t platoon_joining_2lanefree_cosim -v 0.9.11
7881
```
7982
![](images/platoon_joining_cosim.gif)
8083

8184
#### 4. Platoon back-join (Pytorch required)
8285
```sh
83-
python opencda.py -t platoon_joining_town06_carla --apply_ml
86+
python opencda.py -t platoon_joining_town06_carla -v 0.9.11 --apply_ml
8487
```
8588
A single CAV will try to overtake several human-driven vehicles to join the platoon from the back.
8689
Pytorch is required for this test since we use yolov5 detetion.
87-
![](images/platoon_joining_town06.gif)
90+
![](images/platoon_joining_town06.gif)

docs/md_files/images/opv2v.png

1.65 MB
Loading

docs/md_files/installation.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
To get started, the following requirements should be fulfilled.
1919
* __System requirements.__ Any 64-bits OS should run OpenCDA. We highly recommends Ubuntu 16.04/18.04/20.04.
2020

21-
* __Adequate GPU.__ CARLA is a realistic simulation platform based on Unity, which requires at least a 3GB GPU for smooth scene rendering, though 8GB is recommended.
21+
* __Adequate GPU.__ CARLA is a realistic simulation platform based on Unreal Engine 4, which requires at least a 3GB GPU for smooth scene rendering, though 8GB is recommended.
2222
* __Disk Space.__ Estimate 100GB of space is recommended to install CARLA and Unreal Engine.
2323
* __Python__ Python3.7 or higher version is required for full functions.
2424

@@ -29,7 +29,7 @@ To get OpenCDA v0.1 running with complete functionality, you will need four thin
2929
Pytorch (optional). Pytorch is required only when you want to activate the perception module; otherwise OpenCDA
3030
will retrieve all perception information from the simulation server directly.
3131

32-
### 1. CARLA Installation (0.9.11 required)
32+
### 1. CARLA Installation (>= 0.9.11 required)
3333

3434
There are two different recommended ways to install the CARLA simulator and either way is fine for using OpenCDA. <br>
3535
Note: If you want to use the customized highway map with full assets (.fbx, .xml and .xodr) in OpenCDA,
@@ -40,15 +40,15 @@ you have to build from source. Visit CARLA's tutorial [ADD a new map](https://ca
4040

4141
<div class="build-buttons">
4242
<p>
43-
<a href="https://github.com/carla-simulator/carla/releases/tag/0.9.11" target="_blank" class="btn btn-neutral" title="Go to the latest CARLA release">
44-
<span class="icon icon-github"></span> CARLA 0.9.11 Package</a>
43+
<a href="https://github.com/carla-simulator/carla/releases" target="_blank" class="btn btn-neutral" title="Go to the latest CARLA release">
44+
<span class="icon icon-github"></span> CARLA Released Package</a>
4545
</p>
4646
</div>
4747

48-
OpenCDA is only tested at 0.9.11 and thus we highly recommend using this version.
48+
OpenCDA is tested both at 0.9.11 and 0.9.12.
4949
To install CARLA as a precompiled package, download and extract the release file. It contains a precompiled version of the simulator, the Python API module and some scripts to be used as examples. <br>
5050

51-
<strong>Note: The AdditionalMaps_0.9.11.tar.gz also need to be downloaded and extract to the CARLA repo to support
51+
<strong>Note: The AdditionalMaps_0.9.1x.tar.gz also need to be downloaded and extract to the CARLA repo to support
5252
scenario testings in Town06.</strong>
5353

5454
#### 1.2 Build From Source
@@ -84,6 +84,7 @@ After dependencies are installed, we need to install the CARLA python library in
8484
You can do this by running this script:
8585
```sh
8686
export CARLA_HOME=/path/to/your/CARLA_ROOT
87+
export CARLA_VERSION=0.9.11 #or 0.9.12 depends on your CARLA
8788
. setup.sh
8889
```
8990
If everything works correctly, you will see a cache folder is created in your OpenCDA root dir, and the terminal shows
@@ -92,7 +93,7 @@ there should be no error.
9293
```sh
9394
python -c "import carla" # check whether carla is installed correctly.
9495
```
95-
<strong>Note: If you are using Python other than 3.7 and CARLA rather than 0.9.11, then you have to change the setup.sh to your
96+
<strong>Note: If you are using Python other than 3.7 and CARLA < 0.9.11 then you have to change the setup.sh to your
9697
carla version's egg file or manually installed carla to your conda environment.</strong>
9798

9899
### 3. Install Pytorch and Yolov5 (Optional)

docs/md_files/release_history.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## Release History of OpenCDA
2+
This page demonstrates all the changes since the origin release v0.1.0 with more detailed imags.
3+
4+
---
5+
### v0.1.1
6+
#### Cooperative Perception
7+
OpenCDA now supports data dumping simultaneously for multiple CAVs to develop V2V perception
8+
algorithms offline. The dumped data includes:
9+
- LiDAR data
10+
- RGB camera (4 for each CAV)
11+
- GPS/IMU
12+
- Velocity and future planned trajectory of the CAV
13+
- Surrounding vehicles' bounding box position, velocity <br>
14+
15+
Besides the above dumped data, users can also generate the future trajectory for each
16+
vehicle for trajectory prediction purpose. Run `python root_of_opencda/scripts/generate_prediction_yaml.py`
17+
to generate the prediction offline.
18+
19+
This new functionality has been proved helpful. The newest paper <strong>OPV2V: An Open Benchmark Dataset and Fusion Pipeline for Perception with Vehicle-to-Vehicle Communication</strong>
20+
has utilized this new feature to collect cooperative data. Check https://mobility-lab.seas.ucla.edu/opv2v/ for more information
21+
22+
![](images/opv2v.png )
23+
24+
#### CARLA 0.9.12 Support
25+
OpenCDA now supports both CARLA 0.9.12 and 0.9.11. Users needs to set CARLA_VERSION variable before
26+
installing OpenCDA. When users run opencda.py, -v argument is required to classify the CARLA version for
27+
OpenCDA to select the correct API.
28+
29+
#### Weather Parameters
30+
To help estimate the influence of weather on cooperative driving automation, users now can
31+
define weather setting in the yaml file to control sunlight, fog, rain, wetness and other conditions.
32+
33+
#### Bug Fixes
34+
Some minor bugs in the planning module are fixed.
1.65 MB
Loading

docs/md_files/yaml_define.md

+11
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ world: # define the CARLA server setting
1010
sync_mode: true # whether to use sync mode
1111
client_port: 2000 # client port to connect to the server
1212
fixed_delta_seconds: &delta 0.05 # fixed time step
13+
weather: # set weather parameters
14+
sun_altitude_angle: 15 # 90 is the midday and -90 is the midnight
15+
cloudiness: 0 # 0 is the clean sky and 100 is the thickest cloud
16+
precipitation: 0 # rain, 100 is the heaviest rain
17+
precipitation_deposits: 0 # Determines the creation of puddles. Values range from 0 to 100, being 0 none at all and 100 a road completely capped with water.
18+
wind_intensity: 0 # it will influence the rain
19+
fog_density: 0 # fog thickness, 100 is the largest
20+
fog_distance: 0 # Fog start distance. Values range from 0 to infinite.
21+
fog_falloff: 0 # Density of the fog (as in specific mass) from 0 to infinity. The bigger the value, the more dense and heavy it will be, and the fog will reach smaller heights
22+
wetness: 0
23+
1324

1425
vehicle_base: &vehicle_base # define cav default parameters
1526
sensing: &base_sensing # define sensing parameters

opencda.py

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ def arg_parse():
2727
action='store_true',
2828
help='whether ml/dl framework such as sklearn/pytorch is needed in the testing. '
2929
'Set it to true only when you have installed the pytorch/sklearn package.')
30+
parser.add_argument('-v', "--version", type=str, default='0.9.11',
31+
help='Specify the CARLA simulator version, default'
32+
'is 0.9.11, 0.9.12 is also supported.')
3033

3134
opt = parser.parse_args()
3235
return opt

0 commit comments

Comments
 (0)