Go to Post I should have gone to IRI years ago. - 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
  #1   Spotlight this post!  
Unread 04-11-2015, 10:28
2386programming 2386programming is offline
Registered User
FRC #2386 (Trojans)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Burlington
Posts: 34
2386programming is an unknown quantity at this point
Multiple Autonomous Actions

My team is working on some autonomous code for an off season event we are attending, and we have a simple drive backwards autonomous. But we were hoping to at least pick up a tote and drive back. This is the code that we currently have...

Click image for larger version

Name:	Picture1.png
Views:	73
Size:	70.7 KB
ID:	19384
Reply With Quote
  #2   Spotlight this post!  
Unread 04-11-2015, 11:24
Alpha Beta's Avatar
Alpha Beta Alpha Beta is offline
Strategy, Scouting, and LabVIEW
AKA: Mr. Aaron Bailey
FRC #1986 (Team Titanium)
Team Role: Coach
 
Join Date: Mar 2008
Rookie Year: 2007
Location: Lee's Summit, Missouri
Posts: 763
Alpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond repute
Re: Multiple Autonomous Actions

It sounds like you want to lift the tote before you start moving backwards. You can link while loops together in sequence and put the code for lifting the tote in the first loop, and your drive backwards code in the 2nd loop. The first loop will not send information outside of its loop until it finishes, and the 2nd loop will not start until its inputs are filled. You could end the first loop on timing, number of loop iterations, or based on some robot feedback that lets you know the tote has been lifted.
Attached Thumbnails
Click image for larger version

Name:	2386.png
Views:	56
Size:	36.3 KB
ID:	19386  
__________________
Regional Wins: 2016(KC), 2015(St. Louis, Queen City), 2014(Central Illinois, KC), 2013(Hub City, KC, Oklahoma City), 2012(KC, St. Louis), 2011(Colorado), 2010(North Star)
Regional Chairman's Award: 2014(Central Illinois), 2009(10,000 Lakes)
Engineering Inspiration: 2016(Smoky Mountain), 2012(Kansas City), 2011(Denver)
Dean's List Finalist 2016(Jacob S), 2014(Cameron L), 2013(Jay U), 2012(Laura S), 2011(Dominic A), 2010(Collin R)
Woodie Flowers Finalist 2013 (Aaron Bailey)
Championships: Sub-Division Champion (2016), Finalist (2013, 2010), Semifinalist (2014), Quaterfinalist (2015, 2012, 2011)
Other Official Awards: Gracious Professionalism (2013) Entrepreneurship (2013), Quality (2015, 2015, 2013), Engineering Excellence (Champs 2013, 2012), Website (2011), Industrial Design (Archimedes/Tesla 2016, 2016, 2015, Newton 2014, 2013, 2011), Innovation in Control (2014, Champs 2010, 2010, 2008, 2008), Imagery (2009), Regional Finalist (2016, 2015, 2008)
Reply With Quote
  #3   Spotlight this post!  
Unread 05-11-2015, 10:09
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 271
Bpk9p4 is on a distinguished road
Re: Multiple Autonomous Actions

Quote:
Originally Posted by Alpha Beta View Post
It sounds like you want to lift the tote before you start moving backwards. You can link while loops together in sequence and put the code for lifting the tote in the first loop, and your drive backwards code in the 2nd loop. The first loop will not send information outside of its loop until it finishes, and the 2nd loop will not start until its inputs are filled. You could end the first loop on timing, number of loop iterations, or based on some robot feedback that lets you know the tote has been lifted.
I really like this method. We used it this last year with great results. The only problem i have with it and am not sure how to solve is if you stop the Auto in the middle the only way to reset the while loops is to reboot the code. Do you have a solution on how to fix this
__________________
2015 Midwest Regional Finalist
2015 Central Illinois Regional Winner
2015 Newton Division Finalist
2015 Newton Quality Award
Reply With Quote
  #4   Spotlight this post!  
Unread 05-11-2015, 10:28
Alpha Beta's Avatar
Alpha Beta Alpha Beta is offline
Strategy, Scouting, and LabVIEW
AKA: Mr. Aaron Bailey
FRC #1986 (Team Titanium)
Team Role: Coach
 
Join Date: Mar 2008
Rookie Year: 2007
Location: Lee's Summit, Missouri
Posts: 763
Alpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond repute
Re: Multiple Autonomous Actions

