Go to Post I wouldn't want to replay Lunacy -- the Moon is a harsh mistress! - Richard Wallace [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 16-02-2010, 20:03
Luke Pike's Avatar
Luke Pike Luke Pike is offline
Programmer
FRC #1501 (THRUST)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Huntington
Posts: 114
Luke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to all
Re: sample code to move robot autonomously

In your code, when you pass a Boolean true constant to the solenoid vi, it should actuate. Take a look at what you do in Teleop. You're probably unbundling the buttons cluster from the joystick and wiring one Boolean from that into the solenoid vi, right? It should work the same in autonomous, only instead of using a button, we use a Boolean constant. They're both the same type.

If you could, can you take a picture of your Teleop code and how you actuate the solenoid? That will help me see what's going on.
__________________
Twitter Profile
Reply With Quote
  #17   Spotlight this post!  
Unread 17-02-2010, 09:11
johncap100 johncap100 is offline
Registered User
FTC #0658
 
Join Date: Aug 2009
Location: Capital High School
Posts: 95
johncap100 is an unknown quantity at this point
Re: sample code to move robot autonomously

Hey Luke i found out the problem i used Soleniod to call the solenoid in teleop but had used a small "s" in the autonpmous code .........gosh one littel letter makes a huge difference, maybe labview needs to have a watch dog for goofy programmers
thanks john for now i think i have it,
one more thing i believe should be able to add case structures as i want to add a few more moves in autonomous right????

thanks again John
Reply With Quote
  #18   Spotlight this post!  
Unread 17-02-2010, 09:26
Luke Pike's Avatar
Luke Pike Luke Pike is offline
Programmer
FRC #1501 (THRUST)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Huntington
Posts: 114
Luke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to all
Re: sample code to move robot autonomously

Yeah, gotta be careful with that reference registry.

Yep, all you need to do is add states (items) to your enum and add cases in the case structure to handle them. Just make sure to add a condition to move to the new state.

Also, check out FRCmastery (lvmastery.com too), they have a state machine video tutorial over there.
__________________
Twitter Profile

Last edited by Luke Pike : 17-02-2010 at 15:54. Reason: Added links
Reply With Quote
  #19   Spotlight this post!  
Unread 18-02-2010, 08:03
johncap100 johncap100 is offline
Registered User
FTC #0658
 
Join Date: Aug 2009
Location: Capital High School
Posts: 95
johncap100 is an unknown quantity at this point
Re: sample code to move robot autonomously

HI me again
In a step back we changed the enum into a type def, when that happens if you right click on the enum there is no way that i can see to add more states, an edit itme never shows up, i did go to properties and there an edit item there but it does not allow changes, i can go back and start from the beginning but add a number of states and then go thru and add all the case states, but it seems to me there must be an easier way, also if I do change the enum to a constant if i were to add any states then the pull down menu at the top of the case loop changes and does not reflect what is in the enum??
thanks again for your help, i do think i am getting way closer to what i want to do.
thanks John
Reply With Quote
  #20   Spotlight this post!  
Unread 18-02-2010, 09:03
Ziaholic's Avatar
Ziaholic Ziaholic is offline
Elec/SW Mentor
AKA: Marc
FRC #1164 (Project NEO)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2002
Location: Las Cruces, NM
Posts: 194
Ziaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the rough
Re: sample code to move robot autonomously

If your enum is now a typedef, then when you want to add items, you need to open the typedef and perform the edits there.

Right-click the enum, open typedef. Right-click THAT enum and you'll be able to modify its properties. When you save/close that typedef, it'll update every instance for you.
__________________
----
There are 10 types of people. Those who understand binary, and those that do not.
Team #1164 - Project NEO Robotics
Reply With Quote
  #21   Spotlight this post!  
Unread 18-02-2010, 09:48
bobo bobo is offline
Registered User
FRC #2986
 
