Skip to content

Commit

Permalink
Fix invert for motor and swerve
Browse files Browse the repository at this point in the history
  • Loading branch information
Blue-Flag-666 committed Sep 14, 2024
1 parent 0eed7da commit 6b3758b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/java/frc/libzodiac
5 changes: 3 additions & 2 deletions src/main/java/frc/robot/Commands/Auto.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import java.util.Queue;

public class Auto extends ZCommand {
public static final AutoCommand Fallback = new AutoCommand() {
public static final AutoCommand Default = new AutoCommand() {
@Override
public AutoCommand init() {
commands.clear();
Expand Down Expand Up @@ -45,8 +45,9 @@ public AutoCommand init() {
private static AutoCommand command;
private static Chassis chassis;

public Auto(RobotContainer robot) {
public Auto(RobotContainer robot, AutoCommand cmd) {
chassis = require(robot.chassis);
command = cmd;
}

private static boolean go_pos(Vec2D pos, double yaw) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class RobotContainer {
public final Zamera camera = new Zamera();
public final Xbox driver = new Xbox(0);
public final Xbox controller = new Xbox(1);
public final Auto auto = new Auto(this); // todo: change command
public final Auto auto = new Auto(this, Auto.Default); // todo: change command


/**
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/frc/robot/Subsystems/Chassis.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

public class Chassis extends Zwerve {
// TODO: Swerve zero position
private static final TalonFXSwerve front_left = new TalonFXSwerve(5, 1, 9, 3581);
private static final TalonFXSwerve front_right = new TalonFXSwerve(8, 4, 12, 1921);
private static final TalonFXSwerve rear_left = new TalonFXSwerve(6, 2, 10, 408);
private static final TalonFXSwerve rear_right = new TalonFXSwerve(7, 3, 11, 149);
private static final TalonFXSwerve front_left = new TalonFXSwerve(5, 1, 9, 3581).invert(false, true);
private static final TalonFXSwerve front_right = new TalonFXSwerve(8, 4, 12, 1921).invert(false, false);
private static final TalonFXSwerve rear_left = new TalonFXSwerve(6, 2, 10, 408).invert(true, true);
private static final TalonFXSwerve rear_right = new TalonFXSwerve(7, 3, 11, 149).invert(true, true);

private static final Pigeon gyro = new Pigeon(0);

Expand Down

0 comments on commit 6b3758b

Please sign in to comment.