Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…Code2024 into sofie-arm
  • Loading branch information
stwiggy committed Mar 3, 2024
2 parents 8d7ea0c + dc02eae commit 9535134
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
11 changes: 3 additions & 8 deletions src/main/java/org/carlmontrobotics/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,14 @@ public static final class Drivetrain {

public static final class Arm {

//ports
//config for motors (inverted, encoder offset, etc)
//goal positions
//feedforward, pid, trapezoid constants
//Boundaries (arm cannot go beyond certain angles)
//Controller buttons should go in OI not Arm


//Motor port
public static final int ARM_MOTOR_PORT_MASTER = 7;
public final static int ARM_MOTOR_PORT_FOLLOWER = 8;
//Config for motors
public static final boolean MOTOR_INVERTED_1 = true; //Todo: find all these (they are definetely wrong)
public static final boolean MOTOR_INVERTED_2 = false;
public static final boolean MOTOR_INVERTED_MASTER = true; //Todo: find all these (they are definetely wrong)
public static final boolean MOTOR_INVERTED_FOLLOWER = false;
public static final double ROTATION_TO_RAD = 2 * Math.PI;
public static final boolean ENCODER_INVERTED = false;
public static final double ARM_TELEOP_MAX_GOAL_DIFF_FROM_CURRENT_RAD = 0; //placeholder
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/carlmontrobotics/subsystems/Arm.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ public class Arm extends SubsystemBase {

public Arm() {
// weird math stuff
armMotorMaster.setInverted(MOTOR_INVERTED_1);
armMotorMaster.setInverted(MOTOR_INVERTED_MASTER);
armMotorMaster.setIdleMode(IdleMode.kBrake);
armMotorFollower.setInverted(MOTOR_INVERTED_2);
armMotorFollower.setInverted(MOTOR_INVERTED_FOLLOWER);
armMotorFollower.setIdleMode(IdleMode.kBrake);

armMasterEncoder.setPositionConversionFactor(ROTATION_TO_RAD);
Expand Down Expand Up @@ -192,7 +192,7 @@ public void resetGoal() {
}
public void driveMotor(Measure<Voltage> volts) {
armMotorMaster.setVoltage(volts.in(Volts));
armMotorFollower.setVoltage(volts.in(Volts));

}
public void logMotor(SysIdRoutineLog log) {
log.motor("armMotorMaster")
Expand Down

0 comments on commit 9535134

Please sign in to comment.