Quote:
|
Originally Posted by eugenebrooks
If you are using the switches on the OI to select the autonomous mode, you should read and save the values while the robot is disabled, and write code that sets a flag to stop saving the value once the robot has been enabled. That way, a spurious disable will not affect the autonomous mode.
It is interesting that the human player on the pad can communicate with the robot by shifting his/her weight on the pad. I am sure that FIRST did not intend this. We use a set of switches on the robot to select the autonomous mode in binary. Values set by these switches are not affected by the disabled state...
|
Another way to make sure the routine selected on the OI is not changed during a spurious disable (autonomous_mode and disabled_mode both = 1) is to set the auto select variables if not in autonomous mode like such:
Code:
if(!autonomous_mode){
//set auto select variables
}
However, this may result in certain variables (step, gyro, encoder, coordinate, integral, etc..) being reset or incorrectly changed, depending on your code. If that is the case, your robot would likely restart the same routine at a different starting point or go haywire in some another way.
I personally would prefer to just cut bait and sit out the rest of the 15 sec with a "do nothing routine", than risk getting stuck in a goal again. We were lucky to win that quarter final match. We were stuck for nearly the entire match and committed a 10 point penalty, but 869 and 808 overcame all that and won it for the alliance.