|
Re: Kicking while driving
The two code implementations are very similar. Do this as fast as you can until enough time passes.
A couple other approaches to try.
Put the kicking code in a parallel loop that looks at a global to see if it should kick, hold, or return the foot, etc. Then in teleop drive, just set the globals based on the joystick. In the parallel loop you can still use your timed sequence just fine.
A more efficient way of doing the notification is to use an occurrence, queue, or other programming mechanism to let drive signal the loop when it should start a new sequence.
Another approach is to break up the code and keep it in the teleop, but make it a state machine as already mentioned.
Greg McKaskle
|