Thread: Autonomous help
View Single Post
  #10   Spotlight this post!  
Unread 13-03-2009, 00:10
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,708
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Autonomous help

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.
Attached Files
File Type: zip Autonomous Independent.zip (11.8 KB, 76 views)
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter