This repository provides a collection of ROS packages for controlling a vehicle in the CARLA simulator.
The primary goal of this project is to develop a robust base_controller for an autonomous vehicle in the CARLA simulator. This controller is not intended to be the primary driving system but rather a safety-critical fallback mechanism. In a real-world scenario, a more advanced main controller, such as a Model Predictive Controller (MPC), would handle the primary driving tasks. However, if the main controller malfunctions or fails, the CARLA_base_controller is designed to take over, ensuring the vehicle can maintain a safe state, such as following a predefined safe path or coming to a controlled stop. This provides a crucial layer of redundancy and safety for the autonomous driving system.
This repository is a ROS workspace containing the following packages:
A simple PID controller to regulate the vehicle's longitudinal speed.
Usage:
rosrun carla_pid_controller pid_controllerTopics:
- Publishes:
/carla/ego_vehicle/vehicle_control_cmd(carla_msgs/CarlaEgoVehicleControl) - Subscribes:
/carla/ego_vehicle/vehicle_status(carla_msgs/CarlaEgoVehicleStatus) - Debug Topics:
/pid_controller/target_speed,/pid_controller/current_speed
An implementation of the Pure Pursuit algorithm for lateral control and path tracking. It includes a basic version and an advanced version with more stable PID control for speed.
Usage:
roslaunch pure_pursuit_controller pure_pursuit.launchNote: The launch file runs the pure_pursuit_controller_advanced node by default.
Parameters (pure_pursuit.launch):
csv_file: Path to the CSV file containing the waypoints.odom_topic: Vehicle's odometry topic.control_topic: Vehicle's control command topic.wheelbase: Vehicle's wheelbase.target_speed: Target speed for the vehicle.lookahead_k: Lookahead gain.min_lookahead_distance: Minimum lookahead distance.pid_kp,pid_ki,pid_kd: PID gains for the speed controller.
A node to generate a smooth velocity profile for a given path, considering curvature and acceleration limits.
Usage:
rosrun velocity_planning velocity_planningTopics:
/goal_odometry: Publishes the goal odometry./steering_angle: Publishes the calculated steering angle./goal_marker: Publishes a marker for the goal point in RViz./target_speed: Publishes the target speed./path_marker_array: Publishes markers for the path in RViz.
- CARLA Simulator (version 0.9.13)
- ROS 1 Noetic
- ROS-Bridge for CARLA
carla-ros-msgs
- Clone the repository:
git clone https://github.com/your-username/CARLA_base_controller.git
- Build the packages:
cd CARLA_base_controller catkin_make - Source the workspace:
source devel/setup.bash
This repository was developed as part of a graduation project. The final report provides a detailed overview of the project, including the design, implementation, and results of the controllers.
View the Final Report (PDF): (https://drive.google.com/file/d/1HFOjPboisc_poEx3CZaeLitN4R9pTad-/view?usp=sharing)
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.


