From 6b3758bee0666ff761bc2ba579d24d880df3466c Mon Sep 17 00:00:00 2001 From: Blue-Flag-666 <64064866+Blue-Flag-666@users.noreply.github.com> Date: Sun, 15 Sep 2024 02:08:55 +0800 Subject: [PATCH] Fix invert for motor and swerve --- src/main/java/frc/libzodiac | 2 +- src/main/java/frc/robot/Commands/Auto.java | 5 +++-- src/main/java/frc/robot/RobotContainer.java | 2 +- src/main/java/frc/robot/Subsystems/Chassis.java | 8 ++++---- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/frc/libzodiac b/src/main/java/frc/libzodiac index 5d56aae..98a02c6 160000 --- a/src/main/java/frc/libzodiac +++ b/src/main/java/frc/libzodiac @@ -1 +1 @@ -Subproject commit 5d56aae472a521120c581cc29ec6752914d54507 +Subproject commit 98a02c60b003dd19ef4020bed938ec202fb9db81 diff --git a/src/main/java/frc/robot/Commands/Auto.java b/src/main/java/frc/robot/Commands/Auto.java index 93a53e5..9e3f5f9 100644 --- a/src/main/java/frc/robot/Commands/Auto.java +++ b/src/main/java/frc/robot/Commands/Auto.java @@ -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(); @@ -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) { diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 16dd2fc..73891c9 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -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 /** diff --git a/src/main/java/frc/robot/Subsystems/Chassis.java b/src/main/java/frc/robot/Subsystems/Chassis.java index 62c8526..617b50c 100644 --- a/src/main/java/frc/robot/Subsystems/Chassis.java +++ b/src/main/java/frc/robot/Subsystems/Chassis.java @@ -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);