Installation Instructions
Prerequisites
The instructions provided on this page are for Ubuntu 20.04 and ROS 2 Galactic.
See the Ubuntu 20.04 installation instructions for more information.
See the ROS2 Galactic installation instructions for more information.
We will use the following directory structure in this tutorial:
Nist Demo Package
Create the
nist_seri_wsdirectory:Clone the
seri_workshop_demopackage:Build the
seri_workshop_demopackage:
Carla Simulator
Carla 0.9.13 is used in the demo.
Create the
autoware_carladirectory:
Get one of the two following pre-built binaries from here.
Download one of the following pre-built versions in
autoware_carla:
Extract the archive to a directory of your choice. We will use the following directory in this example:
~/dev/carla_simulator/Check the the simulator can run:
cd ~/autoware_carla/<carla folder> ./CarlaUE4.sh -quality-level=Epic -prefernvidia
Note: Options to
CarlaUE4.shcan be found here.
Autoware
Autoware (version Galactic) is used in the demo. The following instructions are taken from the Autoware Source Installation.
Install Git
sudo apt-get -y update sudo apt-get -y install git
Install Autoware
Clone autowarefoundation/autoware:
cd ~/autoware_carla git clone https://github.com/autowarefoundation/autoware.git -b galactic
Pull the dependencies:
cd ~/autoware_carla/autoware mkdir src vcs import src < autoware.repos
Install dependent ROS packages:
source /opt/ros/galactic/setup.bash cd ~/autoware_carla/autoware rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
Build the workspace:
cd ~/autoware_carla/autoware colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
Note:
colcon buildbuilds all packages in the workspace. This can take a long time (approximately 20-30 min).Requirements
~/autoware_carla/autowareis a ROS 2 workspace. Each time a modification is made to any file in thesrcfolder, the workspace must be rebuilt withcolcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release.Test Autoware:
Follow the instructions found here to test the planning simulation in Autoware.
Carla Autoware Bridge
Clone the
autoware_carla_launchpackage:Build the
autoware_carla_launchpackage:Test the bridge:
Terminal 1: Run Carla
Terminal 2: Run the bridge
Run Multiple Vehicles
Since running two Autoware will cause port conflict, we need to do some modifications.
- Modify the file
behavior_planning.launch.py -
import random # Add this line ... { "bt_tree_config_path": [ FindPackageShare("behavior_path_planner"), "/config/behavior_path_planner_tree.xml", ], "groot_zmq_publisher_port": random.randint(2000, 4000), # Add this line "groot_zmq_server_port": random.randint(2000, 4000), # Add this line "planning_hz": 10.0, },
- Modify the file
Able to spawn a second vehicle into Carla.
Modify
~/autoware_carla_launch/src/autoware_carla_launch/launch/carla_bridge.launch.xml(About line 7)Remove the following line:
<executable cmd="poetry run python3 main.py --host $(env CARLA_SIMULATOR_IP) --rolename $(env VEHICLE_NAME)" cwd="$(env AUTOWARE_CARLA_ROOT)/external/zenoh_carla_bridge/carla_agent" output="screen" />
Add the following lines:
<executable cmd="poetry run python3 main.py --host $(env CARLA_SIMULATOR_IP) --rolename 'v1' --position 87.687683,145.671295,0.300000,0.000000,90.000053,0.000000" cwd="$(env AUTOWARE_CARLA_ROOT)/external/zenoh_carla_bridge/carla_agent" output="screen" /> <executable cmd="poetry run python3 main.py --host $(env CARLA_SIMULATOR_IP) --rolename 'v2' --position 92.109985,227.220001,0.300000,0.000000,-90.000298,0.000000" cwd="$(env AUTOWARE_CARLA_ROOT)/external/zenoh_carla_bridge/carla_agent" output="screen" />
Spawn two vehicles.
Run Carla:
Run the bridge:
Run Autoware for the first vehicle:
Run Autoware for the second vehicle: