fixed me thinks

This commit is contained in:
Ryan Manley
2022-03-26 10:47:22 -06:00
parent 919e840700
commit b0fb7a26b9
4 changed files with 35 additions and 34 deletions
+2 -1
View File
@@ -4,10 +4,11 @@ Distance (in) ,Hood Ext. (u) ,Drum Velocity (u/ds)
99 ,-39.62 ,8500
111 ,-42 ,9000
127.25 ,-49.12 ,9500
141 ,-59.4 ,9900
150 ,-66.22 ,10000
164.5 ,-75.52 ,10000
186 ,-76.24 ,10000
207 ,-104.07 ,11000
227 ,-105.32 ,11500
255.5 ,-105.8 ,13500
999 ,-105.8 ,13500
999 ,-105.8 ,13500
1 Distance (in) Hood Ext. (u) Drum Velocity (u/ds)
4 99 -39.62 8500
5 111 -42 9000
6 127.25 -49.12 9500
7 141 -59.4 9900
8 150 -66.22 10000
9 164.5 -75.52 10000
10 186 -76.24 10000
11 207 -104.07 11000
12 227 -105.32 11500
13 255.5 -105.8 13500
14 999 -105.8 13500
+27 -27
View File
@@ -374,31 +374,31 @@ public class RobotContainer {
//! Button Box Buttons
// Left Switch > Disables soft limits on press, release resets encoders (all for turret, hood, climber, and extender)
SmartDashboard.putData("BB LEFT ON", new SequentialCommandGroup(
new InstantCommand(() -> m_robotTurret.setTurretSoftLimits(false), m_robotTurret),
new InstantCommand(() -> m_robotTurret.calibrationSpeed = 0.3, m_robotTurret),
// SmartDashboard.putData("BB LEFT ON", new SequentialCommandGroup(
// new InstantCommand(() -> m_robotTurret.setTurretSoftLimits(false), m_robotTurret),
// new InstantCommand(() -> m_robotTurret.calibrationSpeed = 0.3, m_robotTurret),
new InstantCommand(() -> m_robotHood.setHoodSoftLimits(false), m_robotHood),
new InstantCommand(() -> m_robotHood.calibrationSpeed = 0.3, m_robotHood),
// new InstantCommand(() -> m_robotHood.setHoodSoftLimits(false), m_robotHood),
// new InstantCommand(() -> m_robotHood.calibrationSpeed = 0.3, m_robotHood),
new InstantCommand(() -> m_robotExtender.setExtenderSoftLimits(false), m_robotExtender)
));
// new InstantCommand(() -> m_robotExtender.setExtenderSoftLimits(false), m_robotExtender)
// ));
SmartDashboard.putData("BB LEFT OFF", new SequentialCommandGroup(
new InstantCommand(() -> m_robotTurret.setTurretSoftLimits(true), m_robotTurret),
new InstantCommand(() -> m_robotTurret.calibrationSpeed = 1.0, m_robotTurret),
// SmartDashboard.putData("BB LEFT OFF", new SequentialCommandGroup(
// new InstantCommand(() -> m_robotTurret.setTurretSoftLimits(true), m_robotTurret),
// new InstantCommand(() -> m_robotTurret.calibrationSpeed = 1.0, m_robotTurret),
new InstantCommand(() -> m_robotHood.setHoodSoftLimits(true), m_robotHood),
new InstantCommand(() -> m_robotHood.calibrationSpeed = 1.0, m_robotHood),
// new InstantCommand(() -> m_robotHood.setHoodSoftLimits(true), m_robotHood),
// new InstantCommand(() -> m_robotHood.calibrationSpeed = 1.0, m_robotHood),
new InstantCommand(() -> m_robotExtender.setExtenderSoftLimits(true), m_robotExtender),
// new InstantCommand(() -> m_robotExtender.setExtenderSoftLimits(true), m_robotExtender),
new InstantCommand(() -> m_robotTurret.m_boomBoomRotateEncoder.setPosition(0), m_robotTurret),
new InstantCommand(() -> m_robotHood.m_angleEncoder.setPosition(0), m_robotHood),
new InstantCommand(() -> m_robotExtender.setEncoder(0), m_robotExtender),
new InstantCommand(() -> ExtenderIntakeGroup.setDirectionToOut(), m_robotIntake, m_robotExtender),
new InstantCommand(() -> m_robotClimber.setEncoders(0), m_robotClimber)
));
// new InstantCommand(() -> m_robotTurret.m_boomBoomRotateEncoder.setPosition(0), m_robotTurret),
// new InstantCommand(() -> m_robotHood.m_angleEncoder.setPosition(0), m_robotHood),
// new InstantCommand(() -> m_robotExtender.setEncoder(0), m_robotExtender),
// new InstantCommand(() -> ExtenderIntakeGroup.setDirectionToOut(), m_robotIntake, m_robotExtender),
// new InstantCommand(() -> m_robotClimber.setEncoders(0), m_robotClimber)
// ));
// new JoystickButton(getButtonBox(), ButtonBox.Button.kLeftSwitch.value)
// .whenPressed(new InstantCommand(() -> m_robotTurret.setTurretSoftLimits(false), m_robotTurret))
@@ -435,13 +435,13 @@ public class RobotContainer {
// .whileHeld(new InstantCommand(() -> currentDriveMode = DriveMode.OFF))
// .whenReleased(new InstantCommand(() -> currentDriveMode = DriveMode.ON));
// Left Button > Extender In
new JoystickButton(getButtonBox(), ButtonBox.Button.kLeftButton.value)
// // Left Button > Extender In
new JoystickButton(getDriverController(), XboxController.Button.kX.value)
.whileHeld(new RunCommand(() -> m_robotExtender.runExtender(1.0), m_robotExtender))
.whenReleased(new RunCommand(() -> m_robotExtender.runExtender(0.0), m_robotExtender));
// Left Button > Extender Out
new JoystickButton(getButtonBox(), ButtonBox.Button.kRightButton.value)
// Left Button > Extender Out
new JoystickButton(getDriverController(), XboxController.Button.kY.value)
.whileHeld(new RunCommand(() -> m_robotExtender.runExtender(-1.0), m_robotExtender))
.whenReleased(new RunCommand(() -> m_robotExtender.runExtender(0.0), m_robotExtender));
}
@@ -563,10 +563,10 @@ public class RobotContainer {
// new DriveWithInputForTime(m_robotSwerveDrive, new double[] {0.0, -0.5, 0.0, 0.0}, 1.0), // * drive out of tarmac
// new InstantCommand(() -> m_robotSwerveDrive.stopModules(), m_robotSwerveDrive)); // * brake
// new RunCommandForTime(new RunCommand(() -> m_robotTurret.runShooterRotatePID((180.0 / Math.PI) * Math.atan2(-(82.83 / 2.00) + 15.56, -(219.25 / 2.00) - 40.44 + 10.00)), m_robotTurret), 1.0, true), // * aim with turret to target
// weirdAutoShootingGroup, // * shoot
// new InstantCommand(() -> m_robotStorage.runStorage(0.0), m_robotStorage) // * stop running storage
// );
// new RunCommandForTime(new RunCommand(() -> m_robotTurret.runShooterRotatePID((180.0 / Math.PI) * Math.atan2(-(82.83 / 2.00) + 15.56, -(219.25 / 2.00) - 40.44 + 10.00)), m_robotTurret), 1.0, true), // * aim with turret to target
// weirdAutoShootingGroup, // * shoot
// new InstantCommand(() -> m_robotStorage.runStorage(0.0), m_robotStorage) // * stop running storage
// );
// ! THREE BALL AUTO (HOPEFULLY)
// return new SequentialCommandGroup( new RunCommandForTime(new RunCommand(() -> m_robotTurret.runShooterRotatePID(-Math.atan2((219.25 / 2.00) - turretDistanceFromFront, (82.83 / 2.00) - 15.56)), m_robotTurret), 1.0, true), // * aim with turret to target
@@ -95,7 +95,7 @@ public class TrackTarget extends CommandBase {
Point average = VisionOdometry.averagePoint(points);
double output = (average.x - VisionConstants.LIME_HIXELS/2.d) / VisionConstants.LIME_HIXELS;
output *= 2.0;
output *= 2.1;
m_turret.runTurretWithInput(output);
// double position = m_turret.m_boomBoomRotateEncoder.getPosition();
@@ -124,10 +124,10 @@ public class TrackTarget extends CommandBase {
targetLocked = (Math.abs(currentDrumVel - velocity) < velocityTolerance) && (Math.abs(currentHood - hoodPosition) < hoodTolerance) && (output < 0.2);
SmartDashboard.putNumber("Distance to Target", regressedDistance);
// SmartDashboard.putNumber("Distance", distance);
// SmartDashboard.putNumber("Hood Target Angle Track", hoodPosition);
// SmartDashboard.putNumber("Vel Target Track", velocity);
SmartDashboard.putNumber("Distance", regressedDistance - 35);
SmartDashboard.putNumber("Hood Target Angle Track", hoodPosition);
SmartDashboard.putNumber("Vel Target Track", velocity);
SmartDashboard.putBoolean("Target Locked", targetLocked);
} catch (Exception e){
e.printStackTrace();
@@ -61,7 +61,7 @@ public class Hood extends SubsystemBase {
@Override
public void periodic() {
// This method will be called once per scheduler run
// SmartDashboard.putNumber("Hood Angle", m_angleEncoder.getPosition());
SmartDashboard.putNumber("Hood Angle", m_angleEncoder.getPosition());
// * speed limiting near soft limits. tolerance (distance when ramping starts) is 20 rotations. speed at hard limits is 0.2 (percent output).
// runVelocityRamping();