mirror of
https://github.com/Team4388/2023WayOfTheRobot.git
synced 2026-06-09 00:37:59 -06:00
pid done
This commit is contained in:
@@ -158,9 +158,9 @@ public class Robot extends TimedRobot {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void teleopPeriodic() {
|
public void teleopPeriodic() {
|
||||||
// SmartDashboard.putNumber("yaw", m_robotContainer.gyroRef.getAngle());
|
// SmartDashboard.putNumber("yaw", m_robotContainer.m_robotMap.gyro.getAngle());
|
||||||
// SmartDashboard.putNumber("pitch", m_robotContainer.gyroRef.getPitch());
|
SmartDashboard.putNumber("Robot.java Pitch", m_robotContainer.m_robotMap.gyro.getPitch());
|
||||||
// SmartDashboard.putNumber("roll", m_robotContainer.gyroRef.getRoll());
|
// SmartDashboard.putNumber("roll", m_robotContainer.m_robotMap.gyro.getRoll());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import frc4388.utility.controller.XboxController;
|
|||||||
*/
|
*/
|
||||||
public class RobotContainer {
|
public class RobotContainer {
|
||||||
/* RobotMap */
|
/* RobotMap */
|
||||||
private final RobotMap m_robotMap = new RobotMap();
|
public final RobotMap m_robotMap = new RobotMap();
|
||||||
|
|
||||||
/* Subsystems */
|
/* Subsystems */
|
||||||
public final SwerveDrive m_robotSwerveDrive = new SwerveDrive(m_robotMap.leftFront, m_robotMap.rightFront, m_robotMap.leftBack, m_robotMap.rightBack);//, m_robotMap.gyro);
|
public final SwerveDrive m_robotSwerveDrive = new SwerveDrive(m_robotMap.leftFront, m_robotMap.rightFront, m_robotMap.leftBack, m_robotMap.rightBack);//, m_robotMap.gyro);
|
||||||
@@ -99,8 +99,9 @@ public class RobotContainer {
|
|||||||
private void configureButtonBindings() {
|
private void configureButtonBindings() {
|
||||||
/* Driver Buttons */
|
/* Driver Buttons */
|
||||||
|
|
||||||
// new JoystickButton(getDriverJoystick(), XboxController.A_BUTTON)
|
new JoystickButton(getDriverJoystick(), XboxController.A_BUTTON)
|
||||||
// .onTrue(new InstantCommand(() -> gyroRef.reset()));
|
.onTrue(new InstantCommand(() -> m_robotMap.gyro.reset()));
|
||||||
|
// .onFalse()
|
||||||
|
|
||||||
/* Operator Buttons */
|
/* Operator Buttons */
|
||||||
// activates "Lit Mode"
|
// activates "Lit Mode"
|
||||||
|
|||||||
@@ -19,7 +19,11 @@ public class AutoBalance extends PelvicInflammatoryDisease {
|
|||||||
|
|
||||||
/** Creates a new AutoBalanceTF2. */
|
/** Creates a new AutoBalanceTF2. */
|
||||||
public AutoBalance(RobotGyro gyro, SwerveDrive drive) {
|
public AutoBalance(RobotGyro gyro, SwerveDrive drive) {
|
||||||
super(.7, .1, 15, 0);
|
super(1.0, 0, 0, 0);
|
||||||
|
|
||||||
|
this.gyro = gyro;
|
||||||
|
this.drive = drive;
|
||||||
|
|
||||||
addRequirements(drive);
|
addRequirements(drive);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,7 +44,7 @@ public class AutoBalance extends PelvicInflammatoryDisease {
|
|||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
super.initialize();
|
super.initialize();
|
||||||
this.gyro.reset();
|
// this.gyro.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true when the command should end.
|
// Returns true when the command should end.
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ public class SwerveModule extends SubsystemBase {
|
|||||||
double feetPerSecond = Units.metersToFeet(state.speedMetersPerSecond);
|
double feetPerSecond = Units.metersToFeet(state.speedMetersPerSecond);
|
||||||
double inchesPerSecond = Units.metersToInches(state.speedMetersPerSecond);
|
double inchesPerSecond = Units.metersToInches(state.speedMetersPerSecond);
|
||||||
|
|
||||||
driveMotor.set(/*angleMotor.get() + */feetPerSecond / SwerveDriveConstants.MAX_SPEED_FEET_PER_SECOND);
|
driveMotor.set(-1 * angleMotor.get() + feetPerSecond / SwerveDriveConstants.MAX_SPEED_FEET_PER_SECOND);
|
||||||
// driveMotor.set(TalonFXControlMode.Velocity, inchesPerSecond * SwerveDriveConstants.Conversions.TICKS_PER_INCH * SwerveDriveConstants.Conversions.SECONDS_TO_TICK_TIME);
|
// driveMotor.set(TalonFXControlMode.Velocity, inchesPerSecond * SwerveDriveConstants.Conversions.TICKS_PER_INCH * SwerveDriveConstants.Conversions.SECONDS_TO_TICK_TIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user