Go to Post And when I heard the word "Mentor Round" - you had me SOLD. - Chris is me [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 18-01-2013, 01:21
cammy:)'s Avatar
cammy:) cammy:) is offline
Cammy
FRC #3008 (Kalani Falcons)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Hawaii
Posts: 11
cammy:) is an unknown quantity at this point
Basic Autonomous Structures

So this is only my second week of being in FRC to be exact, so I'm pretty new here... forgive me if my questions are... weird, or whatever.

Recently I've been trying to teach myself LabView, with some slow progress.... however, some assistance from more experienced people could help a lot.

Right now I'm trying to program a simple practice autonomous program, allowing the robot to simply drive in a square when the button is clicked. It said that it was runnable, however when I tried to run it, it said there were errors with the 2-motor drive open WPI and some other things as well... I attached a picture of the current program and one of my SubVIs (hopefully it appears.......)

Anyway, it'd be really helpful if someone... told me if anything's wrong with my program, or if there are any basic structures that I'm missing....? Yeah... just let me know what to change to make it work.

Thank you!
Attached Thumbnails
Click image for larger version

Name:	a program.PNG
Views:	90
Size:	25.1 KB
ID:	13556  Click image for larger version

Name:	sub Vi.PNG
Views:	49
Size:	21.0 KB
ID:	13557  
__________________
☁ ☁
┏┷┷┓ ♪
▌▣﹏▣ ▌♫
Reply With Quote
  #2   Spotlight this post!  
Unread 18-01-2013, 06:39
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: Basic Autonomous Structures

One suggestion, for the code on the left is to consider using a For loop for things that run a computed number of iterations. It is less flexible than a while loop, but takes less code and is more obvious that it runs four iterations. I don't believe you need the delay in the loop. Each movement will take far longer than 50ms, so the delay is doing no harm, but having no effect but to generate a bit more scheduling code.

The code on the right seems to assume that it takes 20ms for the Tank RobotDrive icon to return, when in reality, it is closer to 1ms. That means your loop will finish really quickly and not do what you want. Place a 20ms delay into your loop, similar to how you did the code on the left.

As for the error messages, that is most likely because you have already opened the RobotDrive with PWM 1 and 2 elsewhere in your program, such as in Begin.

While it is possible to open and close the autonomous resources directly like this, it is more common to open them all in Begin and store them in a named registry. Then in autonomous and elsewhere, you retrieve them by name. Those icons are next to the Open in the palette.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 18-01-2013, 16:18
cammy:)'s Avatar
cammy:) cammy:) is offline
Cammy
FRC #3008 (Kalani Falcons)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Hawaii
Posts: 11
cammy:) is an unknown quantity at this point
Re: Basic Autonomous Structures

ohh.... thank you! That helps so much.

so just making sure... I should take out the 50 millisecond wait from the main one and add a 20 millisecond wait in the SubVI. and also taking out the open and close part.

well, thanks it really helps!
__________________
☁ ☁
┏┷┷┓ ♪
▌▣﹏▣ ▌♫
Reply With Quote
  #4   Spotlight this post!  
Unread 18-01-2013, 21:11
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: Basic Autonomous Structures

Those are the suggestions.

Good luck.
Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 19-01-2013, 00:28
Doc Wu's Avatar
Doc Wu Doc Wu is offline
Registered User
AKA: Al Gritzmacher
FRC #1507 (Warlocks)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2003
Location: Lockport NY
Posts: 206
Doc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant futureDoc Wu has a brilliant future
Re: Basic Autonomous Structures

Quote:
Originally Posted by Greg McKaskle View Post
Those are the suggestions.

Good luck.
Greg McKaskle
Rather than reinvent the wheel, I'd also recommend looking at the examples in the Default Robot Project. There are two ways of doing a simple autonomous there inside disabled structures. All you need to do to play with them is enable them and change them to do what you need.

Once you understand what is happening there, you can emulate what they did when you write your own code.
__________________
-= Mentor Lockport Warlocks -=- Team 1507 =-
Amateur Radio Callsign: AE2T

2015 Robot Inspector - Pittsburgh, Champs. Judge Observer - Champs
2014 Robot Inspector - Tech Valley, Fingerlakes, Buckeye, Championship
2013 Robot Inspector - Fingerlakes, Buckeye, Championship
2012 Robot Inspector - Fingerlakes, Buckeye, Championship
2012 Website Evaluator - Fingerlakes, Buckeye, Championship
2011 Robot Inspector - Fingerlakes 2011 Safety Advisor - Fingerlakes

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 04:04.

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