View Single Post
  #8   Spotlight this post!  
Unread 27-09-2011, 19:17
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Parameters file for quick code updates

...I was actually writing code to do this not too long ago...

My plan was to save an array of constant/name pairs. I currently use something like this to lookup non-setpoint constants for the elevator (such as gains, limits, sensor calibrations, etc.) on a per-robot basis. What it basically does is stores an array of name/comp/pratice values, and finds the right one each time the variable is requested. I have no speed issues doing this, although I am only using it for about 20 constants.

I use a scripted autonomous system (Beescript) that allows me to write an auto script that looks something like this:
Code:
#Go To Score HI
ELEV_SET_STATE score_hi
# Drive Straight 167" 6ft/sec
DRIVE_STRAIGHT 167 6
#Score (no arguments)
ELEV_SCORE
But due to the modular design of the interpreter, the list of possible commands (and the functions for these commands) is separate from the interpreter itself (I actually debugged all of the Beescript code using a function that popped up with message boxes in a blocking way). And I was thinking of just adding a command to set constant, then running the same interpreter to read the file. Writing the files would be even simpler - Just print a new line for each constant in storage, plus a few comments here and there.

Realistically, the LV interface is good enough for fine-tuning work. It gives me a UI to change variables and I don't have to write any code at all (always a good thing). What the script gives you is the ability to change constants rapidly, without re-downloading. The benefits are HUGE - seriously. This is awesome.

@ajlapp, feel free to use Beescript (get it here).
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
Reply With Quote