-
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
Clean up IntakeAssembly (#111 / #112 / #114) #117
Conversation
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.
Looks good. I like the separation between Claw and Wrist
Are you able to test this Tuesday? I haven't negotiated Thursday robot availability yet
I’ll try to come in Tuesday but I might not be able to make it. If I do make it, I’ll test. |
I can probably work with ChrisM to test this Tuesday afternoon |
Can you also do #112 in here? Literally all you gotta do is remove all references to |
Ok |
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.
src/TeleopMode.cpp
Outdated
if (m_intakeAssembly->GetClaw()->IsCubeIn()) { | ||
m_cubeIntakeState = CubeIntakeState::Idle; | ||
m_intakeAssembly->HoldCube(); | ||
m_intakeAssembly->Flash(); |
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.
excellent
src/TeleopMode.cpp
Outdated
} | ||
else { | ||
m_intakeAssembly->StopIntake(); | ||
s_intaking = false; | ||
m_cubeIntakeState = CubeIntakeState::Idle; |
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.
you will need to call m_intakeAssembly->HoldCube() here otherwise it'll continue intaking forever
src/TeleopMode.cpp
Outdated
} | ||
else { | ||
m_intakeAssembly->StopIntake(); | ||
m_cubeIntakeState = CubeIntakeState::Idle; |
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.
same here
@@ -65,7 +65,8 @@ void CenterSwitchAuto::Execute(AutoRoutineBase::AutoDirection direction) { | |||
break; | |||
case 3: | |||
if (m_drive->GetSplinePercentComplete() > 0.9) { | |||
m_intakeAssembly->WideIntake(); | |||
m_intakeAssembly->RunIntake(-1.0); | |||
m_intakeAssembly->OpenClaw(); |
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.
much better
} | ||
if (m_intakeAssembly->GetWrist()->IsCubeIn() || | ||
if (m_intakeAssembly->GetClaw()->IsCubeIn() || |
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.
ohh this probably looks confusing but let me explain
GetClaw()
should return something of type const Claw*
. In C++ when you have a const
object, you're only allowed to call const
methods (methods that explicitly have the const
keyword on them). C++ does this so you don't accidentally change things if you only have a const reference to it.
Anything that changes Elevator, Claw, and Wrist needs to go through IntakeAssembly because IntakeAssembly needs to make sure the states stay in sync. Anything that reads from Elevator, Claw, and Wrist is fair game because you can't screw it up through a read. That's why for reads we can say e.g. m_intakeAssembly->GetElevator()->GetHeight();
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.
What do I need to change?
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.
nothing here
just change the definitions of GetWrist, GetClaw, and GetElevator to return const Wrist *
, const Claw*
, and const Elevator*
respectively
hold the cube, and const on Get____ functions
Tested 3. April. 2018 |
Fixes #111. Still needs javadocs