Skip to content

Commit

Permalink
Merge pull request #18 from FRC830/SmartIntakeChanges
Browse files Browse the repository at this point in the history
bug fix of smart intake logic
  • Loading branch information
Harsh-Sinha authored Feb 21, 2024
2 parents cda6896 + 93dab1c commit c0c4ac0
Showing 1 changed file with 14 additions and 36 deletions.
50 changes: 14 additions & 36 deletions src/main/cpp/subsystems/SmartIntake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,10 @@ void SmartIntake::HandleInput(RobotControlData& input){
case 2:
{
input.intakeInput.runIntakeIn = true;
if (input.smartIntakeInput.laser){
input.intakeInput.runIntakeIn = false;
input.intakeInput.goToPseudoStowPos = true;
++m_IntakeState;
}

}
break;
case 3:
{
input.intakeInput.goToPseudoStowPos = false;
if (input.intakeOutput.intakePos == IntakePos::PSEUDO_STOW)
if (input.smartIntakeInput.laser)
{
++m_IntakeState;
m_SmartIntakeFlag = false;
m_IntakeState = 0;
}
}
break;
Expand All @@ -89,10 +79,9 @@ void SmartIntake::HandleInput(RobotControlData& input){
{
case 0:
{
/* code */
input.intakeInput.runIntakeIn = false;
input.intakeInput.goToPseudoStowPos = true;
++m_IntakeState;
input.intakeInput.runIntakeIn = false;
input.intakeInput.goToPseudoStowPos = true;
++m_IntakeState;
}
break;
case 1:
Expand Down Expand Up @@ -133,20 +122,10 @@ void SmartIntake::HandleInput(RobotControlData& input){
case 2:
{
input.intakeInput.runIntakeOut = true;
if (input.smartIntakeInput.laser){
input.intakeInput.runIntakeOut = false;
input.intakeInput.goToPseudoStowPos = true;
++m_OutTakeState;
}

}
break;
case 3:
{
input.intakeInput.goToPseudoStowPos = false;
if (input.intakeOutput.intakePos == IntakePos::PSEUDO_STOW)
if (input.smartIntakeInput.laser)
{
++m_OutTakeState;
m_SmartOutTakeFlag = false;
m_OutTakeState = 0;
}
}
break;
Expand All @@ -160,11 +139,10 @@ void SmartIntake::HandleInput(RobotControlData& input){
switch (m_OutTakeState)
{
case 0:
{
/* code */
input.intakeInput.runIntakeOut = false;
input.intakeInput.goToPseudoStowPos = true;
++m_OutTakeState;
{
input.intakeInput.runIntakeOut = false;
input.intakeInput.goToPseudoStowPos = true;
++m_OutTakeState;
}
break;
case 1:
Expand All @@ -181,7 +159,7 @@ void SmartIntake::HandleInput(RobotControlData& input){
}
}

// needs to go at the bottom
// needs to go at the bottom
m_prevSmartIntake = input.smartIntakeInput.smartIntake;
m_prevSmartOutTake = input.smartIntakeInput.smartOutTake;
m_prevSwitchMode = input.smartIntakeInput.switchMode;
Expand Down

0 comments on commit c0c4ac0

Please sign in to comment.