Go to Post And we had to walk both ways to the venue from our hotel! Uphill! Barefoot over broken glass! - IMDWalrus [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 28-08-2013, 19:21
Ipiano's Avatar
Ipiano Ipiano is offline
Registered User
AKA: Andrew Stelter
FRC #3018 (Nordic Storm)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mankato, Minnesota
Posts: 27
Ipiano is an unknown quantity at this point
Revolutionizing autonomous

Last year, my team decided that creating our autonomous mode was taking too long. We had to change code, download, restart the CRio, etc. EVERY TIME. So, my mentors encouraged me to find a way to speed up the process, and I believe the result is quite helpful. It's a set of classes that can be extended to automatically set up a way to edit autonomous code on the fly so you don't have to re-download and restart the CRio just to change a simple variable. This makes having multiple autonomous sequences easy to manage, and brings extreme flexibility to that section of the game. The only downside that it only works for teams using the command base, and it is a little tricky to set up.

Here's how it works: Using the SmartDashboard and RobotPreferences, the robot is provided by a real-time stream of data which the user can change. The user can enter a string of numbers and letters symbolizing a sequence of commands, and the robot will automatically parse the string and create an autonomous command, and it can be changed at a moments notice.
For example, you could input
D 1,5,5; B 2;
And it could mean drive for 1 second at speed 5 left and right, then use the bucket for 2 seconds.
D and B would be linked to certain commands, so the parser knows what they mean;
And, if you change it to
D 1,4,4; B 2
The parser will recognize the change and create a new autonomous command which is ready to be used immediately.

To get the code and more thorough documentation of how to use it, see my git repo.
https://github.com/Ipiano/Parsable_Autonomous

Let me know your thoughts. I personally find this to be quite useful, and I hope you do too.
__________________
________
Genius is one percent inspiration and ninety-nine percent perspiration.
--Thomas A. Edison
Reply With Quote
  #2   Spotlight this post!  
Unread 08-09-2013, 21:51
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 542
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Revolutionizing autonomous

This might be useful for simple autonomus, but others can get quite complicated. I wrote a extension of CommadGroup that allows me to specify firing and cancelling of commands and it makes it alot easier. I just input the variables as SmartDashboard, modified untill good, than finalized. An example would be my five-disc auton which you can find here. https://github.com/1684Chimeras/2013...DiscAuton.java

Note that command-based code wasn't used at competition due to internal conflicts, but it all worked great and was quick and easy to develop. Also, alot of the classes used were basically being rushed in the middle of build season so theres alot that has been improved. (The way we did auton before (and still do untill 2014) is through a gigantic switch loop which didn't work untill our third competition and was hard as all hell to debug. Linked code worked on first deploy)
Reply With Quote
  #3   Spotlight this post!  
Unread 08-09-2013, 22:20
Ipiano's Avatar
Ipiano Ipiano is offline
Registered User
AKA: Andrew Stelter
FRC #3018 (Nordic Storm)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mankato, Minnesota
Posts: 27
Ipiano is an unknown quantity at this point
Re: Revolutionizing autonomous

Our autonomous WAS complicated. It was
Camera track to the low goal.
Line up with the goal
Drive to a certain distance from the goal
Dump frisbees
Turn around
Drive at a specific angle


Also, I looked at your code. I didn't see any SmartDashboard reference, where was it? And btw, the FRC java has a built-in wait command, just so ya know

But my point is that, the way you set it up, if you change the command sequence, which happens a lot in testing, you have to re-download the code onto the robot; a timely event. With MY setup, you don't have to restart the robot.
__________________
________
Genius is one percent inspiration and ninety-nine percent perspiration.
--Thomas A. Edison
Reply With Quote
  #4   Spotlight this post!  
Unread 08-09-2013, 22:25
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 542
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Revolutionizing autonomous

Quote:
Originally Posted by Ipiano View Post
Our autonomous WAS complicated. It was
Camera track to the low goal.
Line up with the goal
Drive to a certain distance from the goal
Dump frisbees
Turn around
Drive at a specific angle


Also, I looked at your code. I didn't see any SmartDashboard reference, where was it? And btw, the FRC java has a built-in wait command, just so ya know

But my point is that, the way you set it up, if you change the command sequence, which happens a lot in testing, you have to re-download the code onto the robot; a timely event. With MY setup, you don't have to restart the robot.
I removed all of the SmartDashboard references as i mainly only use them for debugging (see my other thread i replied on), that project is supposed to be a cleaned version. Yeah i know theres a FRC wait command, I just felt like making my own

Yours doesn't sound that complicated...

Targeting.process()
Drive.drive(3000,0.5)
Shooter.dump() //Havent seen your robot, not sure what you exactly mean by dump.
Drive.rotate(180 + "specific angle") driving the angle with motors would cause the robot to doughnut
Drive.drive(3000, 0.5)

cam;dr:3000;sh;rot:180;dr:3000

If you have a programming team (not just you), setup a GitHub organization and ask for a micro account, they gave us 10 free private repos.
Reply With Quote
  #5   Spotlight this post!  
Unread 08-09-2013, 23:35
Ipiano's Avatar
Ipiano Ipiano is offline
Registered User
AKA: Andrew Stelter
FRC #3018 (Nordic Storm)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mankato, Minnesota
Posts: 27
Ipiano is an unknown quantity at this point
Re: Revolutionizing autonomous

It was more like
"D 1,-7,-7;G 10,-9,120,-0.7;S;PA;F;D .5,6,6;Y 2,-7,140;Y 2,-10,0;X .5;"

