Ackermann Controller
Public Member Functions | List of all members
ackermann::Limits Class Reference

Class used to apply known limits to a given desired control signal. More...

#include <Limits.hpp>

Public Member Functions

 Limits (const std::shared_ptr< const Params > &params)
 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...
 

Detailed Description

Class used to apply known limits to a given desired control signal.

Constructor & Destructor Documentation

◆ Limits()

ackermann::Limits::Limits ( const std::shared_ptr< const Params > &  params)
explicit

Constructor.

Parameters
paramsShared pointer detailing rover characteristic parameters

Member Function Documentation

◆ boundHeading()

double ackermann::Limits::boundHeading ( const double  heading) const

Bound heading to [-pi,pi) range; prevents odd behavior.

Parameters
current_headingCurrent heading in radians
desired_headingDesired 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_speedCurrent speed in (m/s).
current_steeringCurrent 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).
dtFixed time step between commands (s).
Here is the call graph for this function:

◆ 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_headingCurrent heading in radians
desired_headingDesired 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
speedSpeed in range of [0,max_speed]
Returns
Throttle position estimate from speed (linear relationship) [0,1]
Here is the caller graph for this function:

◆ throttleToSpeed()

double ackermann::Limits::throttleToSpeed ( double  throttle) const

Use Parameters structure to convert throttle to speed as a function of maximum allowable speed.

Parameters
throttleThrottle setting in range of generally [0,1]
Returns
Speed based on throttle input (linear relationship) (m/s)
Here is the caller graph for this function:

The documentation for this class was generated from the following files: