Skip to content

Commit

Permalink
correct angle controller
Browse files Browse the repository at this point in the history
  • Loading branch information
Keobkeig committed Apr 4, 2024
1 parent e204606 commit 458ca15
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,17 @@ public void periodic() {
}
else {
driveMotor.setVoltage(driveController.calculate(targetState.speedMetersPerSecond));
turnMotor.setVoltage(turnController.calculate(getAngle().getRadians(), targetState.angle.getRadians()));
turnMotor.setVoltage(turnController.calculate(getAngle().getDegrees(), targetState.angle.getDegrees()));
}

SmartDashboard.putNumber(id + "/Drive Current", driveMotor.getOutputCurrent());
SmartDashboard.putNumber(id + "/Drive Position", driveEncoder.getPosition());
SmartDashboard.putNumber(id + "/Drive Voltage", driveMotor.getBusVoltage());
SmartDashboard.putNumber(id + "/Turn Voltage", turnMotor.getBusVoltage());
SmartDashboard.putNumber(id + "/Turn Current", turnMotor.getOutputCurrent());
SmartDashboard.putNumber(id + "/Raw Encoder Angle", Units.rotationsToDegrees(turnEnoder.getAbsolutePosition().getValueAsDouble()));
SmartDashboard.putNumber(id + "/Target Angle", Units.rotationsToDegrees(targetState.angle.getRadians()));
SmartDashboard.putNumber(id + "/Target Speed", targetState.speedMetersPerSecond);
SmartDashboard.putNumber(getID() + "/Drive Current", driveMotor.getOutputCurrent());
SmartDashboard.putNumber(getID() + "/Drive Position", driveEncoder.getPosition());
SmartDashboard.putNumber(getID() + "/Drive Voltage", driveMotor.getBusVoltage());
SmartDashboard.putNumber(getID() + "/Turn Voltage", turnMotor.getBusVoltage());
SmartDashboard.putNumber(getID() + "/Turn Current", turnMotor.getOutputCurrent());
SmartDashboard.putNumber(getID() + "/Raw Encoder Angle", Units.rotationsToDegrees(turnEnoder.getAbsolutePosition().getValueAsDouble()));
SmartDashboard.putNumber(getID() + "/Target Angle", Units.rotationsToDegrees(targetState.angle.getRadians()));
SmartDashboard.putNumber(getID() + "/Target Speed", targetState.speedMetersPerSecond);

}
}

0 comments on commit 458ca15

Please sign in to comment.