Join Date: Jan 2009
Location: Oklahoma City
Posts: 1
bobo is an unknown quantity at this point
Re: sample code to move robot autonomously

Hey Luke (or anybody out there) . Why doesn't the default autonomous code work!!?? I did all the updates, re-iimaged the cRio, configured the camera but the i get no image!! Your code works. At least we got something happening here, but the image is a no show! Please help!
Thanks.
Reply With Quote
  #22   Spotlight this post!  
Unread 19-02-2010, 14:16
proman007's Avatar
proman007 proman007 is offline
Registered User
AKA: Proffitt
FRC #2369 (Maximus Roboticus)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Oklahoma
Posts: 2
proman007 is an unknown quantity at this point
Re: sample code to move robot autonomously

That code was a lot of help, thanks. Is it possible to press a button and have the same steps used for the autonomous kicking in teleop?
Reply With Quote
  #23   Spotlight this post!  
Unread 20-02-2010, 08:37
Luke Pike's Avatar
Luke Pike Luke Pike is offline
Programmer
FRC #1501 (THRUST)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Huntington
Posts: 114
Luke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to all
Re: sample code to move robot autonomously

Glad it helped you.

The easiest way to use this code in teleop also is to make it a subvi. To do this, select all the code for the state machine (while loop included). Then, go to the "Edit" menu and select "Make SubVI". LabVIEW with put the code in a new vi and automatically creat the inputs for you. Save this vi, then you can drop it in teleop to use it.

Note: for this to work, the state machine must stop the loop when it's done. If you want to run the state machine in autonomous more then once, you can make another state machine which calls the sub state machine.
__________________
Twitter Profile
Reply With Quote
  #24   Spotlight this post!  
Unread 21-02-2010, 19:17
SidneySalvo SidneySalvo is offline
Registered User
FRC #1691
 
Join Date: Jan 2008
Location: Sidney
Posts: 22
SidneySalvo is an unknown quantity at this point
Re: sample code to move robot autonomously

Luke i'm having some major problems...I make that autonomous example you attached as my autonomous independent and change the references to fit our drive style. But when i try to run the program i says disabled, enabled, and then watchdog not fed. This 'watchdog not fed' happens not matter what i change to the code, is there any hope for me?!?
__________________
The Universe is filled with magical things, patiently waiting for our wits to grow sharper.
Reply With Quote
  #25   Spotlight this post!  
Unread 21-02-2010, 20:18
Luke Pike's Avatar
Luke Pike Luke Pike is offline
Programmer
FRC #1501 (THRUST)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Huntington
Posts: 114
Luke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to allLuke Pike is a name known to all
Re: sample code to move robot autonomously

I'm not sure what could be causing your problems, Sidney. The Autonomous Independent vi reference is set in Begin.vi. Did you update it to point to the new vi? I don't have access to a computer with LabVIEW right now. Worst case, use my vi as a reference and code it in your Autonomous Independent vi.
__________________
Twitter Profile
Reply With Quote
  #26   Spotlight this post!  
Unread 25-02-2010, 08:53
johncap100 johncap100 is offline
Registered User
FTC #0658
 
Join Date: Aug 2009
Location: Capital High School
Posts: 95
johncap100 is an unknown quantity at this point
Re: sample code to move robot autonomously

Hey Luke you were such great help, i am trying to incorporate the solenoid and compressor into my existing robot main program. can i maybe do like you said a couple of posts back and make it a sub vi and then just drop it into my autononmous and teleop vi?
thanks much for you help
Reply With Quote
Reply


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
sample code johncap100 NI LabVIEW 2 01-02-2010 08:18
Missing sample code ajdecker1022 Java 3 28-01-2010 19:39
Sample Code Belly Programming 1 21-01-2010 14:34
Sample Code Japper Programming 2 01-12-2008 22:36
Sample PID code??? EHaskins Programming 14 08-08-2006 14:18


All times are GMT -5. The time now is 18:11.

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