mirror of
https://github.com/nasa/trick.git
synced 2025-02-21 01:31:25 +00:00
Implement PIDController to Wheelbot (#1023)
This commit is contained in:
parent
eaeb8118b1
commit
07030127f9
@ -45,20 +45,20 @@ double PIDController::getOutput(double setpoint_value, double measured_value) {
|
||||
// Sign Check
|
||||
bool same_sign;
|
||||
if ((error * output) > 0.0) {
|
||||
same_sign = 1;
|
||||
same_sign = true;
|
||||
} else {
|
||||
same_sign = 0;
|
||||
same_sign = false;
|
||||
}
|
||||
|
||||
//Saturation Check
|
||||
bool output_limited;
|
||||
bool output_limited = false;
|
||||
if (output > out_max) {
|
||||
output = out_max;
|
||||
output_limited = 1;
|
||||
output_limited = true;
|
||||
}
|
||||
if (output < out_min) {
|
||||
output = out_min;
|
||||
output_limited = 1;
|
||||
output_limited = true;
|
||||
}
|
||||
|
||||
//AND Gate Check
|
||||
|
@ -27,10 +27,10 @@ DifferentialDriveController::
|
||||
desiredHeadingRate(0.0),
|
||||
|
||||
// PID Controller Initialization
|
||||
headingctrl(PIDController(1.0, 0.08, 0.5, headingRateLimit,
|
||||
-headingRateLimit, 0.1, 0.1)),
|
||||
wheelspeedctrl(PIDController(1.0, 0.082, 0.5, wheelSpeedLimit,
|
||||
-wheelSpeedLimit, 0.1, 0.1))
|
||||
headingctrl(1.0, 0.08, 0.5, headingRateLimit,
|
||||
-headingRateLimit, 0.1, 0.1),
|
||||
wheelspeedctrl(1.0, 0.082, 0.5, wheelSpeedLimit,
|
||||
-wheelSpeedLimit, 0.1, 0.1)
|
||||
{ }
|
||||
|
||||
void DifferentialDriveController::stop() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user