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

Implementation of a steering and speed controller for a rover with an Ackermann steering mechanism. More...

#include <Controller.hpp>

Public Member Functions

 Controller (const std::shared_ptr< const Params > &params)
 Constructor; constructs and initializes parameters of all composition classes. More...
 
void start ()
 Begin execution of a control loop.
 
void stop (bool block=false)
 Stop execution of a control loop and rejoin. This also calls reset() to clear any state variables. More...
 
void reset ()
 Clear system state variables.
 
bool isRunning () const
 Return true if the core execution thread is running. This is a useful utility for testing. More...
 
void setState (const double speed, const double heading)
 Set the current state (speed, heading) of the system. More...
 
void getState (double &speed, double &heading) const
 Get the current state (speed, heading) of the system; return as parameters specified. More...
 
void setGoal (const double speed, const double heading)
 Set the current system setpoint (speed, heading). More...
 
void getGoal (double &speed, double &heading) const
 Get the current system setpoint (speed, heading); return as parameters specified. More...
 
void getCommand (double &throttle, double &steering) const
 Get the current system command (speed, heading); return as parameters specified. More...
 
void getWheelLinVel (double &left_front, double &right_front, double &left_rear, double &right_rear) const
 Get the current system wheel speeds; return as parameters specified. More...
 

Detailed Description

Implementation of a steering and speed controller for a rover with an Ackermann steering mechanism.

Constructor & Destructor Documentation

◆ Controller()

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

Constructor; constructs and initializes parameters of all composition classes.

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

Member Function Documentation

◆ getCommand()

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

Get the current system command (speed, heading); return as parameters specified.

This represents the main point of access for a polling architecture, i.e. an external control loop would periodically update the controller with the true system state and request command updates.

Parameters
throttleThe latest throttle command (limited between [0,1]).
steeringThe latest steering angle command (rad).

◆ getGoal()

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

Get the current system setpoint (speed, heading); return as parameters specified.

Parameters
headingThe current vehicle heading setpoint (rad).
speedThe current vehicle speed setpoint (m/s).

◆ getState()

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

Get the current state (speed, heading) of the system; return as parameters specified.

Parameters
headingThe estimated vehicle heading (rad).
speedThe estimated vehicle speed (m/s).

◆ getWheelLinVel()

void ackermann::Controller::getWheelLinVel ( double &  left_front,
double &  right_front,
double &  left_rear,
double &  right_rear 
) const

Get the current system wheel speeds; return as parameters specified.

Parameters
left_frontThe left front wheel velocity (m/s).
right_frontThe right front wheel velocity (m/s).
left_rearThe left rear wheel velocity (m/s).
right_rearThe right rear wheel velocity (m/s).

◆ isRunning()

bool ackermann::Controller::isRunning ( ) const

Return true if the core execution thread is running. This is a useful utility for testing.

Returns
: Whether or not the core control loop is executing.

◆ setGoal()

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

Set the current system setpoint (speed, heading).

This sets a new target for our control loop. Expected usage is to call this method before calling 'start', although concurrent execution is supported.

Parameters
headingThe desired vehicle heading (rad).
speedThe desired vehicle speed (m/s).

◆ setState()

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

Set the current state (speed, heading) of the system.

This represents an update from external sensors as to our true system state. If this is not called the controller will continue open loop.

Parameters
headingThe actual vehicle heading (rad)
speedThe actual vehicle speed (m/s).

◆ stop()

void ackermann::Controller::stop ( bool  block = false)

Stop execution of a control loop and rejoin. This also calls reset() to clear any state variables.

@ param block: Optionally wait for any running thread to rejoin. Default false.

Here is the caller graph for this function:

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