Sign inSign up

usdotfhwastoldev/carma-carla-integration

By usdotfhwastoldev

Updated 22 days ago

Image
0

981

usdotfhwastoldev/carma-carla-integration repository overview

CARMA-CARLA Integration Tool

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.

Requirement

Setup

CARMA-CARLA Integration Setup
  1. Getting CARMA-CARLA integration docker mage:

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

  1. Modify CARLA ROS bridge (skipped if running with co-simulation tool): If the CAMRA-CARLA integration is runing alone without co-simulation tool. The synchronous mode parameter should be enabled.
Step 1: Launched the CARMA-CARLA docker container:
cd <path-to-carma-carla-integration>/docker && ./run.sh -v [version]
Step 2: Modify the parameter synchronous_mode value to true
sudo nano ros-bridge/carla_ros_bridge/config/settings.yaml
CARMA Platform Config

CARMA Config for the simulation currently cannot be pulled from docker hub. It requires local docker build for the image.

  1. Clone the source code of CARMA config from github:
git clone https://github.com/usdot-fhwa-stol/carma-config.git
  1. Switch branch.
git switch Update/carla_integration
  1. Go to the directory /carla_integration under CARMA config and build the docker image. Remember the image name
cd carla_integration/ && ./build-image.sh
  1. Setup CARMA config of the simulation
carma config set usdotfhwastol/carma-config:[tag]

Run CARMA-CARLA Integration Tool with CARMA Platform

  1. Run CARMA Platform with separated terminal
carma start all
  1. Run CARLA server
./CarlaUE4.sh
  1. Change the map to match with CARMA Platform vector map (initial setting is Town02) by using the python script provided by CARLA in the path : 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

  1. Open CARMA-Web-UI to select route and plugins via Chromium Web Browser incognito window then click the circle button at the left bottom corner.

CARMA-Web-UI

Afterward, the corresponding CARLA vehicle will start to receive control command from CARMA-Platform and start to following the selected route to move

Run CARMA-CARLA Integration Tool with CARMA Platform and Co-Simulation tool

  1. To run the with the co-simulation tool, the carma-xil-cosimulation docker image must be pulled firstly.
docker pull usdotfhwastol/carma-xil-cosimulation:[tag]

The tag information could be found from carma-xil-cosimulation docker repositories

  1. Run CARMA platform
carma start all
  1. Run docker-compose.yml at the directory <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

Usage Instruction

The usage instruction includes what parameter could be parsed to CARMA-CARLA integration, the description of these parameters and CARMA parameters

CARMA-CARLA Integration Parameters
ParametersDescriptionDefault
hostCARLA server IP address127.0.0.1
portCARLA server port number2000
townTo specify which scenario for CARLA server to load. The scenario should be matched with executed CARMA Platform vector_mapTown02
spawn_pointTo specify where to spawn CARLA vehicleN/A
role_nameAssign the name of the CARLA vehicle. It currently only supports the name range from hero0 to hero9 and ego_vehicleego_vehicle
vehicle_modelTo specify what vehicle model should be generated in CARLA servervehicle.toyota.prius
vehicle_lengthTo specify the length of vehicle5.00
vehicle_widthTo specify the width of vehicle3.00
vehicle_wheelbaseTo specify the size of wheelbase for the vehicle2.79
speed_KpSpeed proportional value for the vehicle. The current default value was setup for Town02 with vehicle speed limit 20 MPH0.05
speed_KiSpeed integral value for the vehicle. The current default value was setup for Town02 with vehicle speed limit 20 MPH0.018
speed_KdSpeed derivative value for the vehicle. The current default value was setup for Town02 with vehicle speed limit 20 MPH0.4
accel_KpAcceleration proportional value for the vehicle. The current default value was setup for Town02 with vehicle speed limit 20 MPH0.053
accel_KiAcceleration integral value for the vehicle. The current default value was setup for Town02 with vehicle speed limit 20 MPH0.0
accel_KdAcceleration derivative value for the vehicle. The current default value was setup for Town02 with vehicle speed limit 20 MPH0.052
init_speedTo specify the initial vehicle speed5
init_accelerationTo specify the initial vehicle acceleration1
init_steering_angleTo specify the initial vehicle steering wheel angle, it range from 0.7(left) to -0.7(right)0
init_jerkTo specify the initial vehicle jerk value0
CARMA Maps

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

CARMA Routes

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

Tag summary

Content type

Image

Digest

sha256:1113783f3

Size

5.3 GB

Last updated

22 days ago

docker pull usdotfhwastoldev/carma-carla-integration:develop