-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes to SmartIntake, need to be confirmed and pushed to master #18
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,43 +59,28 @@ void SmartIntake::HandleInput(RobotControlData& input){ | |
} | ||
} | ||
break; | ||
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) | ||
{ | ||
++m_IntakeState; | ||
} | ||
} | ||
break; | ||
|
||
default: | ||
m_SmartIntakeFlag = false; | ||
break; | ||
} | ||
} | ||
else | ||
{ | ||
switch (m_IntakeState) | ||
{ | ||
case 0: | ||
case 2: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should start at case 0. |
||
{ | ||
/* code */ | ||
input.intakeInput.runIntakeIn = true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. checking if the laser hit should be in the true case. The if statement should conditionally transfer to the false case |
||
if (input.smartIntakeInput.laser){ | ||
input.intakeInput.runIntakeIn = false; | ||
input.intakeInput.goToPseudoStowPos = true; | ||
++m_IntakeState; | ||
} | ||
|
||
} | ||
break; | ||
case 1: | ||
case 3: | ||
{ | ||
input.intakeInput.goToPseudoStowPos = false; | ||
if (input.intakeOutput.intakePos == IntakePos::PSEUDO_STOW) | ||
|
@@ -130,27 +115,8 @@ void SmartIntake::HandleInput(RobotControlData& input){ | |
} | ||
} | ||
break; | ||
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) | ||
{ | ||
++m_OutTakeState; | ||
} | ||
} | ||
break; | ||
default: | ||
m_SmartOutTakeFlag = false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see associated comment for intake |
||
break; | ||
} | ||
} | ||
|
@@ -159,15 +125,18 @@ void SmartIntake::HandleInput(RobotControlData& input){ | |
|
||
switch (m_OutTakeState) | ||
{ | ||
case 0: | ||
case 2: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see associated comment for intake |
||
{ | ||
/* code */ | ||
input.intakeInput.runIntakeOut = true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see associated comment for intake |
||
if (input.smartIntakeInput.laser){ | ||
input.intakeInput.runIntakeOut = false; | ||
input.intakeInput.goToPseudoStowPos = true; | ||
++m_OutTakeState; | ||
} | ||
|
||
} | ||
break; | ||
case 1: | ||
case 3: | ||
{ | ||
input.intakeInput.goToPseudoStowPos = false; | ||
if (input.intakeOutput.intakePos == IntakePos::PSEUDO_STOW) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be in the default case. Make an explicit case for switching over to false. We use the default case to do nothing