RobotCasserole1736 / RobotCasserole2017

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

Add vision system delay calibration routine #86

Closed gerth2 closed 7 years ago

gerth2 commented 7 years ago

A digital output is being set up to control turning the LED ring around the camera on and off.

Using this new functionality, we can perform calibration on the total processing time of the vision system, which will be needed for accurate feedback response:

This should be implemented as a state machine with the following states:

If the vision system goes offline during any of the CALCYCLE* states, set the cal failed flag and go straight to CAL_TERMINATE. Report that the last cal has failed, but also report out any info achieved before the failure. Note that this requires your CAL_TERMINATE logic must handle the case where the arrayList of samples is empty.

A public method must be provided for turning the LED ring on and off while in NO Cal

For integration, hook this up to a calibration on the web page so that by setting the calibration to 1, it triggers this camera calibration routine to run (until it is set back to zero).

Additionally, use the no-cal LED ring on/off method to only have the LED ring on if the vision processing system is online. This will provide an extra visual indication to the drivers of whether the vision processing system is functional or not.

If we have the circuit to control the led ring, we can use that for testing. If not, we can manually turn the ring on and off on the power supply to get the state machine through its states.

gerth2 commented 7 years ago

Splitting CAL_CYCLE_FINISH into CAL_CYCLE_FINISH_PASS and CAL_CYCLE_FINISH_FAIL to make things cleaner.

gerth2 commented 7 years ago

cal_failed flag is now an enum

gerth2 commented 7 years ago

tested and merged, I'll call it done for now.