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

This class is used to further define a vehicle with Ackermann steering. More...

#include <Model.hpp>

Public Member Functions

 Model (const std::shared_ptr< const Params > &params)
 Constructor. More...
 
void reset ()
 Reset system state variables to defaults.
 
void setState (const double speed, const double heading)
 Set the current system state. More...
 
void getState (double &speed, double &heading) const
 Get the current state estimate; return as parameters specified. More...
 
void setGoal (const double speed, const double heading)
 Set the target setpoint. More...
 
void getGoal (double &speed, double &heading) const
 Get the current setpoint; return as parameters specified. More...
 
void getCommand (double &throttle, double &steering) const
 Get the current commanded throttle and steering angle; return as parameters specified. More...
 
void getCommand (double &throttle, double &steering, double &steer_vel) const
 Get the current commanded throttle and steering angle; return as parameters specified. More...
 
void command (double desired_speed, double steering, const double dt)
 Simulate execution of the given throttle and steering commands. More...
 
void getError (double &speed_error, double &heading_error) const
 Return the current error between desired and setpoint; return as parameters specified. More...
 
void getWheelLinVel (double &wheel_LeftFront, double &wheel_RightFront, double &wheel_LeftRear, double &wheel_RightRear) const
 Return the current linear velocity at each wheel; used for calculating wheel speed with tire information. Return as parameters specified. More...
 

Detailed Description

This class is used to further define a vehicle with Ackermann steering.

Constructor & Destructor Documentation

◆ Model()

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

Constructor.

Parameters
paramsShared pointer detailing rover characteristic parameters
Here is the call graph for this function:

Member Function Documentation

◆ command()

void ackermann::Model::command ( double  desired_speed,
double  steering,
const double  dt 
)

Simulate execution of the given throttle and steering commands.

Parameters
throttleThe commanded throttle ([0,1]).
steeringThe commanded steering angle (rad).
dtThe amount of time to simulate over (s).

◆ getCommand() [1/2]

void ackermann::Model::getCommand ( double &  throttle,
double &  steering 
) const

Get the current commanded throttle and steering angle; return as parameters specified.

Parameters
throttleThe last commanded throttle (limited to [0,1]).
steeringThe last commanded steering angle (rad).

◆ getCommand() [2/2]

void ackermann::Model::getCommand ( double &  throttle,
double &  steering,
double &  steer_vel 
) const

Get the current commanded throttle and steering angle; return as parameters specified.

Parameters
throttleThe last commanded throttle (limited to [0,1]).
steeringThe last commanded steering angle (rad).
steer_velThe current steering angle velocity (rad/s).

◆ getError()

void ackermann::Model::getError ( double &  speed_error,
double &  heading_error 
) const

Return the current error between desired and setpoint; return as parameters specified.

Parameters
speed_errorCurrent speed error (m/s).
heading_errorCurrent heading error (rad).

◆ getGoal()

void ackermann::Model::getGoal ( double &  speed,
double &  heading 
) const

Get the current setpoint; return as parameters specified.

Parameters
speedDesired system speed (m/s).
headingDesired system heading (rad).

◆ getState()

void ackermann::Model::getState ( double &  speed,
double &  heading 
) const

Get the current state estimate; return as parameters specified.

Parameters
speedEstimated system speed (m/s).
headingEstimated system heading (rad).

◆ getWheelLinVel()

void ackermann::Model::getWheelLinVel ( double &  wheel_LeftFront,
double &  wheel_RightFront,
double &  wheel_LeftRear,
double &  wheel_RightRear 
) const

Return the current linear velocity at each wheel; used for calculating wheel speed with tire information. Return as parameters specified.

Parameters
wheel_LeftFront&Left front wheel linear velocity
wheel_RightFront&Right front wheel linear velocity
wheel_LeftRear&Left rear wheel linear velocity
wheel_RightRear&Right rear wheel linear velocity

◆ setGoal()

void ackermann::Model::setGoal ( const double  speed,
const double  heading 
)

Set the target setpoint.

Parameters
speedDesired system speed (m/s).
headingDesired system heading (rad).

◆ setState()

void ackermann::Model::setState ( const double  speed,
const double  heading 
)

Set the current system state.

Parameters
speedActual system speed (m/s)
headingActual system heading (rad).

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