Go to Post I believe everyone should give a modicum of repsect to each person they meet for the first time. After that it is up to them as to whether to give you a reason to increase that respect or detract from it. - Al Skierkiewicz [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 09-01-2012, 13:57
JohnGilb JohnGilb is offline
Programming Mentor, Drive Mentor
FRC #0488
 
Join Date: Mar 2011
Rookie Year: 2003
Location: Redmond, WA
Posts: 116
JohnGilb has a spectacular aura aboutJohnGilb has a spectacular aura aboutJohnGilb has a spectacular aura about
What are you doing different from last year?

I was curious what architecture changes veteran LabVIEW teams are planning.

For us, here are the big items:
  • Increase encapsulation of robot systems (last year's robot was a tangled mess of dependencies, we'd like a much cleaner way for the various parts of the robot to communicate)
  • Read/Write key robot parameters to disk, and modify them on the fly from the DS Dashboard (don't want to recompile the code if we need to change a PID constant)
  • Read autonomous program from disk (again, want to limit recompilation)
  • User Events for communication between autonomous and the robot core (allowing for much easier request/response between the two, and decoupling them since the event acts as an interface)

Anybody else planning on making some big changes?
Reply With Quote
  #2   Spotlight this post!  
Unread 09-01-2012, 14:31
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,751
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: What are you doing different from last year?

All of those sound like good enhancements.

I'd also add that the teleop does little beyond calculating and updating set points and updating state machine triggers. If you can build in a logging capability, it will likely pay for itself in understanding how the robot is running.

Related to logging, the framework code has a file called Elapsed Times in the Support Code folder. If you place it into your teleop, vision, and other control loops, it will give a very easy way to monitor rates of the robot system.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 09-01-2012, 15:27
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,113
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: What are you doing different from last year?

Quote:
Originally Posted by JohnGilb View Post
I was curious what architecture changes veteran LabVIEW teams are planning.

For us, here are the big items:
  • Increase encapsulation of robot systems (last year's robot was a tangled mess of dependencies, we'd like a much cleaner way for the various parts of the robot to communicate)
  • Read/Write key robot parameters to disk, and modify them on the fly from the DS Dashboard (don't want to recompile the code if we need to change a PID constant)
  • Read autonomous program from disk (again, want to limit recompilation)
  • User Events for communication between autonomous and the robot core (allowing for much easier request/response between the two, and decoupling them since the event acts as an interface)

Anybody else planning on making some big changes?
We were thinking of doing something very similar to this - our other programmer and I have spent hours talking about a better way to structure our code to allow for a lot of this. We have a pretty good structure mostly written now, and we'll see how it goes from there...
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android
Reply With Quote
  #4   Spotlight this post!  
Unread 09-01-2012, 15:38
JohnGilb JohnGilb is offline
Programming Mentor, Drive Mentor
FRC #0488
 
Join Date: Mar 2011
Rookie Year: 2003
Location: Redmond, WA
Posts: 116
JohnGilb has a spectacular aura aboutJohnGilb has a spectacular aura aboutJohnGilb has a spectacular aura about
Re: What are you doing different from last year?

Could you elaborate a bit? I'd like to know how other people are approaching this problem.
Reply With Quote
  #5   Spotlight this post!  
Unread 09-01-2012, 16:45
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,113
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: What are you doing different from last year?

Quote:
Originally Posted by JohnGilb View Post
Could you elaborate a bit? I'd like to know how other people are approaching this problem.
Well, we'd like to first have autonomous (hybrid) code much more integrated with teleop code. Ideally, we'd have some sort of autonomous script on the robot, which would be put into a state machine to execute autonomous tasks. Now, these "auto states" could also be accessed in teleop for increased automation. Make sense?

As for other stuff we'd like to do, we'd also like to have a lot of parameters stored in (INI?) files on the robot for easier loop tuning. Last year, I actually wrote some FTP VIs to update PID constants on the fly, so we might use something to that extent again.

As for other stuff, a lot of it isn't really that well fleshed out yet (we have a good idea in our heads, but we haven't written too much code yet). If you have any questions about specific code parts, I'd be happy to answer them as best I can.
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android
Reply With Quote
  #6   Spotlight this post!  
Unread 09-01-2012, 18:20
JohnGilb JohnGilb is offline
Programming Mentor, Drive Mentor
FRC #0488
 
Join Date: Mar 2011
Rookie Year: 2003
Location: Redmond, WA
Posts: 116
JohnGilb has a spectacular aura aboutJohnGilb has a spectacular aura aboutJohnGilb has a spectacular aura about
Re: What are you doing different from last year?

It all sounds great!

One thing I've been struggling with is along the lines of saving/updating "ini" files on the robot. Ideally you'd be able to modify key robot parameters from the Driver Station dashboard (so you don't need any additional computers).

I've been trying to figure out the best way to do this. My general requirements have been as follows:
-No extra computers are needed to make on-the-fly changes
-Newer versions of Robot Code (that change the # or type of constants) should not require recompile/redeploy of DS Dashboard code

So far, here was what we had come up with:
1) Robot reads constants from XML document on cRIO
2) Robot unflattens from XML, turning it into a typedef for use internally
3) If robot gets a request from DS as to what the current constants are, it flattens the tyepdef to XML and sends it as a string
4) DS can modify the string (typedefs flattened to xml are quite human-readable), and send back a new one (after doing some quick verification to make sure it's still valid)
5) Robot receives the data, saves it, and applies the new constants to the running program

