Sign inSign up

usdotfhwastol/carma-carla-integration

By usdotfhwastol

Updated 2 months ago

Integration nodes for interfacing CARMA Platform with CARLA simulation environment

Image
0

2.0K

usdotfhwastol/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 image:

Clone carma-carla-integration repository by the command:

git clone https://github.com/usdot-fhwa-stol/carma-carla-integration.git

Build image from Dockerfile by using following command:

cd docker && ./build-image.sh 
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. 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

2.1 Run CARLA server

./CarlaUE4.sh

2.2 Change the CARLA map to match with CARMA Platform vector map by using the python script provided by CARLA in the path: CARLA_0.9.X/PythonAPI/util/config.py.

python3.7 config.py -m <map>

or

python2.7 config.py -m <map>

depends on your ubuntu setting

3.1 Run carma-carla docker container

docker run -it --net=host <carma-carla-integration-image-id> /bin/bash

3.2 Set the catkin source and CARLA python path

export PYTHONPATH=$PYTHONPATH:~/PythonAPI/carla/dist/carla-0.9.10-py3.7-linux-x86_64.egg && source ~/carma_carla_ws/devel/setup.bash

3.3 Launch CARMA-CARLA integration tool

roslaunch carma_carla_agent carma_carla_agent.launch synchronous_mode:='true'

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_mapTown04
spawn_pointTo specify where to spawn CARLA vehicle15.4,-90.1,0,0,0,90
role_nameAssign the name of the CARLA vehicle. It currently supports the name range from carma_1 to carma_12carma_1
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 Town04 with vehicle speed limit 20 MPH0.05
speed_KiSpeed integral value for the vehicle. The current default value was setup for Town04 with vehicle speed limit 20 MPH0.018
speed_KdSpeed derivative value for the vehicle. The current default value was setup for Town04 with vehicle speed limit 20 MPH0.4
accel_KpAcceleration proportional value for the vehicle. The current default value was setup for Town04 with vehicle speed limit 20 MPH0.053
accel_KiAcceleration integral value for the vehicle. The current default value was setup for Town04 with vehicle speed limit 20 MPH0.0
accel_KdAcceleration derivative value for the vehicle. The current default value was setup for Town04 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
synchronous_modeCARLA synchronous modefalse
fixed_delta_secondsCARLA fixed delta seconds0.05
selected_routeRoute file name to set to CARMA platform (must exist at /opt/carma/routes)
selected_pluginsPlugin list to set to CARMA platform
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/routes/. To customize a route, here is the instruction of creating a new route file

Tag summary

Content type

Image

Digest

sha256:baa0515c9

Size

4.5 GB

Last updated

over 3 years ago

docker pull usdotfhwastol/carma-carla-integration