|
Re: Robot "twitching?"
All the stuff that feeds into FIRE including the joystick gets for axes and buttons, can all be copied and pasted into clear space in Periodic Tasks.vi.
Then put a While loop around it that never ends, and put a 10ms Wait in there so it doesn't suck all the life out of the cRIO.
There's nothing special about Teleop that gives it exclusive access to the Joystick controls. They can be read in Teleop and in Periodic Tasks, or other places, too.
The advantage of Teleop is that it only gets called whenever there are new joystick values to process, so it's more efficient.
Run the loop in Periodic Tasks a little faster than the 20ms communication packet rate and it won't matter that you're sometimes reading joystick info twice sometimes. The duplicate info won't be the the signal telling you to FIRE.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Last edited by Mark McLeod : 09-02-2013 at 12:58.
|