Controller class to handle speed and steering of the buggy.
More...
#include <wheelcontrol.h>
Controller class to handle speed and steering of the buggy.
◆ WheelControl()
WheelControl::WheelControl |
( |
| ) |
|
Constructor.
Construct a new Wheel Control object.
Initializes three PID controllers with default values.
◆ m_setSetPoint()
void WheelControl::m_setSetPoint |
( |
float |
left_val, |
|
|
float |
right_val |
|
) |
| |
|
private |
◆ m_setProcessValue()
void WheelControl::m_setProcessValue |
( |
float |
left_val, |
|
|
float |
right_val |
|
) |
| |
|
private |
◆ setSpeedController()
void WheelControl::setSpeedController |
( |
float |
Kc, |
|
|
float |
tauI, |
|
|
float |
tauD |
|
) |
| |
Set the speed controller tuning parameters.
- Parameters
-
Kc | Propotional gain. |
tauI | Integral gain. |
tauD | Derivative gain. |
◆ setLineController()
void WheelControl::setLineController |
( |
float |
Kc, |
|
|
float |
tauI, |
|
|
float |
tauD |
|
) |
| |
Set the line controller tuning parameters.
- Parameters
-
Kc | Propotional gain. |
tauI | Integral gain. |
tauD | Derivative gain. |
◆ setLineLimits()
void WheelControl::setLineLimits |
( |
float |
low, |
|
|
float |
high |
|
) |
| |
Set the line controller input limits.
- Parameters
-
low | Minimum input value. |
high | Maximum input value. |
◆ setPWMLimits()
void WheelControl::setPWMLimits |
( |
float |
low, |
|
|
float |
high |
|
) |
| |
Set the PWM controller output limits.
- Parameters
-
low | Minimum output value. |
high | Maximum output value. |
◆ setTargetSpeed()
void WheelControl::setTargetSpeed |
( |
float |
speed | ) |
|
Set the target speed in m/s.
- Parameters
-
speed | Target speed in m/s. |
◆ reset()
void WheelControl::reset |
( |
| ) |
|
Reset the PID controllers to initial state.
◆ computeSpeed()
vector< pif > WheelControl::computeSpeed |
( |
float |
position, |
|
|
const Encoder & |
left_encoder, |
|
|
const Encoder & |
right_encoder |
|
) |
| |
Compute the speed in pps for the left and right motors.
- Parameters
-
position | Position of the white line in milimetres. |
left_encoder | Left encoder. |
right_encoder | Right encoder. |
- Returns
- vector<pif> Vector of pair of direction, PWM outputs for left and right motor.
◆ m_leftcontroller
PID WheelControl::m_leftcontroller |
|
private |
PID controller for left speed.
◆ m_rightcontroller
PID WheelControl::m_rightcontroller |
|
private |
PID controller for right speed.
◆ m_linecontroller
PID WheelControl::m_linecontroller |
|
private |
PID controller for line position.
◆ m_target
float WheelControl::m_target |
|
private |
The documentation for this class was generated from the following file: