We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d74f656 commit 815ef0aCopy full SHA for 815ef0a
src/main/java/frc/robot/commands/DriveCommand2.java
@@ -158,7 +158,7 @@ public void execute() {
158
Pose2d pose = m_poseSupplier.get();
159
Translation2d t = m_targetPose.getTranslation().minus(pose.getTranslation());
160
double speed = m_controllerXY.calculate(t.getNorm());
161
- t = t.times(-speed / t.getNorm()); // translation toward target
+ t = t.getNorm() > 0 ? t.times(-speed / t.getNorm()) : t; // translation toward target
162
double speedX = t.getX();
163
double speedY = t.getY();
164
// NEGATION needed if the robot rotates clockwise given positive turnSpeed
0 commit comments