AVP-Simulation is an Automated Valet Parking (AVP) co-simulation project built with CARLA, ROS 2, and Autoware.
CARLA provides the parking environment, vehicle dynamics, and simulated sensor data. ROS-Agent Bridge transfers LiDAR, camera, IMU, GNSS, and vehicle-state data from CARLA to Autoware. Autoware then performs localization, path planning, and vehicle control before the resulting commands are sent back to CARLA, creating a complete closed-loop autonomous parking system.
The main contributions of this project include:
- Creating a PCD point cloud map of the parking environment for Autoware localization;
- Creating a Lanelet2 high-definition map containing road and parking-space semantics;
- Aligning sensor poses, coordinate frames, topics, and launch pipelines between CARLA and Autoware;
- Creating and adapting
sensor_kit_calibration.yaml,sensors_calibration.yaml,gnss.launch.xml, andautoware.launch.xml; - Establishing a closed loop from sensor input through Autoware localization, planning, and control to vehicle execution in CARLA;
- Supporting initial-pose estimation, parking-space selection, trajectory planning, and autonomous parking through RViz.
The closed-loop data flow is summarized below:
CARLA Parking Environment and Sensors
│
│ LiDAR / Camera / IMU / GNSS / Vehicle Status
▼
ROS-Agent Bridge (ROS 2)
│
▼
Autoware: Localization → Planning → Control
│
│ AckermannControlCommand
▼
ROS-Agent / CARLA Vehicle
Autoware point cloud localization requires a prebuilt PCD map of the parking environment. In this project, the map is generated from the CARLA SUSTC_Parkinglot environment using either of the following approaches:
- PCL Recorder: uses the point cloud map recorder provided by CARLA ROS Bridge to sample the simulated environment directly;
- LIO-SAM (SLAM): combines LiDAR, IMU, and GNSS data to create the map through a workflow closer to real-world vehicle mapping.
Useful references:
Note
Vector Map Builder requires an ASCII PCD file. If the generated point cloud is stored as a binary PCD, convert it with pcl_converter:
sudo apt install pcl-tools
pcl_converter -f ascii source.pcd destination.pcdThe point cloud map is used as the base layer in Vector Map Builder to create an extended Lanelet2 map compatible with Autoware. The resulting HD map describes:
- Drivable areas and lane boundaries in the parking lot;
- Lane centerlines and their topological connections;
- Parking spaces, parking goals, and associated semantic information;
- Lanelet2 attributes and routing relationships required by Autoware planning.
Useful mapping tools and documentation:
- Vector Map Builder documentation
- Vector Map Builder video tutorial
- Map Toolbox for Autoware
- ASSURE Mapping Tools
- JOSM
- Autoware Lanelet2 extension format
CARLA uses Unreal Engine coordinate conventions, whereas ROS and Autoware use the ROS right-handed coordinate system. A working integration must therefore align not only the sensor positions and orientations, but also the frame_id values, TF tree, topic names, and launch order.
The key files adapted in this project are:
| File | Purpose | Main alignment task |
|---|---|---|
sensor_kit_calibration.yaml |
Defines static extrinsic transforms inside the sensor kit | LiDAR, camera, IMU, and GNSS x/y/z/roll/pitch/yaw relative to sensor_kit_base_link |
sensors_calibration.yaml |
Defines the transform between the vehicle and sensor kit | Static transform from base_link to sensor_kit_base_link |
gnss.launch.xml |
Starts and adapts the GNSS/IMU pipeline | Node startup, topic remapping, message integration, and coordinate frames |
autoware.launch.xml |
Organizes the main Autoware launch pipeline | Map, sensor model, localization, planning, control, and simulation parameters |
After applying the calibration and launch files, verify the critical topics and TF transforms:
# Inspect the critical topics
ros2 topic list
ros2 topic hz /carla_pointcloud
ros2 topic echo /sensing/gnss/ublox/nav_sat_fix --once
# Verify that the TF tree is connected
ros2 run tf2_ros tf2_echo base_link sensor_kit_base_link
ros2 run tf2_ros tf2_echo sensor_kit_base_link velodyne_top_base_linkImportant
This project preserves its original validated environment: Ubuntu 20.04, ROS 2 Galactic, and Autoware Galactic. ROS 2 Galactic has reached end of life. Use the versions below consistently instead of mixing this setup with ROS 2 Humble or a recent Autoware release.
| Component | Recommended configuration |
|---|---|
| Operating system | Ubuntu 20.04 |
| CPU | 9th-generation Intel Core i7 or newer |
| Memory | 32 GB or more |
| GPU | 8 GB VRAM or more |
| ROS 2 | Galactic |
| Autonomous driving stack | Autoware Galactic |
| Simulator | Project-provided CARLA build with the SUSTC_Parkinglot map |
The complete installation consists of four parts: CARLA, ROS 2 Galactic, Autoware, and ROS-Agent Bridge.
The recommended workspace layout is:
~/ros-agent/
├── autoware/
└── bridge/
├── op_bridge/
├── op_agent/
├── scenario_runner/
└── Maps/
Download the specified CARLA version containing the SUSTC_Parkinglot map:
- Baidu Netdisk, extraction code:
b5au - Google Drive
After extracting CARLA, define CARLA_ROOT. Replace the example path with the actual installation directory:
echo 'export CARLA_ROOT=/path/to/CARLA' >> ~/.bashrc
source ~/.bashrcConfirm that CARLA starts correctly on its own:
cd "$CARLA_ROOT"
./CarlaUE4.shFollow the official ROS 2 Galactic installation guide for Ubuntu, then initialize the dependency-management tools:
source /opt/ros/galactic/setup.bash
sudo rosdep init # Skip this command if rosdep has already been initialized
rosdep update --include-eol-distrosClone the Autoware branch used by this project:
mkdir -p ~/ros-agent
cd ~/ros-agent
git clone https://github.com/ROS-Agent/autoware.git -b galacticInstall the development dependencies:
cd ~/ros-agent/autoware
./setup-dev-env.shImport the Autoware source repositories:
cd ~/ros-agent/autoware
mkdir -p src
vcs import src < autoware.reposInstall the required ROS packages:
cd ~/ros-agent/autoware
source /opt/ros/galactic/setup.bash
rosdep update --include-eol-distros
rosdep install -y --from-paths src --ignore-src --rosdistro "$ROS_DISTRO"Build the workspace:
cd ~/ros-agent/autoware
source /opt/ros/galactic/setup.bash
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=ReleaseClone the bridge, agent, Scenario Runner, and map repositories:
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.gitBack up the original files before copying the project-specific configurations. The following procedure preserves the original installation workflow while using cp so that the source files remain available in the Maps repository:
cd ~/ros-agent/bridge/Maps
cp ~/ros-agent/autoware/src/launcher/autoware_launch/autoware_launch/launch/autoware.launch.xml \
~/ros-agent/autoware/src/launcher/autoware_launch/autoware_launch/launch/autoware.launch.xml.bak
cp ~/ros-agent/autoware/src/sensor_kit/sample_sensor_kit_launch/sample_sensor_kit_launch/launch/gnss.launch.xml \
~/ros-agent/autoware/src/sensor_kit/sample_sensor_kit_launch/sample_sensor_kit_launch/launch/gnss.launch.xml.bak
cp ~/ros-agent/autoware/src/sensor_kit/sample_sensor_kit_launch/sample_sensor_kit_description/config/sensor_kit_calibration.yaml \
~/ros-agent/autoware/src/sensor_kit/sample_sensor_kit_launch/sample_sensor_kit_description/config/sensor_kit_calibration.yaml.bak
cp ~/ros-agent/autoware/src/sensor_kit/sample_sensor_kit_launch/sample_sensor_kit_description/config/sensors_calibration.yaml \
~/ros-agent/autoware/src/sensor_kit/sample_sensor_kit_launch/sample_sensor_kit_description/config/sensors_calibration.yaml.bak
cp autoware.launch.xml ~/ros-agent/autoware/src/launcher/autoware_launch/autoware_launch/launch/autoware.launch.xml
cp gnss.launch.xml ~/ros-agent/autoware/src/sensor_kit/sample_sensor_kit_launch/sample_sensor_kit_launch/launch/gnss.launch.xml
cp sensor_kit_calibration.yaml ~/ros-agent/autoware/src/sensor_kit/sample_sensor_kit_launch/sample_sensor_kit_description/config/sensor_kit_calibration.yaml
cp sensors_calibration.yaml ~/ros-agent/autoware/src/sensor_kit/sample_sensor_kit_launch/sample_sensor_kit_description/config/sensors_calibration.yamlIf these files are replaced after the first Autoware build, rebuild the workspace and source the updated environment:
cd ~/ros-agent/autoware
source /opt/ros/galactic/setup.bash
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
source install/setup.bashAdd the following variables to ~/.bashrc:
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_agentReload the shell configuration:
source ~/.bashrcOpen terminal 1:
cd "$CARLA_ROOT"
./CarlaUE4.shWait until the parking environment has finished loading before starting ROS-Agent Bridge.
Open terminal 2:
cd ~/ros-agent/autoware
source /opt/ros/galactic/setup.bash
source install/setup.bash
cd ~/ros-agent/bridge/op_bridge/op_scripts
./run_exploration_mode_ros2.shOnce the script is running, the vehicle and simulated sensor data from CARLA should become available to Autoware, and RViz should start automatically.
- Click
2D Pose Estimatein the RViz toolbar; - Click and drag in the 3D view to set the vehicle position and heading;
- Confirm that the point cloud aligns with the map and that the vehicle pose matches its position in CARLA.
- Click
2D Goal Posein the RViz toolbar; - Click and drag inside the target parking space to define the parking position and final vehicle heading;
- Confirm that RViz displays a planned path from the current pose to the target space;
- Click
Engagein theAutowareStatePanel; - Autoware will publish control commands and the vehicle will execute the parking maneuver in CARLA.
| Data | Topic | Message type | Description |
|---|---|---|---|
| LiDAR | /carla_pointcloud |
sensor_msgs/msg/PointCloud2 |
3D LiDAR point cloud from CARLA |
| Camera info | /sensing/camera/traffic_light/camera_info |
sensor_msgs/msg/CameraInfo |
Camera calibration and image metadata |
| Camera image | /sensing/camera/traffic_light/image_raw |
sensor_msgs/msg/Image |
Uncompressed camera image |
| IMU | /sensing/imu/tamagawa/imu_raw |
sensor_msgs/msg/Imu |
Raw IMU measurements |
| GNSS | /sensing/gnss/ublox/nav_sat_fix |
sensor_msgs/msg/NavSatFix |
GNSS position fix |
| Vehicle velocity | /vehicle/status/velocity_status |
autoware_auto_vehicle_msgs/msg/VelocityReport |
Current vehicle velocity |
| Steering angle | /vehicle/status/steering_status |
autoware_auto_vehicle_msgs/msg/SteeringReport |
Current steering angle |
| Control mode | /vehicle/status/control_mode |
autoware_auto_vehicle_msgs/msg/ControlModeReport |
Autonomous, manual, and other control states |
| Control command | /control/command/control_cmd |
autoware_auto_control_msgs/msg/AckermannControlCommand |
Lateral and longitudinal command produced by Autoware |
Check the parent and child frames, units, and angles in sensor_kit_calibration.yaml and sensors_calibration.yaml. CARLA/Unreal and ROS use different coordinate conventions, so pay particular attention to the Y-axis direction and yaw sign.
Make sure that you edited the configuration under src for the active sensor_model. Run colcon build --symlink-install again and source install/setup.bash in a new terminal.
Confirm that /carla_pointcloud is being published continuously, the TF tree is connected, and the PCD map uses the same origin, scale, and orientation as the CARLA environment. Set the initial pose inside an area covered by valid map points.
Check that Engage has been selected in AutowareStatePanel, the control mode has switched to autonomous, /control/command/control_cmd is being published, and ROS-Agent Bridge is still running.
This project is distributed under the terms of the repository LICENSE.



