Autonomous help

Coding in LabView. Ok SO we have autonomous code written and teleop written. We are using Main.VI as our startup code on the cRio. Teleop is running correctly when the DS is switched to Teleop Enabled. Here is the problem, autonomous is correctly running on the block diagram on our laptop however the code is not running on the bot when the DS is switched to Auto Enabled. :ahh:

Are you feeding the watchdog?

First, are you using the Basic framework, or the Advanced framework? The advanced framework has,, and many others.

Second, are forgetting to feed your watchdog or something in auto? Are you (improperly) trying to Open motor and drive refs in your autonomous code?

Lastly, posting your code would make helping you a good bit easier.

We are using Basic framework and yes are feeding the watchdog. I am posting our Basic framework for you to look at. Ok, hang on have to compress as we are 3 kb too big for attaching file…

Nevermind, the screenshots are too big…give me a little bit and I will go somewhere where I can get WinZip to compress the files. Be back in a bit…:eek: :mad:

Finally made it to a computer with compression software. Here is our Basic Main.VI The programmer finally got it to work but in an unconventional method which you will see in the code. He’s got the code in a loop for “other” but is calling the Autonomous VI outside the structure (as it was in the default). If you have any advice as to what we may have done wrong it would be much appreciated!:slight_smile:

Basic Robot (55.6 KB)

Basic Robot (55.6 KB)

your autonomous is the second thing wed need to help you out.

EDIT: I think your problem may be that you’re trying to run your autonomous code in the “Other” section of Robot Basic Main. You really shouldn’t be trying to do much in this section. Although it looks like the code is currently commented out with that False constant.

Anyways, your autonomous code should go in your Autonomous file. Don’t worry that it doesn’t look like it gets run anywhere. The Basic Framework takes care of that for you, and will run that vi whenever you enter autonomous mode. Specifically, the Basic Robot takes care of this for you.

First of all you have to have it running from to run effectively and correctly. Second, is it possible we could see what your looks like? It could help drastically in diagnosing your problem.

Edit: Darn, beat to the punch. :stuck_out_tongue:

(v-8 slapping forehead)…It’s been a day…it started with letting the magic smoke out of our extra two Jags this morning (literally)…feels like a Friday 13 and Monday all rolled into one. Can’t get to the auto code until tomorrow morning but will get it posted as soon as I get to school and tget access to the laptop that it is on. Thanks for staying up and looking at it and I’ll be in touch in the morning.:o

Let me just offer up this chunk of autonomous code. It’s super easy to program to do whatever you want, and it should drop right into the basic framework. Here’s how it works…

On the far left, you’ll see an array constant. This is your autonomous “program”. The first number in each array element is how long a particular move will last. The next two columns are joystick commands that you send for that length of time. X/L is the virtual X or Left joystick position, in Arcade or Tank drive, respectively. Y/R is the Y or Right joystick position.

So the program that’s currently in there does this:

  • For 3 seconds, move the “joystick” to Y=-0.75. (This makes you drive 75% speed forward in arcade.)
  • For 12 seconds, move the “joystick” to X=-0.75. (This makes you spin around in arcade mode.)
  • Stop.

To add more steps, you just add more elements to the array. To change the program, you change the numbers in the array.

In your case, you’re using Tank drive, so you’d want to change that arcade drive to a tank drive. To do this, right click on the arcade drive vi, select “Replace” then “RobotDrive Palette” then the tank drive vi. Then change the numbers in the program to something that makes sense for your tank drive style.

Autonomous (11.8 KB)

Autonomous (11.8 KB)