Skip to content

About

Cascaded ROS 2 PID Controller for Ackermann steered vehicles

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Repository files navigation

ackermann_trajectory_control


Cascaded ROS 2 PID Controller for Ackermann steered vehicles

This repository contains a trajectory controller for Ackermann-steered vehicles. It is implemented as a ROS 2 C++ node that subscribes to trajectory_planning_msgs/Trajectory and perception_msgs/EgoData and publishes control commands as ackermann_msgs/AckermannDriveStamped.

The control loop is executed at a configurable frequency and consists of a cascaded PID control architecture with a feedforward term based on the trajectory's curvature and acceleration and a feedback term based on velocity deviations for longitudinal control and lateral displacement and yaw-deviations for lateral control w.r.t. the planned trajectory. Additional features of the controller are:

  • Control Limiting: The controller limits the control commands to user-defined maximum values for longitudinal acceleration and jerk, as well as curvature, curvature rate, and curvature acceleration for lateral control.
  • Anti-Windup: The controller implements configurable anti-windup mechanisms for the integral term of the PID controller to prevent excessive accumulation of the integral error when the control commands are saturated.
  • Principle of Bi-Level-Stabilization: The controller supports the principle of bi-level-stabilization according to Werling.
  • Velocity-Dependent Gain-Scheduling: PID gains are scheduled based on the current velocity of the vehicle to improve control performance across a wide range of operating conditions.

This controller is designed to be used in the context of the the Open Automated Driving Stack and particularly in combination with the trajectory_optimization.

🚀 Quick Start • 💻 Development • 📝 Documentation

Important

This repository is part of OpenADS, the Open Automated Driving Systems project. OpenADS and its modules have been initiated and are currently being maintained by the Institute for Automotive Engineering (ika) at RWTH Aachen University.

🚀 Quick Start

  1. Start a container of the pre-built runtime image.
    docker run --rm -it ghcr.io/openads-project/ackermann_trajectory_control:latest bash
  2. Inside the container, launch the pre-built node.
    ros2 launch ackermann_trajectory_control ackermann_trajectory_control.launch.py

💻 Development

Set up Development Environment

  1. Clone the repository.
    git clone https://github.com/openads-project/ackermann_trajectory_control.git
  2. Initialize the .openads-dev-environment submodule containing development environment configuration.
    cd ackermann_trajectory_control
    git submodule update --init --recursive
  3. Open the repository in Visual Studio Code.
    code .
  4. Install the recommended VS Code extensions.

    Ctrl+Shift+P / Extensions: Show Recommended Extensions / Install Workspace Recommended Extensions (Cloud Download Icon)

  5. Reopen the repository in a Dev Container.

    Ctrl+Shift+P / Dev Containers: Rebuild and Reopen in Container

Build

Ctrl+Shift+B

colcon build

Run Tests

Ctrl+Shift+P / Tasks: Run Test Task

colcon build --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=1
colcon test
colcon test-result --verbose

📝 Documentation

Package and node interfaces are documented in the respective package READMEs listed below. Implementation details are found in the Source Code Documentation.

Package Description
ackermann_trajectory_control This package contains a trajectory controller for Ackermann-steered vehicles. It is implemented as a ROS 2 C++ node that subscribes to trajectory_planning_msgs/Trajectory and publishes control commands as ackermann_msgs/AckermannDriveStamped.

⚖️ Licensing

The source code in this repository is licensed under Apache-2.0, see LICENSE. Container images provided by this repository may contain third-party software shipped with their own license terms.

🙏 Acknowledgements

Development and maintenance of this repository are supported by the following projects. We acknowledge the funding of the respective institutions.

Project Funding Institution Grant Number
AIthena 🇪🇺 European Union 101076754

Funded by the European Union. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Climate, Infrastructure and Environment Executive Agency (CINEA). Neither the European Union nor CINEA can be held responsible for them.

About

Cascaded ROS 2 PID Controller for Ackermann steered vehicles

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages