Skip to content

Commit

Permalink
fixed auton, controller, blah
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyBrar committed Dec 15, 2024
1 parent caa176e commit 5826f1b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/main/cpp/ControllerInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ void ControllerInterface::UpdateSwerveInput(RobotControlData &controlData)
{
controlData.swerveInput.slowMode = m_pilot.GetLeftBumper();

controlData.swerveInput.xTranslation = -m_pilot.GetLeftY();
controlData.swerveInput.yTranslation = -m_pilot.GetLeftX();
controlData.swerveInput.xTranslation = -m_pilot.GetLeftX();
controlData.swerveInput.yTranslation = -m_pilot.GetLeftY();
controlData.swerveInput.rotation = -m_pilot.GetRightX();

if (controlData.swerveInput.slowMode)
Expand Down
2 changes: 1 addition & 1 deletion src/main/cpp/InputManager/ElevatorManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ void ElevatorManager::HandleInput(RobotControlData& control_data) {
}
};
void ElevatorManager::Reset(){
m_elevator.ProfiledMoveToHeight(0);
m_elevator.ProfiledMoveToHeight(0);
};
17 changes: 6 additions & 11 deletions src/main/cpp/Robot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void Robot::AutonomousInit() {
// m_autoSelected = m_chooser.GetSelected();
// m_autoSelected = frc::SmartDashboard::GetString("Auto Selector", kAutoNameDefault);
// fmt::print("Auto selected: {}\n", m_autoSelected);

if (m_autoSelected == kAutoNameCustom) {
// Custom Auto goes here
} else {
Expand All @@ -54,22 +54,16 @@ void Robot::AutonomousInit() {
}

void Robot::AutonomousPeriodic() {
m_timer.Reset();
m_timer.Start();

while(m_timer.Get() < 10_s)
{
_swerve.Drive(0.7, 0.0, 0.0);
}

_swerve.Drive(0.24, 0.0, 0.0);


if (m_autoSelected == kAutoNameCustom) {
// Custom Auto goes here
} else {
// Default Auto goes here
}

_swerve.Drive(0.0, 0.0, 0.0);
m_timer.Reset();
TeleopPeriodic();
}

void Robot::TeleopInit() {
Expand All @@ -91,6 +85,7 @@ void Robot::DisabledInit() {}
void Robot::DisabledPeriodic() {}

void Robot::TestInit() {
_swerve.Drive(0.24, 0.0, 0.0);

}

Expand Down

0 comments on commit 5826f1b

Please sign in to comment.