Skip to content

Commit 815ef0a

Browse files
committed
bug fix
1 parent d74f656 commit 815ef0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/frc/robot/commands/DriveCommand2.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public void execute() {
158158
Pose2d pose = m_poseSupplier.get();
159159
Translation2d t = m_targetPose.getTranslation().minus(pose.getTranslation());
160160
double speed = m_controllerXY.calculate(t.getNorm());
161-
t = t.times(-speed / t.getNorm()); // translation toward target
161+
t = t.getNorm() > 0 ? t.times(-speed / t.getNorm()) : t; // translation toward target
162162
double speedX = t.getX();
163163
double speedY = t.getY();
164164
// NEGATION needed if the robot rotates clockwise given positive turnSpeed

0 commit comments

Comments
 (0)