1
Fork 0

stop on tracking loss

This commit is contained in:
Andy Killorin 2024-10-25 16:33:33 -04:00
parent d3b9bd3ae5
commit dd7ff23be4
Signed by: ank
GPG key ID: 23F9463ECB67FE8C

View file

@ -97,7 +97,7 @@ void Robot::EnterLineFollowing(float speed)
robotState = ROBOT_LINING; robotState = ROBOT_LINING;
} }
int lineLostFrames = 7; int lineLostFrames = 24;
void Robot::LineFollowingUpdate(void) void Robot::LineFollowingUpdate(void)
{ {
@ -129,10 +129,14 @@ void Robot::LineFollowingUpdate(void)
rollingTurnRate = 0; rollingTurnRate = 0;
turnEffort = 0; turnEffort = 0;
speed = 0; speed = 0;
chassis.Stop();
return;
} else {
speed *= 0.97;
} }
} }
else { else {
lineLostFrames = 7; lineLostFrames = 24;
} }
chassis.SetTwist(speed, turnEffort); chassis.SetTwist(speed, turnEffort);