Repository Summary
| Description | PID controller following a moving carrot |
| Checkout URI | https://github.com/nobleo/tracking_pid.git |
| VCS Type | git |
| VCS Version | master |
| Last Updated | 2025-05-27 |
| Dev Status | UNKNOWN |
| Released | UNRELEASED |
| Tags | No category tags. |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| tracking_pid | 2.2.0 |
README
Tracking_pid
Overview
Tracking PID offers a tuneable PID control loop to accurately follow a trajectory. An interpolator moves a goal over a
nav_msgs/Path
with a tuneable velocity, and a separate node tracks the given point.
One of the tracking options uses a carrot of length l in front of the robot to determine the velocity commands based on the lateral and longitudinal error between current Global Point (GP) and the Control point (CP):
![]()
If a smooth path is provided, the controller has the option to track the path with the base_link directly instead of lagging behind a carrot. In this case a Projected Global Point (PGP) is computed as well which is tracked by the CP. In this mode, the yaw error can also be used as control input.
![]()
The PID contains three loops: Longitudinal, lateral and angular loops.
Keywords: tracking, pid, local_planner, trajectory
License
Apache 2.0
Author: Michiel Franke, Cesar Lopez
Maintainer: Cesar Lopez, cesar.lopez@nobleo.nl.
Affiliation: Nobleo Projects
The tracking_pid package has been tested under [ROS] Melodic and Ubuntu 18.04.
Installation
Building from Source
Dependencies
- Robot Operating System (ROS) (middleware for robotics),
Building
To build from source, clone the latest version from this repository into your catkin workspace and compile the package using
cd catkin_workspace/src
git clone https://github.com/nobleo/tracking_pid.git
cd ../
catkin_make
Unit Tests
All tests can be run using:
catkin build tracking_pid --catkin-make-args run_tests
test_controller
Unit test that checks basic tracking functionality of the controller alone
test_interpolator
Unit test that checks interpolation between two poses
test_tracking_pid.test
Ros system test that checks that interpolator + controller drives a robot to track a given path
Usage
Run the main node:
roslaunch tracking_pid test_tracking_pid.test rviz:=true
Or run the tracking node together with a Coverage Path Planner
roslaunch tracking_pid test_tracking_pid_cpp.launch
Both of these depend on:
mobile_robot_simulator that integrates /cmd_vel into a /base_link TF-frame and an odometry publisher
tracking_pid test_tracking_pid_local_planner_cpp.launch depends on:
full_coverage_path_planner for CPP global planner
Configuring in RQT
Tracking_pid parameters are all available through (rqt_)dynamic_reconfigure. The main parameters are:
-
l(float, default:0.5); Following distance from robot’s rotational point to trajectory. Set negative to track backwards.
Proportional, Integral and Derivative actions for the three loops: Longitudinal, lateral and angular loops.
-
Kp_(loop_name)(float); Proportional action gain for loop ‘loop_name’ -
Ki_(loop_name)(float); Integral action gain for loop ‘loop_name’ -
Kd_(loop_name)(float); Derivative action gain for loop ‘loop_name’
File truncated at 100 lines see the full file