This is a co-simulation project of AVP (Automated Valet Parking) based on CARLA and Autoware. Based on ROS2, the ros-agent retrieve sensor data from CARLA and transmit it to Autoware, then Autoware calculates the control command to pass it to CARLA to execute.
- Ubuntu20.04
- CPU Intel i7 9th or higher
- RAM 32GB or more
- GPU 8GB or more
The overall installation includes four parts:
- CARLA installation
- ROS2 installation
- Autoware installation
- ros-agent bridge installation
Download the specified CARLA version with SUSTC_Parkinglot Map. The newest version is recommended.(BaiduCloud | GoogleDrive)
This project is based on ROS2 galactic. In order to install galactic, please follow the official tutorial.
Autoware is the world's leading open-source software project for AD(Autonomous Driving).Autoware includes the necessary functions to drive an autonomous vehicles from localization and object detection to route planning and control.This project use Autoware galactic as the AD stack.
- Clone Autoware repository
mkdir ~/ros-agent
cd ~/ros-agent
git clone https://github.com/ROS-Agent/autoware.git -b galactic
- Install dependencies using Ansible. You can also install dependecies manually, following this website.
cd ~/ros-agent/autoware
./setup-dev-env.sh
- Create the src directory and clone repositories into it.
mkdir src
vcs import src < autoware.repos
- Install dependent ROS packages.
rosdep update --include-eol-distros
source /opt/ros/galactic/setup.bash
rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
- Build the workspace.
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
The ROS-Agent brige is the data transmission bridge, which retrieves sensor data from CARLA to pass it to Autoware and receives Autoware control command to pass it to CARLA.
- Clone repositories and Maps.
mkdir -p ~/ros-agent/bridge
cd ~/ros-agent/bridge
git clone https://github.com/ROS-Agent/op_bridge.git -b AVP
git clone https://github.com/ROS-Agent/op_agent.git -b AVP
git clone https://github.com/ROS-Agent/scenario_runner.git
git clone https://github.com/ROS-Agent/Maps.git
- Replace sensor config and launch files
cd ~/ros-agent/bridge/Maps
sudo mv autoware.launch.xml ~/ros-agent/autoware/src/launcher/autoware_launch/autoware_launch/launch/autoware.launch.xml
sudo mv gnss.launch.xml ~/ros-agent/autoware/src/sensor_kit/sample_sensor_kit_launch/sample_sensor_kit_launch/launch/gnss.launch.xml
sudo mv sensor_kit_calibration.yaml ~/ros-agent/autoware/src/sensor_kit/sample_sensor_kit_launch/sample_sensor_kit_description/config/sensor_kit_calibration.yaml
sudo mv sensors_calibration.yaml ~/ros-agent/autoware/src/sensor_kit/sample_sensor_kit_launch/sample_sensor_kit_description/config/sensors_calibration.yaml
- Set environment variables
gedit ~/.bashrc
# Add the following line to the bottom of the file.
export CARLA_ROOT=/path/to/CARLA/server/root/folder
export SCENARIO_RUNNER_ROOT=~/ros-agent/bridge/scenario_runner
export LEADERBOARD_ROOT=~/ros-agent/bridge/op_bridge
export TEAM_CODE_ROOT=~/ros-agent/bridge/op_agent
# Save the file and reset the terminal.
- Open one terminal
cd $CARLA_ROOT
./CarlaUE4.sh
- Open another terminal
cd ~/ros-agent/autoware
source ./install/setup.bash
cd ~/ros-agent/bridge/op_bridge/op_scripts
./run_exploration_mode_ros2.sh
- Set vehicle initial pose.
- (1) Click the
2D Pose estimate
button in the toolbar - (2) In the 3D View pane, click and hold the left-mouse button, and then drag to set the direction for the initial pose, as the following gif image shows.
- Set vehicle goal pose and
Engage
the vehicle, as the following gif image shows.
- (1) Click the
2D Goal Pose
button in the toolbar - (2) In the 3D View pane, click and hold the left-mouse button, and then drag to set the direction for the goal pose. If done correctly, you will see a planned path from initial pose to goal pose
- (3) Click the
Engage
button inAutowareStatePanel
- Enjoy!!
This is a ROS-Agent Architecture which describes data flow of this project.
There are many ways to create PCD Map using CARLA simulation sensor data. In this project, we use the following two ways.
- PCL Recorder. This is a CARLA official ROS Package to allows you to create point cloud maps from CARLA maps. Fore more information, please check this webpage.
- LIO-SAM(SLAM). This method uses CARLA sensor data(LiDAR, IMU, GNSS) to SLAM. Here is a real-time lidar-inertial odometry SLAM package.
For more information about Map Creation, please check the Autoware Official website tutorial guides.
There are also many ways to create HD Map, but in order to satisfy Autoware's HD Map formap(extended Lanelet2
), we use the official HD Map Tools Vector Map Builder. Here are some useful information for your reference:
- Vector Map Builder official tutorial.
- Vector Map Builder short video tutorial.
- Map Toolbox for Autoware, a unity package tool.
- ASSURE mapping tools. A desktop based tool for viewing, editing and saving road network maps for autonomous vehicle platforms such as Autoware.
- OSM map editor JOSM.
- Autoware Lanelet2 format details.
Tips
Vector Map Builder
only supports ascii pcd map and do not support binary pcd map. You can use thepcl_converter
command to complete the conversion between the two formats.
pcl_converter -f ascii source.pcd dest.pcd
# if you have some problems, please check whether you have installed `pcl-tools`.
sudo apt install pcl-tools
Topic name | Topic type | Description |
---|---|---|
/carla_pointcloud |
sensor_msgs/msg/PointCloud2 | 3D Lidar sensor data |
Topic name | Topic type | Description |
---|---|---|
/sensing/camera/traffic_light/camera_info |
sensor_msgs/msg/CameraInfo | This message defines meta information for a camera. |
/sensing/camera/traffic_light/image_raw |
sensor_msgs/msg/Image | This message contains an uncompressed image |
Topic name | Topic type | Description |
---|---|---|
/sensing/imu/tamagawa/imu_raw |
sensor_msgs/msg/Imu | This is a message to hold data from an IMU (Inertial Measurement Unit) |
Topic name | Topic type | Description |
---|---|---|
/sensing/gnss/ublox/nav_sat_fix |
sensor_msgs/msg/NavSatFix | Navigation Satellite fix for any Global Navigation Satellite System |
Topic name | Topic type | Description |
---|---|---|
/vehicle/status/velocity_status |
autoware_auto_vehicle_msgs/msg/VelocityReport | Vechilce realtime velocity data |
Topic name | Topic type | Description |
---|---|---|
/vehicle/status/steering_status |
autoware_auto_vehicle_msgs/msg/SteeringReport | Vechilce realtime steering angle data |
Topic name | Topic type | Description |
---|---|---|
/vehicle/status/control_mode |
autoware_auto_vehicle_msgs/msg/ControlModeReport | Contorl mode includes NO_COMMAND\AUTONOMOUS\AUTONOMOUS_STEER_ONLY\AUTONOMOUS_VELOCITY_ONLY\MANUAL\DISENGAGED\NOT_READY |
Topic name | Topic type | Description |
---|---|---|
/control/command/control_cmd |
autoware_auto_control_msgs/msg/AckermannControlCommand | Lateral and longitudinal control message for Ackermann-style platforms |