}
@Override
+
public void execute() {
TOFAdjustment = SmartDashboard.getNumber("OPERATOR: TOF Adjustment", TOFAdjustment);
SmartDashboard.putNumber("OPERATOR: TOF Adjustment", TOFAdjustment);
hood.setFieldRelativeTarget(Rotation2d.fromDegrees(ShotInterpolation.newHoodMap.get(distanceFromTarget)), hoodVelocity);
double x = drivepose.getX(); // compared as meters
double y = drivepose.getY();
- System.out.println("X: " + Units.metersToInches(x) + "Y: " + Units.metersToInches(y));
if (FieldConstants.underTrench(x, y)) {
hood.forceHoodDown(true);
- System.out.println("Hood forced down");
} else {
hood.forceHoodDown(false);
- System.out.println("Hood forced up");
}
shooter.setShooter(-ShotInterpolation.shooterVelocityMap.get(distanceFromTarget));
Logger.recordOutput("Distance From Target", distanceFromTarget);
* @param setpoint in inches
*/
public void setPosition(double setpoint) {
- double motorRotations = inchesToRotations(setpoint);
+ double motorRotations = -inchesToRotations(setpoint);
rightMotor.setControl(voltageRequest.withPosition(motorRotations));
leftMotor.setControl(voltageRequest.withPosition(motorRotations));
}
} else {
// Sets motor control with feedforward
- motor.setControl(mmVoltageRequest
- .withPosition(motorGoalRotations)
- .withFeedForward(robotTurnCompensation));
+ // motor.setControl(mmVoltageRequest
+ // .withPosition(motorGoalRotations)
+ // .withFeedForward(robotTurnCompensation));
}
Logger.recordOutput("Turret/Voltage", motor.getMotorVoltage().getValue());