This user guide provides step-by-step user instructions on how to build CARMA-CARLA integration tool on Docker, setup configuration for both CARMA platform and CARMA-CARLA integration tool and run that with CARMA platform.
There are two ways to get CARMA-CARLA docker image. You can either choose to pull the co-simulation tool docker image from DockerHub or build the image by yourself.
git clone https://github.com/usdot-fhwa-stol/carma-carla-integration.git
Option 1. Build image from Dockerfile by using following command:
cd docker && ./build-image.sh -v [version]
Option 2. Pull image from DockerHub by using following command:
docker pull usdotfhwastol/carma-carla-integration:[tag]
The tag information could be found from usdotfhwastol Dockerhub
cd <path-to-carma-carla-integration>/docker && ./run.sh -v [version]
sudo nano ros-bridge/carla_ros_bridge/config/settings.yaml
CARMA Config for the simulation currently cannot be pulled from docker hub. It requires local docker build for the image.
git clone https://github.com/usdot-fhwa-stol/carma-config.git
git switch Update/carla_integration
cd carla_integration/ && ./build-image.sh
carma config set usdotfhwastol/carma-config:[tag]
carma start all
./CarlaUE4.sh
CARLA_0.9.10/PythonAPI/util/config.py.python config.py -m <map>
4.1 Run carma-carla docker container
cd <path-to-carma-carla-integration>/docker && ./run.sh -v [version]
4.2 Set the catkin source and CARLA python path
export PYTHONPATH=$PYTHONPATH:/home/PythonAPI/carla-0.9.10-py2.7-linux-x86_64.egg && source /home/carma_carla_ws/devel/setup.bash
4.3 Launch CARMA-CARLA integration tool
roslaunch carma_carla_agent carma_carla_agent.launch town:='your_map_name' spawn_point:='spawn_point_info'
Note: step 3 must be completed within 20 seconds after step 2 being completed
incognito window then click the circle button at the left bottom corner.
Afterward, the corresponding CARLA vehicle will start to receive control command from CARMA-Platform and start to following the selected route to move
docker pull usdotfhwastol/carma-xil-cosimulation:[tag]
The tag information could be found from carma-xil-cosimulation docker repositories
carma start all
<path-to-carma-carla-integration>/docker/.docker-compose up
The default setting of the scenario in docker-compose.yml is Town04 for both CARMA-CARLA and co-simulation. It must be edited to test different scenario
The usage instruction includes what parameter could be parsed to CARMA-CARLA integration, the description of these parameters and CARMA parameters
| Parameters | Description | Default |
|---|---|---|
| host | CARLA server IP address | 127.0.0.1 |
| port | CARLA server port number | 2000 |
| town | To specify which scenario for CARLA server to load. The scenario should be matched with executed CARMA Platform vector_map | Town02 |
| spawn_point | To specify where to spawn CARLA vehicle | N/A |
| role_name | Assign the name of the CARLA vehicle. It currently only supports the name range from hero0 to hero9 and ego_vehicle | ego_vehicle |
| vehicle_model | To specify what vehicle model should be generated in CARLA server | vehicle.toyota.prius |
| vehicle_length | To specify the length of vehicle | 5.00 |
| vehicle_width | To specify the width of vehicle | 3.00 |
| vehicle_wheelbase | To specify the size of wheelbase for the vehicle | 2.79 |
| speed_Kp | Speed proportional value for the vehicle. The current default value was setup for Town02 with vehicle speed limit 20 MPH | 0.05 |
| speed_Ki | Speed integral value for the vehicle. The current default value was setup for Town02 with vehicle speed limit 20 MPH | 0.018 |
| speed_Kd | Speed derivative value for the vehicle. The current default value was setup for Town02 with vehicle speed limit 20 MPH | 0.4 |
| accel_Kp | Acceleration proportional value for the vehicle. The current default value was setup for Town02 with vehicle speed limit 20 MPH | 0.053 |
| accel_Ki | Acceleration integral value for the vehicle. The current default value was setup for Town02 with vehicle speed limit 20 MPH | 0.0 |
| accel_Kd | Acceleration derivative value for the vehicle. The current default value was setup for Town02 with vehicle speed limit 20 MPH | 0.052 |
| init_speed | To specify the initial vehicle speed | 5 |
| init_acceleration | To specify the initial vehicle acceleration | 1 |
| init_steering_angle | To specify the initial vehicle steering wheel angle, it range from 0.7(left) to -0.7(right) | 0 |
| init_jerk | To specify the initial vehicle jerk value | 0 |
After CARMA platform installed successfully, the default vector_map.osm and pcd_map.pcd are Town02 stored in the folder /opt/carma/maps/. CARMA platform will load vector map (lanelet) and point cloud map when it has been launched.
The vector map could be converted from open drive (.xodr) by using the opendrive2lanelet tool.
Also, CARLA simulation provides several available Town maps to download from autoware-contents
After CARMA platform installed successfully, there is a default Town02 route file located in the folder /opt/carma/route/. To customize a route, here is the instruction of creating a new route file
Content type
Image
Digest
sha256:1113783f3…
Size
5.3 GB
Last updated
22 days ago
docker pull usdotfhwastoldev/carma-carla-integration:develop