Skip to content

Commit

Permalink
changed controller name, formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
AyushSagar16 committed Feb 22, 2024
1 parent d1013a0 commit e1ae9b1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/ghrobotics/frc2024/CANCoderSwerve.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public void configure(boolean inverted) {
MagnetSensorConfigs magnetSensorConfiguration = new MagnetSensorConfigs();
cfg.refresh(magnetSensorConfiguration);
cfg.apply(magnetSensorConfiguration
.withAbsoluteSensorRange(AbsoluteSensorRangeValue.Signed_PlusMinusHalf)
.withSensorDirection(inverted ? SensorDirectionValue.Clockwise_Positive
: SensorDirectionValue.CounterClockwise_Positive));
.withAbsoluteSensorRange(AbsoluteSensorRangeValue.Signed_PlusMinusHalf)
.withSensorDirection(inverted ? SensorDirectionValue.Clockwise_Positive
: SensorDirectionValue.CounterClockwise_Positive));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/ghrobotics/frc2024/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ public class Robot extends TimedRobot {
private final RobotState robot_state_ = new RobotState(drive_);

// Xbox Controller
private final CommandXboxController controller_ = new CommandXboxController(0);
private final CommandXboxController driver_controller_ = new CommandXboxController(0);

@Override
public void robotInit() {
drive_.setDefaultCommand(new DriveTeleop(drive_, robot_state_, controller_));
drive_.setDefaultCommand(new DriveTeleop(drive_, robot_state_, driver_controller_));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public double getDrivePosition() {
// Get Steer Position
public Rotation2d getSteerPosition() {
return new Rotation2d(
Math.IEEEremainder(steer_encoder_.getPosition(), 2 * Math.PI));
Math.IEEEremainder(steer_encoder_.getPosition(), 2 * Math.PI));
}

// Get Module Position
Expand Down Expand Up @@ -121,7 +121,7 @@ public void setAngle(double desired_angle_degs) {

// Set steer angle
double steering_correction = steer_pid_controller_.calculate(
getSteerPosition().getRadians(), desired_angle_rad);
getSteerPosition().getRadians(), desired_angle_rad);
steer_motor_.set(steering_correction);
}

Expand Down

0 comments on commit e1ae9b1

Please sign in to comment.