Sending XML helps decouple the DS and the Robot, but at the cost of needing to do some kind of XML validation again somewhere. I'm wondering if there is a more elegant way to do this.
Reply With Quote
  #7   Spotlight this post!  
Unread 09-01-2012, 20:48
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,113
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: What are you doing different from last year?

Instead of XML data, can I suggest using an INI File for storing robot parameters? There's a good thread on using parameter files here.
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android
Reply With Quote
  #8   Spotlight this post!  
Unread 09-01-2012, 21:55
Jester Jester is offline
Labview Maniac
AKA: Cody Ripley
FRC #3144 (Krypto-Knights)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Oklahoma City, OK
Posts: 22
Jester is an unknown quantity at this point
Re: What are you doing different from last year?

Quote:
Originally Posted by plnyyanks View Post
Instead of XML data, can I suggest using an INI File for storing robot parameters? There's a good thread on using parameter files here.
Thanks for the link! I was actually unaware that .ini files could be used for value filling.

My changes as a 3rd year programmer:
  • Utilizing autonomous functions within the teleop period (automated aiming+velocity control)
  • Using more sub VIs to keep everything clean and tidy
  • Customizing the dashboard to only display what we need
  • Using more I/O, last year we used only the pressure switch :/
Reply With Quote
  #9   Spotlight this post!  
Unread 09-01-2012, 22:10
JohnGilb JohnGilb is offline
Programming Mentor, Drive Mentor
FRC #0488
 
Join Date: Mar 2011
Rookie Year: 2003
Location: Redmond, WA
Posts: 116
JohnGilb has a spectacular aura aboutJohnGilb has a spectacular aura aboutJohnGilb has a spectacular aura about
Re: What are you doing different from last year?

Quote:
Originally Posted by plnyyanks View Post
Instead of XML data, can I suggest using an INI File for storing robot parameters? There's a good thread on using parameter files here.
I'm still reading some of the links in the other thread, but what would you say is the comparative advantage of using INI over XML?

One of the things I like about the Flatten/Unflatten from XML is that all my variables are strongly typed in the robot, and I can reuse common names for things like PID gains since their parent typdef has a unique name. In addition, any changes I make to the typedefs themselves are transparent to the flattening process, so I don't need to make additional code changes.

Are there similar benefits when using INI?
Reply With Quote
  #10   Spotlight this post!  
Unread 09-01-2012, 22:32
Jester Jester is offline
Labview Maniac
AKA: Cody Ripley
FRC #3144 (Krypto-Knights)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Oklahoma City, OK
Posts: 22
Jester is an unknown quantity at this point
Re: What are you doing different from last year?

Quote:
Originally Posted by JohnGilb View Post
I'm still reading some of the links in the other thread, but what would you say is the comparative advantage of using INI over XML?

One of the things I like about the Flatten/Unflatten from XML is that all my variables are strongly typed in the robot, and I can reuse common names for things like PID gains since their parent typdef has a unique name. In addition, any changes I make to the typedefs themselves are transparent to the flattening process, so I don't need to make additional code changes.

