Class SimpleController
Defined in File SimpleController.hpp
Inheritance Relationships
Base Type
public ControllerMethodBase
Class Documentation
A simple path-following controller using PID and look-ahead strategy.
Public Functions
Destructor.
Initializes parameters and PID controllers.
- Throws:
std::runtime_error – on initialization error.
Updates the controller using the given NavState.
- Parameters:
nav_state – Current navigation state, including odometry and planned path.
Protected Functions
Gets the reference pose at look-ahead distance on the path.
- Parameters:
path – The planned path.
look_ahead – Distance to look ahead in meters.
- Returns:
PoseStamped representing the goal reference.
Computes the Euclidean distance between two poses.
- Parameters:
a – First pose.
b – Second pose.
- Returns:
Distance in meters.
Computes the angle between two points.
- Parameters:
from – Start point.
to – End point.
- Returns:
Angle in radians.
Computes the angular difference between two quaternions (yaw).
- Parameters:
a – First quaternion.
b – Second quaternion.
- Returns:
Angle difference in radians within [-π, π].
Protected Attributes
PID controller for linear velocity.
PID controller for angular velocity.
Maximum linear speed in m/s.
Maximum angular speed in rad/s.
Maximum linear acceleration in m/s².
Maximum angular acceleration in rad/s².
Distance ahead of the robot to track in meters.
Distance threshold to switch to orientation tracking.
Gain to reduce linear speed based on angular velocity.
Angular tolerance at the final goal in radians.
Proportional gain for linear PID.
Integral gain for linear PID.
Derivative gain for linear PID.
Proportional gain for angular PID.
Integral gain for angular PID.
Derivative gain for angular PID.
Previous linear velocity for acceleration limiting.
Previous angular velocity for acceleration limiting.
Timestamp of the last control update.
Current velocity command.