Go to Post I'm gonna go back to my corner and write some more code... - Kevin Watson [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 18-01-2011, 19:56
Wolfgang Wolfgang is offline
Registered User
AKA: Mehmed
FRC #1245 (Shazbots)
Team Role: Programmer
 
Join Date: Oct 2009
Rookie Year: 2010
Location: Denver
Posts: 47
Wolfgang is an unknown quantity at this point
LabVIEW Autonomous Cases

Can anybody give me an explanation of all the cases in the LabVIEW autonomous code. Thanks!
  #2   Spotlight this post!  
Unread 18-01-2011, 20:32
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: LabVIEW Autonomous Cases

I don't have it home with me. If you post a picture, I'll be happy to explain it.

Greg McKaskle
  #3   Spotlight this post!  
Unread 19-01-2011, 01:50
Dfontana Dfontana is offline
Registered User
AKA: David Fontana
FRC #3039 (Wildcat Robotics, Team Predator)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Destrehan, LA
Posts: 9
Dfontana is an unknown quantity at this point
Re: LabVIEW Autonomous Cases

Quote:
Originally Posted by Wolfgang View Post
Can anybody give me an explanation of all the cases in the LabVIEW autonomous code. Thanks!
This is all from memory. I just took a look inside the autonomous VI today.

Description from left to right:

Starting out, you should see a DriverStation-GetDigital VI or something of the sort. This basically fetches and returns the status of all digital inputs hooked to the driver station (switches, most likely.. possibly buttons). This is then compiled into a boolean array and converted into a numeric byte.

The example provides for two switches. Essentially you are counting in binary.

Switch 1 | Switch 2 | Byte Value
OFF | OFF | 0
OFF | ON | 1
ON | OFF | 2
ON | ON | 3

This numeric byte is then used as an index selector for the enumeration array (located just above, I believe). The resulting enumeration selects one of the following cases: LEFT, STRAIGHT, or RIGHT.

LEFT will follow the left branch of the "Y" formation in the line.
STRAIGHT continues forward (used for starting positions which do not have a "Y")
RIGHT.. self explanatory.


There are three Double-Precision arrays inside the subsequent loop. These have hard-wired inputs on the front panel.

One of these controls the speed of the motors, gradually decreasing as the elapsed time of the autonomous period grows. I think this was done to avoid overshooting.

I honestly cannot remember what the other two are for.

There is another boolean to binary array structure inside this loop which fetches and returns the state of each IR sensor. Again, it counts in binary, returning either a 0, 1, 2, 4, or 7 (If I recall correctly).

This number is then attached to a case structure inside the loop which has a shift-register attached. This basically keeps track of what the previous case was, compares it to the new one, and provides the appropriate action to take in each instance.

For example, if the previous case represented the robot being completely on the line, but the new one represents the robot veering to the left of it, the code provides appropriate motor inputs to correct this.

The conditions represented by each numerical case are listed in the VI as comments.


I believe that's the jist of it. Again, this is purely from memory, so don't crucify me if anything is missing or incorrect.
__________________
FIRST Team 3039 - Wildcat Robotics, Team Predator - Destrehan, LA.
  #4   Spotlight this post!  
Unread 19-01-2011, 03:18
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: LabVIEW Autonomous Cases

I think he was inquiring about all the nested case structures for the "autonomous enabled" case, so I'll explain that as best I can.

Outside the main while loop is the autonomous independent vi. This vi can be programmed to have one big sequence structure with something like having the first be drive forward, then have a timer for 2 seconds, then raise the arm, etc. The wire it outputs is a reference to it.. kind of like a file extension, or a URL.

Inside the main while loop, there's the Get Robot Competition Mode.vi. That outputs the obvious "autonomous enabled, teleop enabled, blah blah blah, but it also outputs "Call Context". This is either "Init", "Execute", or "Stop." these go into the second layer of case structures (for most of the vis like teleop, the case structure is within the vi). When the robot mode output changes (you hit the "disable" or "enable" buttons on dashboard), it first goes to the "stop" case of the last one, and then the "init" case of the new one. For the autonomous case, it has the functions Start background vi and stop background vi in the init and stop cases, and nothing in execute, and each takes in the reference from the autonomous vi.

The start vi function, well, starts the autonomous independent vi. That means that the first loop in which the autonomous enable is called, it starts the independent vi, and that starts running. In the "execute" case, it just lets that vi run it's course. And in the "stop" case, it stops the vi the same way as if you pressed that red abort button.

I hope that makes sense, and is what you wanted
  #5   Spotlight this post!  
Unread 20-01-2011, 18:37
Wolfgang Wolfgang is offline
Registered User
AKA: Mehmed
FRC #1245 (Shazbots)
Team Role: Programmer
 
Join Date: Oct 2009
Rookie Year: 2010
Location: Denver
Posts: 47
Wolfgang is an unknown quantity at this point
Re: LabVIEW Autonomous Cases

Thanks! That helps a lot!
  #6   Spotlight this post!  
Unread 28-01-2011, 04:58
cilginbilgin cilginbilgin is offline
Registered User
FRC #2905
 
Join Date: Jan 2010
Location: Istanbul,Turkey
Posts: 188
cilginbilgin is a jewel in the roughcilginbilgin is a jewel in the roughcilginbilgin is a jewel in the roughcilginbilgin is a jewel in the rough
Question Re: LabVIEW Autonomous Cases

Does anyone know how to stop the robot on autonomous mode for some seconds?
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:39.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi