Changes from 1/18 meeting and a bug fix that will probably invert controls again, but should resolve issues with robot oriented control
This commit is contained in:
parent
6f9f53011e
commit
385f606ed0
@ -9,9 +9,6 @@
|
|||||||
"Publishers": {
|
"Publishers": {
|
||||||
"open": true
|
"open": true
|
||||||
},
|
},
|
||||||
"Subscribers": {
|
|
||||||
"open": true
|
|
||||||
},
|
|
||||||
"open": true
|
"open": true
|
||||||
},
|
},
|
||||||
"retained": {
|
"retained": {
|
||||||
|
@ -30,7 +30,7 @@ public class RobotContainer {
|
|||||||
private Drivetrain drivetrain;
|
private Drivetrain drivetrain;
|
||||||
|
|
||||||
private CommandXboxController primary;
|
private CommandXboxController primary;
|
||||||
private CommandXboxController secondary;
|
//private CommandXboxController secondary;
|
||||||
|
|
||||||
private Trigger isTeleopTrigger;
|
private Trigger isTeleopTrigger;
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ public class RobotContainer {
|
|||||||
autoChooser = AutoBuilder.buildAutoChooser();
|
autoChooser = AutoBuilder.buildAutoChooser();
|
||||||
|
|
||||||
primary = new CommandXboxController(OIConstants.kPrimaryXboxUSB);
|
primary = new CommandXboxController(OIConstants.kPrimaryXboxUSB);
|
||||||
secondary = new CommandXboxController(OIConstants.kSecondaryXboxUSB);
|
//secondary = new CommandXboxController(OIConstants.kSecondaryXboxUSB);
|
||||||
|
|
||||||
isTeleopTrigger = new Trigger(DriverStation::isTeleopEnabled);
|
isTeleopTrigger = new Trigger(DriverStation::isTeleopEnabled);
|
||||||
|
|
||||||
@ -89,8 +89,8 @@ public class RobotContainer {
|
|||||||
|
|
||||||
drivetrain.setDefaultCommand(
|
drivetrain.setDefaultCommand(
|
||||||
drivetrain.teleopCommand(
|
drivetrain.teleopCommand(
|
||||||
primary::getLeftX,
|
|
||||||
primary::getLeftY,
|
primary::getLeftY,
|
||||||
|
primary::getLeftX,
|
||||||
primary::getRightX,
|
primary::getRightX,
|
||||||
OIConstants.kTeleopDriveDeadband
|
OIConstants.kTeleopDriveDeadband
|
||||||
)
|
)
|
||||||
@ -98,8 +98,8 @@ public class RobotContainer {
|
|||||||
|
|
||||||
primary.povCenter().onFalse(
|
primary.povCenter().onFalse(
|
||||||
drivetrain.driveCardinal(
|
drivetrain.driveCardinal(
|
||||||
primary::getLeftX,
|
primary::getLeftY,
|
||||||
primary::getLeftY,
|
primary::getLeftX,
|
||||||
primary.getHID()::getPOV,
|
primary.getHID()::getPOV,
|
||||||
OIConstants.kTeleopDriveDeadband).until(
|
OIConstants.kTeleopDriveDeadband).until(
|
||||||
() -> MathUtil.applyDeadband(primary.getRightX(), OIConstants.kTeleopDriveDeadband) != 0
|
() -> MathUtil.applyDeadband(primary.getRightX(), OIConstants.kTeleopDriveDeadband) != 0
|
||||||
@ -109,8 +109,8 @@ public class RobotContainer {
|
|||||||
// Lock on to the appropriate Amp AprilTag while still being able to strafe and drive forward and back
|
// Lock on to the appropriate Amp AprilTag while still being able to strafe and drive forward and back
|
||||||
primary.a().onTrue(
|
primary.a().onTrue(
|
||||||
drivetrain.driveAprilTagLock(
|
drivetrain.driveAprilTagLock(
|
||||||
primary::getLeftX,
|
|
||||||
primary::getLeftY,
|
primary::getLeftY,
|
||||||
|
primary::getLeftX,
|
||||||
OIConstants.kTeleopDriveDeadband,
|
OIConstants.kTeleopDriveDeadband,
|
||||||
ampTagID
|
ampTagID
|
||||||
).until(
|
).until(
|
||||||
@ -121,8 +121,8 @@ public class RobotContainer {
|
|||||||
// Lock on to the appropriate Source AprilTag while still being able to strafe and drive forward and back
|
// Lock on to the appropriate Source AprilTag while still being able to strafe and drive forward and back
|
||||||
primary.b().onTrue(
|
primary.b().onTrue(
|
||||||
drivetrain.driveAprilTagLock(
|
drivetrain.driveAprilTagLock(
|
||||||
primary::getLeftX,
|
|
||||||
primary::getLeftY,
|
primary::getLeftY,
|
||||||
|
primary::getLeftX,
|
||||||
OIConstants.kTeleopDriveDeadband,
|
OIConstants.kTeleopDriveDeadband,
|
||||||
sourceTagID
|
sourceTagID
|
||||||
).until(
|
).until(
|
||||||
@ -133,8 +133,8 @@ public class RobotContainer {
|
|||||||
// Lock on to the appropriate Speaker AprilTag while still being able to strafe and drive forward and back
|
// Lock on to the appropriate Speaker AprilTag while still being able to strafe and drive forward and back
|
||||||
primary.x().onTrue(
|
primary.x().onTrue(
|
||||||
drivetrain.driveAprilTagLock(
|
drivetrain.driveAprilTagLock(
|
||||||
primary::getLeftX,
|
|
||||||
primary::getLeftY,
|
primary::getLeftY,
|
||||||
|
primary::getLeftX,
|
||||||
OIConstants.kTeleopDriveDeadband,
|
OIConstants.kTeleopDriveDeadband,
|
||||||
speakerTag
|
speakerTag
|
||||||
).until(
|
).until(
|
||||||
|
@ -20,12 +20,11 @@ public final class AutoConstants {
|
|||||||
public static final double kPHeadingController = 0.02; // for heading control NOT PATHING
|
public static final double kPHeadingController = 0.02; // for heading control NOT PATHING
|
||||||
public static final double kDHeadingController = 0.0025;
|
public static final double kDHeadingController = 0.0025;
|
||||||
|
|
||||||
// TODO Is the robot module radius correct?
|
|
||||||
public static final HolonomicPathFollowerConfig kPFConfig = new HolonomicPathFollowerConfig(
|
public static final HolonomicPathFollowerConfig kPFConfig = new HolonomicPathFollowerConfig(
|
||||||
new PIDConstants(kPXController),
|
new PIDConstants(kPXController),
|
||||||
new PIDConstants(kPThetaController),
|
new PIDConstants(kPThetaController),
|
||||||
kMaxSpeedMetersPerSecond,
|
kMaxSpeedMetersPerSecond,
|
||||||
Units.inchesToMeters(36.77),
|
Units.inchesToMeters(34.65),
|
||||||
new ReplanningConfig()
|
new ReplanningConfig()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -15,11 +15,9 @@ public final class DrivetrainConstants {
|
|||||||
public static final double kRotationalSlewRate = 4.0; // percent per second (1 = 100%)
|
public static final double kRotationalSlewRate = 4.0; // percent per second (1 = 100%)
|
||||||
|
|
||||||
// Chassis configuration
|
// Chassis configuration
|
||||||
// TODO Update track width
|
public static final double kTrackWidth = Units.inchesToMeters(28-1.75*2);
|
||||||
public static final double kTrackWidth = Units.inchesToMeters(26.5-1.75*2);
|
|
||||||
// Distance between centers of right and left wheels on robot
|
// Distance between centers of right and left wheels on robot
|
||||||
// TODO Update wheel base
|
public static final double kWheelBase = Units.inchesToMeters(28-1.75*2);
|
||||||
public static final double kWheelBase = Units.inchesToMeters(32.3-1.75*2);
|
|
||||||
// Distance between front and back wheels on robot
|
// Distance between front and back wheels on robot
|
||||||
public static final SwerveDriveKinematics kDriveKinematics = new SwerveDriveKinematics(
|
public static final SwerveDriveKinematics kDriveKinematics = new SwerveDriveKinematics(
|
||||||
new Translation2d(kWheelBase / 2, kTrackWidth / 2),
|
new Translation2d(kWheelBase / 2, kTrackWidth / 2),
|
||||||
@ -36,12 +34,12 @@ public final class DrivetrainConstants {
|
|||||||
// SPARK MAX CAN IDs
|
// SPARK MAX CAN IDs
|
||||||
public static final int kFrontLeftDrivingCanId = 8;
|
public static final int kFrontLeftDrivingCanId = 8;
|
||||||
public static final int kRearLeftDrivingCanId = 3;
|
public static final int kRearLeftDrivingCanId = 3;
|
||||||
public static final int kFrontRightDrivingCanId = 2;
|
public static final int kFrontRightDrivingCanId = 6;
|
||||||
public static final int kRearRightDrivingCanId = 1;
|
public static final int kRearRightDrivingCanId = 1;
|
||||||
|
|
||||||
public static final int kFrontLeftTurningCanId = 4;
|
public static final int kFrontLeftTurningCanId = 4;
|
||||||
public static final int kRearLeftTurningCanId = 7;
|
public static final int kRearLeftTurningCanId = 7;
|
||||||
public static final int kFrontRightTurningCanId = 6;
|
public static final int kFrontRightTurningCanId = 2;
|
||||||
public static final int kRearRightTurningCanId = 5;
|
public static final int kRearRightTurningCanId = 5;
|
||||||
|
|
||||||
public static final double kTurnToleranceDeg = 0;
|
public static final double kTurnToleranceDeg = 0;
|
||||||
@ -49,6 +47,5 @@ public final class DrivetrainConstants {
|
|||||||
|
|
||||||
public static final boolean kGyroReversed = true;
|
public static final boolean kGyroReversed = true;
|
||||||
|
|
||||||
// TODO Is this offset going to continue to be correct for this year
|
public static final double kRobotStartOffset = 0;
|
||||||
public static final double kRobotStartOffset = 180;
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user