Quote:
Originally Posted by Bpk9p4 View Post
I really like this method. We used it this last year with great results. The only problem i have with it and am not sure how to solve is if you stop the Auto in the middle the only way to reset the while loops is to reboot the code. Do you have a solution on how to fix this
Try briefly enabling in teleop and then going back to auto. We often did this naturally during our tuning sessions to make sure our pneumatics were fully charged, or to reconfigure the robot back to it's starting position.
__________________
Regional Wins: 2016(KC), 2015(St. Louis, Queen City), 2014(Central Illinois, KC), 2013(Hub City, KC, Oklahoma City), 2012(KC, St. Louis), 2011(Colorado), 2010(North Star)
Regional Chairman's Award: 2014(Central Illinois), 2009(10,000 Lakes)
Engineering Inspiration: 2016(Smoky Mountain), 2012(Kansas City), 2011(Denver)
Dean's List Finalist 2016(Jacob S), 2014(Cameron L), 2013(Jay U), 2012(Laura S), 2011(Dominic A), 2010(Collin R)
Woodie Flowers Finalist 2013 (Aaron Bailey)
Championships: Sub-Division Champion (2016), Finalist (2013, 2010), Semifinalist (2014), Quaterfinalist (2015, 2012, 2011)
Other Official Awards: Gracious Professionalism (2013) Entrepreneurship (2013), Quality (2015, 2015, 2013), Engineering Excellence (Champs 2013, 2012), Website (2011), Industrial Design (Archimedes/Tesla 2016, 2016, 2015, Newton 2014, 2013, 2011), Innovation in Control (2014, Champs 2010, 2010, 2008, 2008), Imagery (2009), Regional Finalist (2016, 2015, 2008)
Reply With Quote
  #5   Spotlight this post!  
Unread 05-11-2015, 11:17
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 271
Bpk9p4 is on a distinguished road
Re: Multiple Autonomous Actions

hum ok i will give this a try. Do you still place all your blocks in the Auto area?
__________________
2015 Midwest Regional Finalist
2015 Central Illinois Regional Winner
2015 Newton Division Finalist
2015 Newton Quality Award
Reply With Quote
  #6   Spotlight this post!  
Unread 05-11-2015, 11:18
aeastet aeastet is online now
Programming Mentor
AKA: Tim Easterling
FRC #6043 (Allegan Tigers Robotics)
Team Role: Coach
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Holland, MI
Posts: 116
aeastet is an unknown quantity at this point
Re: Multiple Autonomous Actions

You can use a state machine. We posted our code on line. Take a look at what we did. It will help you a lot for next year if you do. Our autonomous code look very simple and is very easy to edit. You can stop and start it with out having to reboot.

Look up team 107 code post

http://www.chiefdelphi.com/forums/sh...d.php?t=137046

If you have any questions let me know.
Reply With Quote
  #7   Spotlight this post!  
Unread 05-11-2015, 11:51
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 271
Bpk9p4 is on a distinguished road
Re: Multiple Autonomous Actions

cool i will take a look at it. We have used state machine in the past however i do not like not being able to see everything at once. Also it is hard to move states around. Do you have any ways around these problems
__________________
2015 Midwest Regional Finalist
2015 Central Illinois Regional Winner
2015 Newton Division Finalist
2015 Newton Quality Award
Reply With Quote
  #8   Spotlight this post!  
Unread 05-11-2015, 12:25
aeastet aeastet is online now
Programming Mentor
AKA: Tim Easterling
FRC #6043 (Allegan Tigers Robotics)
Team Role: Coach
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Holland, MI
Posts: 116
aeastet is an unknown quantity at this point
Re: Multiple Autonomous Actions

I our code everything is handled using enumerated value arrays. The enumerated values is a strict type def. It is very east to move things around. We had nine different auto modes this year and it only took minutes to make a new one.
Reply With Quote
  #9   Spotlight this post!  
Unread 05-11-2015, 12:32
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 323
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Multiple Autonomous Actions

Quote:
Originally Posted by Bpk9p4 View Post
... i do not like not being able to see everything at once...
Along this line, as you get more complex you will end up having code running off the screen (bad practice), so you really limit yourself in that regard. If you give meaningful names to your states it should actually be far easier to navigate and becomes self commenting.

Quote:
Originally Posted by Bpk9p4 View Post
Also it is hard to move states around. Do you have any ways around these problems
I am not sure what you mean by not being able to move states around, do you mean physically move on the block diagram, or changing the sequence?

If you limit each state to small functions you can make it more modular and keep each state smaller. This may force you to pass more data however.

This is the structure I like to use to pass data between states:
Click image for larger version

Name:	State Machine Example.png
Views:	33
Size:	38.0 KB
ID:	19396
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
Reply With Quote
  #10   Spotlight this post!  
Unread 05-11-2015, 13:08
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 271
Bpk9p4 is on a distinguished road
Re: Multiple Autonomous Actions