But my point isn't to reduce complexity. The point of this is MAINLY to allow testing without restarting the robot in between tests. The fact that it also develops a string you can use as autonomous at the same time is a bonus. We actually had three strings, and and switched them out based on the situation. Sometimes while the robot was on the field. We didn't have a cleaned version because the "Cleaned version" Was inputting the string we wanted to run and running it.

Actually one of our mentors is related to an owner of Atlassian Bitbucket, so we use that instead of Git
__________________
________
Genius is one percent inspiration and ninety-nine percent perspiration.
--Thomas A. Edison
Reply With Quote
  #6   Spotlight this post!  
Unread 08-09-2013, 23:38
Ipiano's Avatar
Ipiano Ipiano is offline
Registered User
AKA: Andrew Stelter
FRC #3018 (Nordic Storm)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mankato, Minnesota
Posts: 27
Ipiano is an unknown quantity at this point
Re: Revolutionizing autonomous

Also, I'm not saying YOUR team specifically should use my setup. You seem to have it all worked out. This is mainly for the teams that don't really have time to test lots of autonomous stuff and don't really know how to set it up. Almost all of the tournaments we were at the most we saw for autonomous was 3 shots maybe, or a drive into the wall and use inertia to drop frisbees.
__________________
________
Genius is one percent inspiration and ninety-nine percent perspiration.
--Thomas A. Edison
Reply With Quote
  #7   Spotlight this post!  
Unread 09-09-2013, 07:20
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 542
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Revolutionizing autonomous

Quote:
Originally Posted by Ipiano View Post
Also, I'm not saying YOUR team specifically should use my setup. You seem to have it all worked out. This is mainly for the teams that don't really have time to test lots of autonomous stuff and don't really know how to set it up. Almost all of the tournaments we were at the most we saw for autonomous was 3 shots maybe, or a drive into the wall and use inertia to drop frisbees.
That's my code not the teams. The actual team code (2013Iterative) was only working as 3disc until worlds when we got 5disc lol (don't ask). My main issue with the parser is that it can be hard to read and as long as you get the procedure done, you can just use sd to change the values, but I guess if it worked for you everyone's different.
Reply With Quote
  #8   Spotlight this post!  
Unread 09-09-2013, 08:21
Ipiano's Avatar
Ipiano Ipiano is offline
Registered User
AKA: Andrew Stelter
FRC #3018 (Nordic Storm)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mankato, Minnesota
Posts: 27
Ipiano is an unknown quantity at this point
Re: Revolutionizing autonomous

Ohhh I see what you mean. But you don't actually have to read the parser
But still, very few teams know about the SmartDashboard, and very few teams have Autonomous. The ones that do are usually the more impressive ones who, like your team, have a 5-disc auto or something equal. I mostly want to help out the teams that don't have as much. They just have to drop these into their project, extend from them, fill out the abstract methods in the commands, And pass in a list of those commands in RobotInit.
__________________
________
Genius is one percent inspiration and ninety-nine percent perspiration.
--Thomas A. Edison
Reply With Quote
  #9   Spotlight this post!  
Unread 09-09-2013, 14:44
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 542
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Revolutionizing autonomous

Quote:
Originally Posted by Ipiano View Post
Ohhh I see what you mean. But you don't actually have to read the parser
But still, very few teams know about the SmartDashboard, and very few teams have Autonomous. The ones that do are usually the more impressive ones who, like your team, have a 5-disc auto or something equal. I mostly want to help out the teams that don't have as much. They just have to drop these into their project, extend from them, fill out the abstract methods in the commands, And pass in a list of those commands in RobotInit.
Our auton never actually worked that well, it would go good at testing than run into the wall at competition. (Mine worked fine but It was never really tested at comp) https://github.com/1684Chimeras/2013...utonomous.java

(next year will be a command-based structure like the earlier link)

My code follows similar structure, you just drop in TimedCommandGroup.java and add commands, in the 2014 code I've added a simple little command generator that will allow me to run 1-8 motors/relays/solenoids/etc at whatever desired value. Your code might be faster to write, but mine is easier to read and better support for multiple modes plus once you learn to FTP, changing values without SD doesn't take too long
Reply With Quote
  #10   Spotlight this post!  
Unread 09-09-2013, 15:16
Ipiano's Avatar
Ipiano Ipiano is offline
Registered User
AKA: Andrew Stelter
FRC #3018 (Nordic Storm)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Mankato, Minnesota
Posts: 27
Ipiano is an unknown quantity at this point
Re: Revolutionizing autonomous

I don't know about better at supporting multiple modes, we had had a couple different strings we could use, and just put in the relevant one once we had the robot on the field. But, I agree that it is probably easier to read.
Either way, the stuff in this thread should be good for jump-starting a team who has 0 autonomous.
__________________
________
Genius is one percent inspiration and ninety-nine percent perspiration.
--Thomas A. Edison
Reply With Quote
  #11   Spotlight this post!  
Unread 11-09-2013, 13:40
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: Revolutionizing autonomous

Here's some scripting stuff I worked on a while back so that files can be deployed over FTP with no reboot. I haven't touched it since but it'd be interesting to see something similar in Java (not sure about yacc/lex equivalents).
__________________
Team 973 (2016-???)
Team 5499 (2015-2016)
Team 254 (2014-2015)

Team 1538 (2011-2014)
2014 Driver (25W 17L 1T)
日本語でOK
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 10:00.

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