Are there similar benefits when using INI?
It seems to me that ini would be an easier to read outside of labview, but the intellectual value of both seem similar.
Reply With Quote
  #11   Spotlight this post!  
Unread 09-01-2012, 22:51
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,113
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: What are you doing different from last year?

Quote:
Originally Posted by Jester View Post
It seems to me that ini would be an easier to read outside of labview, but the intellectual value of both seem similar.
LabVIEW actually has a whole palate for reading and writing INI files. I personally like them because they're organized into sections, and have an easy key/value system which can easily be parsed by LV.

A sample INI File is like this (with two sections, and associated key/value pairs):
Code:
[pidConstants]
p=.1
i=0
d=.01

[drivePID]
p=.2
i=0
d=.02
In LV, you can work with different sections independently, and easily read/write to your files. Take a look through the Configuration Files Palate (Programming -> File IO -> Configuration File VIs). I also think there are some examples installed by default that highlight their use.

Now, you could also use XML files to the same result, and I certainly won't stop you from doing that, but my personal opinion is that it's best to use an INI file in this situation.

Quote:
Originally Posted by JohnGilb View Post
Are there similar benefits when using INI?
Actually, I'm not exactly sure the answer to that question. I know you can set the default value for data read from an INI file, but I'm not sure if/how to do it using a TypeDef. You might have to write a subVI. Hmmm, I'll have to think about that one.
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android

Last edited by plnyyanks : 09-01-2012 at 22:55. Reason: answered another question I missed the first time
Reply With Quote
  #12   Spotlight this post!  
Unread 10-01-2012, 02:25
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: What are you doing different from last year?

Also look in the LabVIEW for FRC 2012 examples. There is a new example to show how the Configuration File API can be used.
Reply With Quote
  #13   Spotlight this post!  
Unread 10-01-2012, 02:59
SuperS_5's Avatar
SuperS_5 SuperS_5 is offline
[Certified LabVIEW Developer]
FRC #1219
 
Join Date: Dec 2010
Rookie Year: 2010
Location: Canada
Posts: 140
SuperS_5 will become famous soon enoughSuperS_5 will become famous soon enough
I prefer ini files more then xml files for settings. I find ini films easier to read in any text editor. This biggest advantage is the free openG ini toolkit. I use a single cluster with all my save data, and just write it into the toolkit VIs. As you cluster evolves, you don't get file mismatch errors. The LabVIEW built in XML primitives will error out in this case. To me this is big, because software always grows and eventually will cause the saved data cluster to change.
__________________
Mike B
Reply With Quote
  #14   Spotlight this post!  
Unread 10-01-2012, 03:50
mesamb1's Avatar
mesamb1 mesamb1 is offline
Registered User
AKA: Sam Bacon
FRC #1466 (Webb Robotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2004
Location: Knoxville
Posts: 93
mesamb1 is just really nicemesamb1 is just really nicemesamb1 is just really nicemesamb1 is just really nice
Re: What are you doing different from last year?

Back to your original question:
All most all of our autonomous routine this year should calls to subvi's. Anything that can possibly be used more then once will be in a subvi so that hopefully easing our debugging, and cutting down repeatedly writing the same task(something we did alot of last year).
We are also working with are electrical team to build a test bed with out of just motors and sensors. This way we have a way to make sure all of code works with out having to worry about the mechanical issues.
The technical change is to alter the vision code more to increase the speed. Our team has yet to be happy with the speed the vision system runs, but we think it can be slimmed down to run better in telop.
Reply With Quote
  #15   Spotlight this post!  
Unread 10-01-2012, 15:35
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,113
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: What are you doing different from last year?

Quote:
Originally Posted by plnyyanks View Post
Actually, I'm not exactly sure the answer to that question. I know you can set the default value for data read from an INI file, but I'm not sure if/how to do it using a TypeDef. You might have to write a subVI. Hmmm, I'll have to think about that one.
Here's your stupid Phil moment of the day. I got an answer to this about 10 minutes after I last posted, but didn't get the chance to sit down an do it.

To do this, all you have to do is flatten your data to a string and write that to the INI file, and then read it and unflatten it (just like you would with XML data). The only problem is that you can't read/edit the INI file in a text editor, but that problem is there whenever you use "flatten to string". Attached is some sample code to illustrate what I mean.
Attached Files
File Type: zip ini_example.zip (14.3 KB, 1 views)
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android
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 09:36.

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