public default void updateInputs(GyroIOInputs inputs) {}
+ /** returns the yaw status signal for time-synced odometry. */
+ public default StatusSignal<?> getYawSignal() { return null; }
++
+ /**
+ * set the yaw angle of the gyro.
+ *
+ * @param rotation the new yaw angle
+ */
+ public default void setYaw(Rotation2d rotation) {}
}
}
if (isOpenLoop) {
double percentOutput = desiredState.speedMetersPerSecond / DriveConstants.MAX_SPEED;
- driveMotor.set(percentOutput);
+ driveMotor.setControl(new DutyCycleOut(percentOutput).withEnableFOC(true));
} else {
double velocity = desiredState.speedMetersPerSecond/DriveConstants.WHEEL_RADIUS/2/Math.PI*DriveConstants.DRIVE_GEAR_RATIO;
- Logger.recordOutput("desired vel" + moduleConstants.ordinal(), velocity);
+ if (!Constants.DISABLE_LOGGING) {
+ Logger.recordOutput("desired vel" + moduleConstants.ordinal(), velocity);
+ }
double feedforward = velocity * moduleConstants.getDriveV();
driveMotor.setControl(
return inputs.odometryTimestamps;
}
- }
+ /** returns the drive position status signal for time-synced odometry. */
+ public StatusSignal<Angle> getDrivePositionSignal() {
+ return drivePosition;
+ }
+
+ /** returns the turn position status signal for time-synced odometry. */
+ public StatusSignal<Angle> getTurnPositionSignal() {
+ return turnPosition;
+ }
+
+ /** returns the turn absolute position status signal for time-synced odometry. */
+ public StatusSignal<Angle> getTurnAbsolutePositionSignal() {
+ return turnAbsolutePosition;
+ }
+
+ public TalonFX[] getMotors() {
+ return new TalonFX[]{angleMotor, driveMotor};
+ }
+ }