add static friction feedforward
This commit is contained in:
parent
90acef4110
commit
ab507bb68a
1 changed files with 15 additions and 1 deletions
|
|
@ -73,6 +73,18 @@ bool Robot::CheckReachedDestination(void)
|
||||||
&& RadError(currPose.theta, destPose.theta) < TARGET_RAD_ERR;
|
&& RadError(currPose.theta, destPose.theta) < TARGET_RAD_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float boost(float input, float boost) {
|
||||||
|
if (input == 0.0) {
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
if (input > 0.0) {
|
||||||
|
input += boost;
|
||||||
|
} else {
|
||||||
|
input -= boost;
|
||||||
|
}
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
void Robot::DriveToPoint(void)
|
void Robot::DriveToPoint(void)
|
||||||
{
|
{
|
||||||
if(robotState == ROBOT_DRIVE_TO_POINT)
|
if(robotState == ROBOT_DRIVE_TO_POINT)
|
||||||
|
|
@ -100,7 +112,9 @@ void Robot::DriveToPoint(void)
|
||||||
TeleplotPrint("linear_dist", SquareDistance());
|
TeleplotPrint("linear_dist", SquareDistance());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
chassis.SetMotorEfforts(forward_effort - turn_effort, forward_effort + turn_effort);
|
//chassis.SetMotorEfforts(20, 20);
|
||||||
|
float boost_f = 15.0;
|
||||||
|
chassis.SetMotorEfforts(boost(forward_effort - turn_effort,boost_f), boost(forward_effort + turn_effort, boost_f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue