This project provides a multi-vehicle platooning/path-tracking demo in CARLA. The core ROS package is uimp_ros, which includes:
- Trajectory planning (
planner/) - MPC control (
controller/) - CARLA map visualization and vehicle spawning (
script/,example/auto_driving/launch/)
uimp_demo.mp4
It is recommended to run this project on Ubuntu + ROS1 (catkin) (native Ubuntu or WSL2 on Windows).
- CARLA Simulator (preferably version-matched with
ros-bridge) - ROS1 (with
catkin_makesupport) - Python3
catkinworkspace toolchain
The uimp_ros package declares the following main dependencies:
roscpprospystd_msgsgeometry_msgsmessage_generation/message_runtimecostmap_convertercarla_msgsackermann_msgsderived_object_msgs
If any package is missing, install it via
rosdepor your system package manager before building.
From the workspace root, run:
bash ./setup.shsetup.sh performs two steps:
- Clone
carla-simulator/ros-bridgeundersrc/(if not already present) - Return to the workspace root and run
catkin_make
After building, make sure this file exists:
devel/setup.bash
Start the CARLA server first (in another terminal):
cd $CARLA_ROOT
bash ./CarlaUE4.shCARLA_ROOT is your CARLA installation root directory.
bash ./demo.shThis script launches the following in order:
roslaunch uimp_ros Town04_spawn_car.launchrosrun uimp_ros run_planner.pyrosrun uimp_ros main_launch.py agent_0rosrun uimp_ros main_launch.py agent_1rosrun uimp_ros main_launch.py agent_2
bash ./demo_control.shThis script starts vehicle spawning and controllers, but does not run run_planner.py.
From the workspace root:
source devel/setup.bashThen run the following steps:
roslaunch uimp_ros Town04_spawn_car.launchrosrun uimp_ros run_planner.pyrosrun uimp_ros main_launch.py agent_0
rosrun uimp_ros main_launch.py agent_1
rosrun uimp_ros main_launch.py agent_2The planner script generates reference/actual trajectory files:
src/uimp_ros/planner/data/refpath_agent_0.txtsrc/uimp_ros/planner/data/refpath_agent_1.txtsrc/uimp_ros/planner/data/refpath_agent_2.txt
These files can be used for offline analysis or replay.
impm_ws/
├─ demo.sh # one-command full pipeline
├─ demo_control.sh # one-command control only
├─ setup.sh # clone ros-bridge + catkin_make
└─ src/uimp_ros/
├─ controller/ # MPC control entry and core logic
├─ planner/ # platoon/trajectory planning and outputs
├─ script/ # CARLA map visualization scripts
└─ example/auto_driving/
├─ launch/ # Town04 launch files
└─ configure/town04/ # vehicle and RViz configs
The workspace may not have built successfully. Re-run:
bash ./setup.shOr run manually:
catkin_makeEnsure source devel/setup.bash has been executed and uimp_ros has been built successfully with catkin_make.
- Make sure CARLA is started first
- Make sure port
2000is not occupied - If using a remote host, update
host/portarguments in the launch configuration
Your current Python environment is missing required modules. Install them in the same environment where ROS nodes are launched, then retry.