PDA

View Full Version : Coordinating Robot Main VI with Autonomous VI


jjauss
02-05-2009, 11:12 AM
To all:

We have gotten our robot main.vi to work, and we have gotten our camera code to work when it is run independently in a separate robot main.vi. However, when we put our camera code into autonomous independent.vi, we are having problems handshaking both of these - specifically, coordinating the intitializations of the motors, watchdogs, etc. I am attaching the code that we are running - any help would be greatly appreciated!

John Jauss
Team 1182 Coach

martin417
02-05-2009, 11:23 AM
Put the camera code in robot main, and use a global variable for the output (area, min X, min Y, max X, max Y) Use that global variable in your autonomous vi (as well as your teleop vi if you are tracking in teleop)

jjauss
02-07-2009, 08:26 AM
Okay, so in this version of the code we run the autonomous and the camera tracks colors and also sends signals to the motors which respond appropriately. Then in teleoperated, it continues to run the autonomous we just tried. The teleoperated basically doesn't even activate - we get no control of the joystick or our pressure switch.

We also tried putting the upper while loop from autonomous to robot main, but the results were the same. We think the global references to the motors are not working properly because they are not working in BOTH autonomous and teleoperated. We have done tests where it worked in only teleoperated and only autonomous, but never both sequentially.

Also, adding a wait time did not affect our code.

Thanks again for your help
Team 1182