#include <pid.h>
List of all members.
Public Member Functions |
bool | init (const ros::NodeHandle &nh) |
| initialize gain settings from ROS parameter values
|
| PID (double p, double i, double d, double i_max, double i_min) |
| Constructor.
|
| PID () |
| Constructor. Starts all gains and limits at zero.
|
void | reset () |
| Reset integral wind-up term.
|
double | update (double error, double dt) |
| Run PID calculation and return control result.
|
double | update (double error, double error_dot, double dt) |
| Run PID calculation and return control result.
|
Protected Member Functions |
bool | checkGains () |
| Checks and fixes gain settings.
|
Protected Attributes |
double | d_gain_ |
| derivative gain
|
double | error_last_ |
| Last error value, used for calculating error_dot when not provided.
|
double | i_gain_ |
| integral gain
|
double | i_max_ |
| integral gain min and max limits
|
double | i_min_ |
double | i_term_ |
| integral wind-up term
|
double | p_gain_ |
| proportial gain
|
Detailed Description
Definition at line 45 of file pid.h.
Constructor & Destructor Documentation
Constructor.
- Parameters:
-
p | proportional gain |
i | integral gain |
d | derivative gain |
i_max | integral wind-up max value |
i_min | integral wind-up min value |
Definition at line 47 of file pid.cpp.
Constructor. Starts all gains and limits at zero.
Definition at line 58 of file pid.cpp.
Member Function Documentation
Checks and fixes gain settings.
- Returns:
- true is gains are ok, false if gains are invalid
Definition at line 92 of file pid.cpp.
initialize gain settings from ROS parameter values
Definition at line 68 of file pid.cpp.
Reset integral wind-up term.
Definition at line 140 of file pid.cpp.
Run PID calculation and return control result.
- Parameters:
-
error | error term (goal-actual) |
dt | timestep used for calculating derivative term and integral windup |
- Returns:
- calculated PID command
PID derivate term is calculated from change in error value and dt
Definition at line 146 of file pid.cpp.
Run PID calculation and return control result.
- Parameters:
-
error | error term (goal-actual) |
error_dot | value that is used for derivative term calculation |
dt | timestep used for integral windup |
- Returns:
- calculated PID command
Definition at line 164 of file pid.cpp.
Member Data Documentation
derivative gain
Definition at line 99 of file pid.h.
Last error value, used for calculating error_dot when not provided.
Definition at line 107 of file pid.h.
integral gain
Definition at line 97 of file pid.h.
integral gain min and max limits
Definition at line 101 of file pid.h.
integral wind-up term
Definition at line 104 of file pid.h.
proportial gain
Definition at line 95 of file pid.h.
The documentation for this class was generated from the following files: