🎮 Nav2 Controllers Extensions#
pal_nav2_controllers
package extends the nav2_controllers
package, providing implementations of controller modules which act as
plugins of the nav2 base class nav2_core::Controller
,
also known as Local Planners.PID Controller#

x
, y
, and theta
error from the given Pose.
Alternatively, this functionality can also be triggered by sending an action goal to the /follow_path.
ros2 action send_goal /follow_path nav2_msgs/action/FollowPath "path:
header:
stamp:
sec: 0
nanosec: 0
frame_id: 'base_footprint'
poses:
- header:
stamp:
sec: 0
nanosec: 0
frame_id: 'base_footprint'
pose:
position:
x: 0.0
y: 0.0
z: 0.0
orientation:
x: 0.0
y: 0.0
z: 0.0
w: 1.0
controller_id: 'TrackPose'
goal_checker_id: ''"
You can set the usage of the PID Controller by setting the controller_id
field to 'TrackPose'
and change the
pose.position
and the pose.orientation
values to the desired pose.
Furthermore, by setting the frame_id
to the base_footprint
, this works as a Cartesian Controller
that moves the robot to a goal expressed relative to its base frame.
In this configuration, it can also be used for Instruction-based Navigation (e.g. move three meters forward,
then turn right).
Obstacle Avoidance#
This controller implements a basic collision detection algorithm that before sending a velocity commands to the robot, simulates its consequences (e.g. where will the robot be after this command). If a collision is detected, the robot is stopped.

Configuration#
Parameter |
Description |
---|---|
|
The time (in seconds) to project the velocity when looking for collisions. |
|
Maximum linear velocity (m/s) allowed by the controller. |
|
Maximum angular velocity (rad/s) allowed by the controller. |
|
Proportional Gain of the PID controller. |
|
Integral Gain of the PID controller. |
|
Derivative Gain of the PID controller. |
|
Whether to enable the antiwindup. |
|
Max Integral error allowed. |
|
Sampling size of the path. Lower values correspond to stricter path following. |
|
Desired motion model used for motion planning. Options are: |
|
Time tolerance for data transformations with TF (in seconds). |
All the parameters above are dynamic, and can be changed at runtime producing a change in the behavior of the controller.