Quote:
Originally Posted by wt200999 View Post
Along this line, as you get more complex you will end up having code running off the screen (bad practice), so you really limit yourself in that regard. If you give meaningful names to your states it should actually be far easier to navigate and becomes self commenting.



I am not sure what you mean by not being able to move states around, do you mean physically move on the block diagram, or changing the sequence?

If you limit each state to small functions you can make it more modular and keep each state smaller. This may force you to pass more data however.

This is the structure I like to use to pass data between states:
Attachment 19396
i was meaning more moving the sequence. i really liked just being able to copy and paste and move things around. Are code is posted here if you want to see how we did it. http://www.chiefdelphi.com/media/papers/3152

Also i really like your type def idea that make it much easier to move things around. I will give that a try.
__________________
2015 Midwest Regional Finalist
2015 Central Illinois Regional Winner
2015 Newton Division Finalist
2015 Newton Quality Award

Last edited by Bpk9p4 : 05-11-2015 at 13:15.
Reply With Quote
  #11   Spotlight this post!  
Unread 05-11-2015, 15:01
Bpk9p4's Avatar
Bpk9p4 Bpk9p4 is offline
Registered User
FRC #1756
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Illinios
Posts: 271
Bpk9p4 is on a distinguished road
Re: Multiple Autonomous Actions

if you guys are interested are team with PlayingWithFusion help just released are new mini Labview robot for software development. We have been using it the past year to teach students Labview and test new software

Here is the link for the release video https://www.youtube.com/watch?v=EFmnmp_VHHU

http://playingwithfusion.com/product...=65&catid=1009
__________________
2015 Midwest Regional Finalist
2015 Central Illinois Regional Winner
2015 Newton Division Finalist
2015 Newton Quality Award
Reply With Quote
  #12   Spotlight this post!  
Unread 06-11-2015, 10:35
2386programming 2386programming is offline
Registered User
FRC #2386 (Trojans)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Burlington
Posts: 34
2386programming is an unknown quantity at this point
Re: Multiple Autonomous Actions

Connecting while loops is working well. Is there anyway to make one action go before the other? Because currently, both actions are running at the same time.
Reply With Quote
  #13   Spotlight this post!  
Unread 06-11-2015, 10:59
Alpha Beta's Avatar
Alpha Beta Alpha Beta is offline
Strategy, Scouting, and LabVIEW
AKA: Mr. Aaron Bailey
FRC #1986 (Team Titanium)
Team Role: Coach
 
Join Date: Mar 2008
Rookie Year: 2007
Location: Lee's Summit, Missouri
Posts: 763
Alpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond reputeAlpha Beta has a reputation beyond repute
Re: Multiple Autonomous Actions

Quote:
Originally Posted by 2386programming View Post
Connecting while loops is working well. Is there anyway to make one action go before the other? Because currently, both actions are running at the same time.
It doesn't sound like they are connected then. Make sure something (anything) in the first loop creates an output tunnel on the right side of that loop and is then wired to an input tunnel on the left and side of the 2nd loop.

If you think you've already done that, then post a picture of your code and we'll see if we notice anything else.

PS. It's also possible that your first loop triggers the lifting of a tote, but doesn't actually wait until it's lifted before the loop finishes. If the first loop time is short enough it may be difficult to tell visually that it starts before the second loop.
__________________
Regional Wins: 2016(KC), 2015(St. Louis, Queen City), 2014(Central Illinois, KC), 2013(Hub City, KC, Oklahoma City), 2012(KC, St. Louis), 2011(Colorado), 2010(North Star)
Regional Chairman's Award: 2014(Central Illinois), 2009(10,000 Lakes)
Engineering Inspiration: 2016(Smoky Mountain), 2012(Kansas City), 2011(Denver)
Dean's List Finalist 2016(Jacob S), 2014(Cameron L), 2013(Jay U), 2012(Laura S), 2011(Dominic A), 2010(Collin R)
Woodie Flowers Finalist 2013 (Aaron Bailey)
Championships: Sub-Division Champion (2016), Finalist (2013, 2010), Semifinalist (2014), Quaterfinalist (2015, 2012, 2011)
Other Official Awards: Gracious Professionalism (2013) Entrepreneurship (2013), Quality (2015, 2015, 2013), Engineering Excellence (Champs 2013, 2012), Website (2011), Industrial Design (Archimedes/Tesla 2016, 2016, 2015, Newton 2014, 2013, 2011), Innovation in Control (2014, Champs 2010, 2010, 2008, 2008), Imagery (2009), Regional Finalist (2016, 2015, 2008)

Last edited by Alpha Beta : 06-11-2015 at 11:01.
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


All times are GMT -5. The time now is 08:27.

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