mirror of
https://github.com/TimeCrafters/CenterStage
synced 2025-12-12 23:32:36 +00:00
inverted logic fixed for the finish in drive to coordinates state
This commit is contained in:
@@ -69,7 +69,7 @@ public class DriveToCoordinatesState extends CyberarmState {
|
||||
|
||||
if (Math.abs(robot.positionX - robot.xTarget) < 5
|
||||
&& Math.abs(robot.positionY - robot.yTarget) < 5
|
||||
&& Math.abs(robot.imu.getRobotYawPitchRollAngles().getYaw(AngleUnit.DEGREES) - Math.toDegrees(robot.hTarget)) > 2) {
|
||||
&& Math.abs(robot.imu.getRobotYawPitchRollAngles().getYaw(AngleUnit.DEGREES) - Math.toDegrees(robot.hTarget)) < 2) {
|
||||
setHasFinished(true);
|
||||
}
|
||||
}
|
||||
@@ -79,7 +79,8 @@ public class DriveToCoordinatesState extends CyberarmState {
|
||||
}
|
||||
|
||||
if (Math.abs(robot.positionX - robot.xTarget) < 5
|
||||
&& Math.abs(robot.positionY - robot.yTarget) < 5) {
|
||||
&& Math.abs(robot.positionY - robot.yTarget) < 5
|
||||
&& Math.abs(robot.imu.getRobotYawPitchRollAngles().getYaw(AngleUnit.DEGREES) - Math.toDegrees(robot.hTarget)) < 2) {
|
||||
setHasFinished(true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user