Go to Post We can't be afraid to critique the existing system. If we don't, how will it ever get better? - Jaine Perotti [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 14-03-2011, 23:09
beth_hadley beth_hadley is offline
Registered User
FRC #0548
 
Join Date: Feb 2011
Location: Northville
Posts: 6
beth_hadley is an unknown quantity at this point
Autonomous Controls vs. Constants

Just wondering....has anyone else had issues with variables in autonomous? In our code, we like to make our variables controls so that they are easily adjustable from the front panel of autonomous. This worked fine while testing it at home. When we got to the competition, it became obvious that the code could not recognize these control values, even though we always set "make values default". There were no errors, but the robot practically made up its own numbers rather than use the ones we gave it. For example, rather than driving the 100 inches we set in the control, it drove something like 512 inches. Very random....We fixed the problem by changing all the controls back to constants. I think I remember a similar problem occurring last year with controls and constants, but I'm not sure. As a side note, the controls work fine everywhere else in the code (Begin, telop, periodic tasks, etc.)

Did anyone else have this issue? I'm curious as to why this occurs? It's got to be some kind of Labview thing...and word to the wise - USE CONSTANTS IN AUTONOMOUS!
Reply With Quote
  #2   Spotlight this post!  
Unread 14-03-2011, 23:19
davidalln's Avatar
davidalln davidalln is offline
World's Worst Coder
AKA: David Allen
FRC #2415 (The Westminster Wiredcats)
Team Role: Programmer
 
Join Date: Mar 2009
Rookie Year: 2008
Location: Atlanta, GA
Posts: 108
davidalln is on a distinguished road
Send a message via AIM to davidalln
Re: Autonomous Controls vs. Constants

If the code only reads from a variable and never changes it, you should always set it as a constant. Its safer, faster, and keeps you from accidentally changing values you don't want to change.
__________________
SANTOSH ANDREW DECKER RICK WYNNIE SEAN DEREK MATT
(alamo (semis), p'tree (CHAMPS!), nc (CHAMPS!), newton (quarters))


Best four years of my life. Thanks to everyone who made it happen.
Reply With Quote
  #3   Spotlight this post!  
Unread 15-03-2011, 01:45
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: Autonomous Controls vs. Constants

I haven't noticed any difference with deploying versus building and putting the files on the c RIO, and we have controls EVERYWHERE. There are about 20 in autonomous, with two that are actually variable. The thing is, I used all of them whilst testing.

For the set as default thing, I noticed that you can select all of the controls and then go to edit -> Make current values default to do it faster. You probably already know that though.

Should I quickly change all of them into constants? That would make it much much harder to debug and tune.
Reply With Quote
  #4   Spotlight this post!  
Unread 15-03-2011, 09:36
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,579
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Autonomous Controls vs. Constants

We've used controls in autonomous for the last 3 years, and haven't had random behavior. You should post your code.
Reply With Quote
  #5   Spotlight this post!  
Unread 15-03-2011, 23:23
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,752
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: Autonomous Controls vs. Constants

Using controls in the way you describe is equivalent to using constants. There is no reason to change things to controls.

Just to be clear, though, there is a difference between controls that are connected to the connector pane and are actually parameters, and controls that are not.

If the controls are connected to the connector, the value is passed in or the default value is used.

If not connected, the initial value of the control is the default value, but programmatic or interactive changes persist until it leaves memory.

If you have concerns about the value being used, load the code interactively and see if the default values are the correct ones, or if the default was set to the incorrect value last time.

Greg McKaskle
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 20:47.

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