Implementation of a steering and speed controller for a rover with an Ackermann steering mechanism.
More...
#include <Controller.hpp>
|
| | Controller (const std::shared_ptr< const Params > ¶ms) |
| | 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...
|
| |
Implementation of a steering and speed controller for a rover with an Ackermann steering mechanism.
◆ Controller()
| ackermann::Controller::Controller |
( |
const std::shared_ptr< const Params > & |
params | ) |
|
|
explicit |
Constructor; constructs and initializes parameters of all composition classes.
- Parameters
-
| params | Shared pointer detailing rover characteristic parameters |
◆ 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
-
| throttle | The latest throttle command (limited between [0,1]). |
| steering | The 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
-
| heading | The current vehicle heading setpoint (rad). |
| speed | The 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
-
| heading | The estimated vehicle heading (rad). |
| speed | The 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_front | The left front wheel velocity (m/s). |
| right_front | The right front wheel velocity (m/s). |
| left_rear | The left rear wheel velocity (m/s). |
| right_rear | The 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
-
| heading | The desired vehicle heading (rad). |
| speed | The 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
-
| heading | The actual vehicle heading (rad) |
| speed | The 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.
The documentation for this class was generated from the following files: