Skip to content

Commit

Permalink
Added reset functions to launcher and input managers, set intake to r…
Browse files Browse the repository at this point in the history
…eset upon teleop init.
  • Loading branch information
NottheIRS committed Feb 18, 2024
1 parent dcc82da commit 7785f61
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 10 deletions.
5 changes: 4 additions & 1 deletion src/main/cpp/Robot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ void Robot::AutonomousPeriodic() {
}
}

void Robot::TeleopInit() {}
void Robot::TeleopInit()
{
_intake_manager.ResetIntake();
}

void Robot::TeleopPeriodic() {
PrintSwerveInfo();
Expand Down
9 changes: 9 additions & 0 deletions src/main/cpp/subsystems/subsystemManagers/IntakeManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ namespace
const double PSEUDO_STOW_POS = 153.105;
}

void IntakeManager::ResetIntake()
{
m_goToGroundPos = false;
m_goToStowPos = false;
m_goToAmpPos = false;
m_goToPseudoStowPos = false;
}

void IntakeManager::HandleInput(IntakeInput &input, IntakeOutput &output)
{
if (input.runIntakeIn && !input.runIntakeOut)
Expand All @@ -23,6 +31,7 @@ void IntakeManager::HandleInput(IntakeInput &input, IntakeOutput &output)
{
m_intake.RunIntake(0.0);
}

if (input.manualMove > 0.001)
{
m_intake.ManualMovePivot(input.manualMove);
Expand Down
7 changes: 7 additions & 0 deletions src/main/cpp/subsystems/subsystemManagers/LauncherManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ namespace
const double INDEXER_SPEED = 0.0;
}

void LauncherManager::ResetLauncher()
{
m_goToStowPos = false;
m_goToSubPos = false;
m_visionResetProfiledMoveState = false;
}

void LauncherManager::HandleInput(LauncherInput &input, LauncherOutput &output)
{
if (input.useVisionControl)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class IntakeManager

public:
void HandleInput(IntakeInput &input, IntakeOutput &output);

void ResetIntake();

private:
IntakeHAL m_intake;
bool m_goToGroundPos;
Expand Down
17 changes: 9 additions & 8 deletions src/main/include/subsystems/subsystemsManagers/LauncherManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ struct LauncherOutput

class LauncherManager
{
public:
void HandleInput(LauncherInput &input, LauncherOutput &output);

private:
LauncherHAL m_launcher;
bool m_goToStowPos;
bool m_goToSubPos;
bool m_visionResetProfiledMoveState = false;
public:
void HandleInput(LauncherInput &input, LauncherOutput &output);
void ResetLauncher();

private:
LauncherHAL m_launcher;
bool m_goToStowPos;
bool m_goToSubPos;
bool m_visionResetProfiledMoveState = false;
};

0 comments on commit 7785f61

Please sign in to comment.