1
Fork 0

add static friction feedforward

This commit is contained in:
Andy Killorin 2026-02-05 08:35:43 -05:00
parent 90acef4110
commit ab507bb68a
Signed by: ank
GPG key ID: 23F9463ECB67FE8C

View file

@ -73,6 +73,18 @@ bool Robot::CheckReachedDestination(void)
&& 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)
{
if(robotState == ROBOT_DRIVE_TO_POINT)
@ -100,7 +112,9 @@ void Robot::DriveToPoint(void)
TeleplotPrint("linear_dist", SquareDistance());
#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));
}
}