Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import frc.robot.subsystems.drive.GyroIOBoron;
import frc.robot.subsystems.drive.ModuleIO;
import frc.robot.subsystems.drive.ModuleIOSimWPI;
import frc.robot.subsystems.drive.ModuleIOTalonFX;
import frc.robot.subsystems.feeder.Feeder;
import frc.robot.subsystems.feeder.KickerIO;
import frc.robot.subsystems.feeder.KickerIOSimSpark;
Expand All @@ -54,7 +53,6 @@
import frc.robot.subsystems.launcher.TurretIOSpark;
import frc.robot.subsystems.vision.Vision;
import frc.robot.subsystems.vision.VisionIO;
import frc.robot.subsystems.vision.VisionIOPhotonVision;
import frc.robot.subsystems.vision.VisionIOPhotonVisionSim;
import frc.robot.util.CanandgyroThread;
import frc.robot.util.SparkOdometryThread;
Expand Down Expand Up @@ -116,18 +114,22 @@ public Robot() {
drive =
new Drive(
new GyroIOBoron(),
new ModuleIOTalonFX(DriveConstants.FrontLeft),
new ModuleIOTalonFX(DriveConstants.FrontRight),
new ModuleIOTalonFX(DriveConstants.BackLeft),
new ModuleIOTalonFX(DriveConstants.BackRight));
new ModuleIOSimWPI(DriveConstants.FrontLeft),
new ModuleIOSimWPI(DriveConstants.FrontRight),
new ModuleIOSimWPI(DriveConstants.BackLeft),
new ModuleIOSimWPI(DriveConstants.BackRight));
vision =
new Vision(
drive::addVisionMeasurement,
drive::getPose,
new VisionIOPhotonVision(cameraFrontRightName, robotToFrontRightCamera),
new VisionIOPhotonVision(cameraFrontLeftName, robotToFrontLeftCamera),
new VisionIOPhotonVision(cameraBackRightName, robotToBackRightCamera),
new VisionIOPhotonVision(cameraBackLeftName, robotToBackLeftCamera));
new VisionIOPhotonVisionSim(
cameraFrontRightName, robotToFrontRightCamera, drive::getPose),
new VisionIOPhotonVisionSim(
cameraFrontLeftName, robotToFrontLeftCamera, drive::getPose),
new VisionIOPhotonVisionSim(
cameraBackRightName, robotToBackRightCamera, drive::getPose),
new VisionIOPhotonVisionSim(
cameraBackLeftName, robotToBackLeftCamera, drive::getPose));
launcher =
new Launcher(
drive::getPose,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ public static final class TurretConstants {
// Geometry
public static final Transform3d chassisToTurretBase =
new Transform3d(Inches.of(0), Inches.of(10), Inches.of(22), Rotation3d.kZero);
public static final Rotation2d absEncoderOffset = new Rotation2d(0.5);
public static final Rotation2d mechanismOffset = Rotation2d.kCCW_Pi_2;
public static final Rotation2d absEncoderOffset = new Rotation2d(5.3);
public static final Rotation2d mechanismOffset = Rotation2d.k180deg;
public static final Angle rangeOfMotion = Degrees.of(240);

// Position controller
public static final double kPReal = 0.5;

// Motor controller
public static final double motorReduction = 5.0;
public static final double motorReduction = 9.0 * 72.0 / 12.0;
public static final AngularVelocity maxAngularVelocity =
NEO550Constants.kFreeSpeed.div(motorReduction);
public static final double encoderPositionFactor = (2 * Math.PI) / motorReduction; // Radians
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public TurretIOSpark() {
var turnConfig = new SparkMaxConfig();

turnConfig
.inverted(false)
.inverted(true)
.idleMode(IdleMode.kBrake)
.smartCurrentLimit(NEO550Constants.kDefaultSupplyCurrentLimit)
.voltageCompensation(RobotConstants.kNominalVoltage);
Expand Down