Go to Post "When I joined the team, I was told that we'd be in the shop for six weeks. I STILL haven't seen a single boutique, and now they have me dumpster diving for robot parts! I quit!" - EricH [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 23-10-2012, 00:27
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Autonomous scripting language

As a side project, I have written a full scripting language for making autonomous modes based on a script instead of redeploying code. If you're interesting in seeing, the github repo is available here -> https://github.com/joelg236/ScriptReader/

To use it, either pull the repo or download as a zip file, and with netbeans, open the folder that contains the files as a Java project.

The ScriptReader file in src/org/reader/ScriptReader.java contains a static runScript(String) method, and you can use that to run a script. There is a main method that runs a file from the arguments run with. Use whatever you'd like.

There is a zip file that contains script examples and the jar file here -> https://github.com/joelg236/ScriptReader/downloads

Any questions, recommendations and interesting implementation possibilities are welcome. And of course, bugs.

Thanks,
Joel
__________________
All opinions are my own.
  #2   Spotlight this post!  
Unread 23-10-2012, 16:52
Hjelstrom's Avatar
Hjelstrom Hjelstrom is offline
Mentor
FRC #0987 (High Rollers)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2005
Location: Las Vegas
Posts: 146
Hjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond repute
Re: Autonomous scripting language

Very nice! We have been thinking about something similar for C++. The compile-download cycle is a real limitation when you're tweaking a complicated autonomous routine.

Quote:
Originally Posted by joelg236 View Post
As a side project, I have written a full scripting language for making autonomous modes based on a script instead of redeploying code. If you're interesting in seeing, the github repo is available here -> https://github.com/joelg236/ScriptReader/

To use it, either pull the repo or download as a zip file, and with netbeans, open the folder that contains the files as a Java project.

The ScriptReader file in src/org/reader/ScriptReader.java contains a static runScript(String) method, and you can use that to run a script. There is a main method that runs a file from the arguments run with. Use whatever you'd like.

There is a zip file that contains script examples and the jar file here -> https://github.com/joelg236/ScriptReader/downloads

Any questions, recommendations and interesting implementation possibilities are welcome. And of course, bugs.

Thanks,
Joel
  #3   Spotlight this post!  
Unread 23-10-2012, 17:28
CodeYeti's Avatar
CodeYeti CodeYeti is offline
FRC Addict
AKA: Matt Coffin
FRC #0662 (Rocky Mountain Robotics)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Colorado
Posts: 81
CodeYeti is an unknown quantity at this point
Re: Autonomous scripting language

Our team personally doesn't use this, but I think it deserves some exposure. Greyhound Lua provides another way to push code to the robot without restarting it. Bonus: its ALL of your code.

Heres a link to the project on bitbucket:
https://bitbucket.org/zombiezen/greyhound-lua
  #4   Spotlight this post!  
Unread 23-10-2012, 17:30
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: Autonomous scripting language

Very interesting.

I believe this is the first completely custom scripting language I've seen for FRC that attempts to provide a full programming environment - You have loops and conditional blocks and everything.

Our system executes commands in sequence, with numeric arguments. The majority of the code is LabVIEW native - We simply have a high-level script which guides the high-level actions (such as drive_straight distance speed, stop, turn heading speed, drive_straight distance speed, etc). This closely mirrors the C-function call system we use in VRC, where functions do all of the work and we call them in order with arguments.

I have also seen a system which are time-based - A command will be given with absolute or relative start/stop times, and the system schedules them all, but that system also had the majority of the core code in native blocks instead of the script.

It'd be interesting to debate the merits of putting more or less code into the scripts vs the native functions.
__________________
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
  #5   Spotlight this post!  
Unread 23-10-2012, 18:12
connor.worley's Avatar
connor.worley connor.worley is offline
Registered User
FRC #0973 (Greybots)
Team Role: Mentor
 
Join Date: Mar 2011
Rookie Year: 2010
Location: Berkeley/San Diego
Posts: 601
connor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond reputeconnor.worley has a reputation beyond repute
Re: Autonomous scripting language

Quote:
Originally Posted by Hjelstrom View Post
Very nice! We have been thinking about something similar for C++. The compile-download cycle is a real limitation when you're tweaking a complicated autonomous routine.
http://www.chiefdelphi.com/forums/sh...d.php?t=105624

Have a look there if you haven't yet. It was definitely interesting to write.
__________________
Team 973 (2016-???)
Team 5499 (2015-2016)
Team 254 (2014-2015)

Team 1538 (2011-2014)
2014 Driver (25W 17L 1T)
日本語でOK
  #6   Spotlight this post!  
Unread 23-10-2012, 19:11
McGurky's Avatar
McGurky McGurky is offline
Geek
AKA: Kyle McGurk
FRC #1716 (Redbird Robotics)
Team Role: College Student
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Houghton, MI
Posts: 291
McGurky is just really niceMcGurky is just really niceMcGurky is just really niceMcGurky is just really nice
Re: Autonomous scripting language

I would also suggest that you take into account that a lot of last minute changes to strategy might occur in cue for a variety of reasons(if you have ever been on a drive team, you know what I mean). Whatever your solution is for simplifying autonomous selection, make it something that your drivers will be able to change easily and with little hassle.

For us, it was more important for the drivers to focus on strategy than figuring out the binary codes of a selection panel, or a script like you have posted.

For this reason our team integrated the following tab into our dashboard.


This allowed our drivers to simply change the autonomous routine to a (theoretically) infinite amount of choices. It also allowed our team to adapt to nearly any strategy the alliance was planning.

Just my input into the discussion, take it for what its worth!
__________________
RTFM -Read The First Manual

You already are who you are, I may be able to show you a fancy trick or two, but the term "Better" is relative to the potential you already have.
Take a look at my website/Blog!
  #7   Spotlight this post!  
Unread 23-10-2012, 19:22
vinnie's Avatar
vinnie vinnie is offline
Registered User
FRC #3309 (Friarbots)
Team Role: College Student
 
Join Date: Oct 2010
Rookie Year: 2010
Location: Los Angeles / Anaheim
Posts: 107
vinnie has a reputation beyond reputevinnie has a reputation beyond reputevinnie has a reputation beyond reputevinnie has a reputation beyond reputevinnie has a reputation beyond reputevinnie has a reputation beyond reputevinnie has a reputation beyond reputevinnie has a reputation beyond reputevinnie has a reputation beyond reputevinnie has a reputation beyond reputevinnie has a reputation beyond repute
Re: Autonomous scripting language

Quote:
Originally Posted by McGurky View Post
I would also suggest that you take into account that a lot of last minute changes to strategy might occur in cue for a variety of reasons(if you have ever been on a drive team, you know what I mean). Whatever your solution is for simplifying autonomous selection, make it something that your drivers will be able to change easily and with little hassle.

For us, it was more important for the drivers to focus on strategy than figuring out the binary codes of a selection panel, or a script like you have posted.

For this reason our team integrated the following tab into our dashboard.


This allowed our drivers to simply change the autonomous routine to a (theoretically) infinite amount of choices. It also allowed our team to adapt to nearly any strategy the alliance was planning.

Just my input into the discussion, take it for what its worth!
This is so much more sophisticated than what we did
We just had a jumper connected to a digital in that would enable or disable autonomous based on whether it was connected or not. We scrapped that in eliminations at Central Valley when we rewrote our autonomous to feed the balls that we had to 1323.
  #8   Spotlight this post!  
Unread 23-10-2012, 23:21
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: Autonomous scripting language

If we wanted something we didn't already have a script for, or more likely wanted to tweak a script, we could do this in several ways:

-12-position knob on the Kat Box with file name indicator on the Dashboard. The 12 file names are hardcoded, but the string name is sent to Dashboard so we only have to modify the built code to add a new file (we never added a new file during competition). At the end of the season, we had 10 programs, some of them heavily tuned for various driving maneuvers.
-Old/New speed variation control potentiometer, this acted as the hood angle manual override during teleop but was read as old/new in auton
-Change the text file and FTP it to the cRio in the queue - We did this often for delays or ball spacing tweaks and the like.

Using text files allows for very repeatable execution compared to something where you enter the commands every match, easy modification, and easy addition of new scripts.
__________________
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
  #9   Spotlight this post!  
Unread 24-10-2012, 00:38
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,513
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: Autonomous scripting language

Quote:
Originally Posted by apalrd View Post
Using text files allows for very repeatable execution compared to something where you enter the commands every match, easy modification, and easy addition of new scripts.
We used this method as well. We used an FTP script that downloaded all our auton files, all our constant files (PID Gains, etc), and then downloaded all the pictures taken on the field (we took a picture every time we pulled the trigger) to the computer for analysis. That really helped our accuracy increase as we got a bigger and bigger picture pool.

Our script was simple. Each 'block' of code had lines for every function on the robot: shooter angle, shooter speed, robot angle, distance to drive, etc.

We couldn't change them at the dashboard on the field, but updating the in the pits was a matter of seconds.

We learned this the hard way at the 2011 champs when we wasted an entire practice field session waiting for new auto code to compile.
  #10   Spotlight this post!  
Unread 24-10-2012, 16:16
vhcook's Avatar
vhcook vhcook is offline
Reader of Things
AKA: Victoria
FRC #1939 (Kuh-nig-its)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Kansas City, MO
Posts: 546
vhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond repute
Re: Autonomous scripting language

Chris Hibner from 51 had actually done a presentation on this sort of thing (flexible autonomous control using a flat file on the cRIO to pick actions rather than having to completely recompile for changes) for FIRST Conferences in 2011. Here's a link to his presentation and samples.
__________________


Closed Thread


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

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