#include <speed.h>
Public Member Functions | |
virtual void | adjust (float speed, float error, float *brake_req, float *throttle_req) |
virtual void | configure (art_pilot::PilotConfig &newconfig) |
virtual void | reset (void) |
SpeedControlPID () | |
virtual | ~SpeedControlPID () |
Private Attributes | |
boost::shared_ptr< Pid > | brake_pid_ |
bool | braking_ |
boost::shared_ptr< Pid > | throttle_pid_ |
SpeedControlPID::~SpeedControlPID | ( | ) | [virtual] |
void SpeedControlPID::adjust | ( | float | speed, |
float | error, | ||
float * | brake_req, | ||
float * | throttle_req | ||
) | [virtual] |
Adjust speed to match goal.
Generate brake and throttle changes directly from separate PID controllers. Uses a state machine to avoid applying simultaneous brake and throttle.
speed | absolute value of current velocity in m/sec |
error | immediate goal minus speed |
brake_req | -> previous brake request (input), updated brake request (output). |
throttle_req | -> previous throttle request (input), updated throttle request (output). |
Implements SpeedControl.
void SpeedControlPID::configure | ( | art_pilot::PilotConfig & | newconfig | ) | [virtual] |
void SpeedControlPID::reset | ( | void | ) | [virtual] |
boost::shared_ptr<Pid> SpeedControlPID::brake_pid_ [private] |
bool SpeedControlPID::braking_ [private] |
boost::shared_ptr<Pid> SpeedControlPID::throttle_pid_ [private] |