Skip to content

Commit

Permalink
Idk abt this
Browse files Browse the repository at this point in the history
  • Loading branch information
GreenTomato5 committed Nov 15, 2024
1 parent b59243b commit 76140c1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@

package frc.robot;

import org.littletonrobotics.conduit.ConduitApi;
import org.littletonrobotics.junction.LoggedRobot;
import org.littletonrobotics.junction.Logger;
import org.littletonrobotics.junction.inputs.LoggedDriverStation;
import org.littletonrobotics.junction.inputs.LoggedSystemStats;
import org.littletonrobotics.junction.networktables.NT4Publisher;

import com.ctre.phoenix6.hardware.TalonFX;
Expand Down Expand Up @@ -70,5 +73,12 @@ public void simulationInit() {

@Override
public void simulationPeriodic() {
refreshAkitData();
}

private void refreshAkitData() {
ConduitApi.getInstance().captureData();
LoggedDriverStation.periodic();
LoggedSystemStats.periodic();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public SwerveAbsoluteEncoderIOCANcoder(int ID, double encoderOffset) {
// .withSensorDirection(SensorDirectionValue.CounterClockwise_Positive)
// );
// configurator.apply(magnetSensorConfiguration.withMagnetOffset(encoderOffset/360));
// CaNcoder.getConfigurator().withSensorDirection(getS)

}

Expand All @@ -52,7 +53,7 @@ public void updateInputs(SwerveAbsoluteEncoderIOInputs inputs) {

inputs.absoluteEncoderOffset = absoluteEncoderOffset;
inputs.inverted = inverted;
inputs.turnAbsolutePosition = MathUtil.angleModulus(Units.degreesToRadians(CaNcoder.getAbsolutePosition().getValueAsDouble() * 360 + absoluteEncoderOffset));
inputs.turnAbsolutePosition = MathUtil.angleModulus(Units.degreesToRadians((CaNcoder.getAbsolutePosition().getValueAsDouble() * 360) + absoluteEncoderOffset));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public SwerveMotorIOTalonFX(int canID, String canbus, double gearRatio) {
feedbackController = new PIDController(0, 0, 0);

FeedbackConfigs feedback = new FeedbackConfigs();
feedback.SensorToMechanismRatio = 1;
configurator.apply(feedback);

timestampQueue = OdometryThread.getInstance().makeTimestampQueue();
Expand Down

0 comments on commit 76140c1

Please sign in to comment.