RobotCasserole1736 / RobotCasserole2017

Robot Casserole robot source code for the 2017 FRC game, First Steamworks.
MIT License
0 stars 0 forks source link

Review vision alignment state machine #110

Closed gerth2 closed 7 years ago

gerth2 commented 7 years ago

When we introduced the "snapshot" functionality to our vision align, I believe we added some latent requirements for how the state machine should be laid out. I believe the present implementation will still be unstable....I'm going to draft up a proposal tonight, and will discuss next time folks are in.

gerth2 commented 7 years ago

More specifically, I believe we need three changes: -Exit condititons for sAligning should be based around PID errors, not camera errors -Only transitions into aligning should update the PID setpoints (what is presently referred to as "take pic") -An additional "delay for vision proc" should be added between sAligning and sConfirmTarget to allow the image process system to catch up to where the robot is physically at, before utilizing it to determine alignment or not. Suggest 300ms as a conservative start for this number.

With the state machine representation, I think the reduction of code duplication can be more easily seen and verified.

schmizr19 commented 7 years ago

I did add the Delay state on branch: ZoeAddDelayState. (See issue #122 )

gerth2 commented 7 years ago

will need full validatino on field, but will mark this off since the implementation is done and tested on bench.