Class used to apply known limits to a given desired control signal.
More...
#include <Limits.hpp>
|
| | Limits (const std::shared_ptr< const Params > ¶ms) |
| | Constructor. More...
|
| |
| void | limit (const double current_speed, const double current_steering, const double current_steering_vel, double &desired_throttle, double &desired_steering, double &desired_steering_vel, double dt) const |
| | Apply known limits to the given controller command. More...
|
| |
| double | throttleToSpeed (double throttle) const |
| | Use Parameters structure to convert throttle to speed as a function of maximum allowable speed. More...
|
| |
| double | speedToThrottle (double speed) const |
| | Use Parameters structure to convert speed to throttle as a function of maximum allowable speed. More...
|
| |
| double | shortestArcToTurn (double current_heading, double desired_heading) const |
| | Calculate the direction to minimize turning angle (eg, don't turn 270deg right if you can turn 90deg left. More...
|
| |
| double | boundHeading (const double heading) const |
| | Bound heading to [-pi,pi) range; prevents odd behavior. More...
|
| |
Class used to apply known limits to a given desired control signal.
◆ Limits()
| ackermann::Limits::Limits |
( |
const std::shared_ptr< const Params > & |
params | ) |
|
|
explicit |
Constructor.
- Parameters
-
| params | Shared pointer detailing rover characteristic parameters |
◆ boundHeading()
| double ackermann::Limits::boundHeading |
( |
const double |
heading | ) |
const |
Bound heading to [-pi,pi) range; prevents odd behavior.
- Parameters
-
| current_heading | Current heading in radians |
| desired_heading | Desired heading in radians |
- Returns
- Bound heading in radians
◆ limit()
| void ackermann::Limits::limit |
( |
const double |
current_speed, |
|
|
const double |
current_steering, |
|
|
const double |
current_steering_vel, |
|
|
double & |
desired_throttle, |
|
|
double & |
desired_steering, |
|
|
double & |
desired_steering_vel, |
|
|
double |
dt |
|
) |
| const |
Apply known limits to the given controller command.
Apply known kinematic constraints (velocity, acceleration, angular velocity, angular acceleration) to the given potential commands, and return the limited version. (Return paramaters noted)
- Parameters
-
| current_speed | Current speed in (m/s). |
| current_steering | Current commanded steering angle (rad). |
| desired_thottle | (Return Parameter) Desired throttle (generally [0,1]). |
| desired_steering | (Return Parameter) Desired steering angle (rad). |
| desired_steering_vel | (Return parameter) Desired steering velocity (rad/s). |
| dt | Fixed time step between commands (s). |
◆ shortestArcToTurn()
| double ackermann::Limits::shortestArcToTurn |
( |
double |
current_heading, |
|
|
double |
desired_heading |
|
) |
| const |
Calculate the direction to minimize turning angle (eg, don't turn 270deg right if you can turn 90deg left.
- Parameters
-
| current_heading | Current heading in radians |
| desired_heading | Desired heading in radians |
- Returns
- Angle and direction (+/-) to turn (rad)
◆ speedToThrottle()
| double ackermann::Limits::speedToThrottle |
( |
double |
speed | ) |
const |
Use Parameters structure to convert speed to throttle as a function of maximum allowable speed.
- Parameters
-
| speed | Speed in range of [0,max_speed] |
- Returns
- Throttle position estimate from speed (linear relationship) [0,1]
◆ throttleToSpeed()
| double ackermann::Limits::throttleToSpeed |
( |
double |
throttle | ) |
const |
Use Parameters structure to convert throttle to speed as a function of maximum allowable speed.
- Parameters
-
| throttle | Throttle setting in range of generally [0,1] |
- Returns
- Speed based on throttle input (linear relationship) (m/s)
The documentation for this class was generated from the following files: