Go to Post This thread is making me all vaklempt. :) This is FIRST at its best! Advice, offers for spare parts, and even lunch! You all ROCK! :D - Cynette [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

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 18-05-2016, 22:40
AGPapa's Avatar
AGPapa AGPapa is offline
Registered User
AKA: Antonio Papa
FRC #5895
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2011
Location: Robbinsville, NJ
Posts: 322
AGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond repute
Team 5895 Code Release for 2016

Peddie School Robotics is happy to share the code for our 2016 robot.

This software is heavily inspired by 254’s past code releases (thanks!). Some changes from 254’s past code include the lack of complex inheritance structures and extensive use of the new Java 8 functional interfaces. This was the students’ first year in FRC and I’m very impressed with how quickly they learned and how much they accomplished.

Our autonomous framework made it easy for students to write and test their own autonomous routines using the same subsystem method calls used in teleop. The “Waiter” class in particular uses functional interfaces to let the robot reach any arbitrary condition before moving on to the next command.

Take a look at our repo here and let me know if you have any questions about the code.
__________________
Team 2590 Student [2011-2014]
Team 5684 Mentor [2015]
Team 5895 Mentor [2016-]
Reply With Quote
  #2   Spotlight this post!  
Unread 18-05-2016, 23:08
thatprogrammer's Avatar
thatprogrammer thatprogrammer is online now
Registered User
AKA: Ahad Bawany
no team (None)
Team Role: Programmer
 
Join Date: Apr 2014
Rookie Year: 2014
Location: Florida
Posts: 604
thatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond reputethatprogrammer has a reputation beyond repute
Re: Team 5895 Code Release for 2016

Thanks for the code release, some of the code is really nice! That said,I'm not following how your vision works. It appears your X and Y values are being fed to you by smartdashboard somehow (Is your operator manually entering the defense position they are on?).
Reply With Quote
  #3   Spotlight this post!  
Unread 18-05-2016, 23:25
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,032
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Team 5895 Code Release for 2016

Thanks for publishing, added it to the robot code directory!
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Reply With Quote
  #4   Spotlight this post!  
Unread 18-05-2016, 23:27
AGPapa's Avatar
AGPapa AGPapa is offline
Registered User
AKA: Antonio Papa
FRC #5895
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2011
Location: Robbinsville, NJ
Posts: 322
AGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond repute
Re: Team 5895 Code Release for 2016

Quote:
Originally Posted by thatprogrammer View Post
Thanks for the code release, some of the code is really nice! That said,I'm not following how your vision works. It appears your X and Y values are being fed to you by smartdashboard somehow (Is your operator manually entering the defense position they are on?).
Vision processing is done on the dashboard side (which was written in LabVIEW). It just uses the example vision code from NI.

It's not the prettiest code as it was a plan C backup after the JetsonTK1 (with power issues) and GRIP (which doesn't work for USB cameras), so I don't think we'll reuse it next year. Either way, I've attached it if you want to look at it.

Quote:
Originally Posted by TimTheGreat View Post
You guys should take a look at autonomous selectors, just to get rid of clutter. You have everything neatly organized into classes, why not go that extra step and make each separate autonomous it's own class as well?
Agreed, this was my first year with Java in FRC, and the team's first year with FRC and Java in general, we'll definitely split auto into separate classes next season.


Quote:
Also, looking through some of your intake update method, it seems to always be running, since you don't have a stop mode. Am I reading this right? Seems a little dangerous.
The intake is stopped in the "has ball" state.
Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	82
Size:	175.8 KB
ID:	20782  
Attached Files
File Type: zip 2016 Dashboard Project - Copy.zip (561.9 KB, 4 views)
__________________
Team 2590 Student [2011-2014]
Team 5684 Mentor [2015]
Team 5895 Mentor [2016-]

Last edited by AGPapa : 18-05-2016 at 23:32.
Reply With Quote
  #5   Spotlight this post!  
Unread 18-05-2016, 23:34
TimTheGreat's Avatar
TimTheGreat TimTheGreat is offline
ArchdukeTim
FRC #1418 (Vae Victis)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Falls Church
Posts: 231
TimTheGreat will become famous soon enoughTimTheGreat will become famous soon enough
Re: Team 5895 Code Release for 2016

Quote:
Originally Posted by AGPapa View Post

The intake is stopped in the "has ball" state.
But what happens when the robot doesn't have a ball. On the field it might be good to always be intaking, but what about in the pit?
__________________
There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.



2012 - Gracious Professionalism - Greater DC
2014 - Regional Finalist - Virginia | Industrial Design - Virginia | Regional Finalist - Greater DC
2015 - Innovation in Control - Greater DC
2016 - District Event Winner - VAHAY | Innovation in Control - VAHAY | District Event Winner - MDBET | Industrial Design - MDBET | District Champion - CHCMP | Innovation in Control - CHCMP
Reply With Quote
  #6   Spotlight this post!  
Unread 18-05-2016, 23:40
AGPapa's Avatar
AGPapa AGPapa is offline
Registered User
AKA: Antonio Papa
FRC #5895
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2011
Location: Robbinsville, NJ
Posts: 322
AGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond repute
Re: Team 5895 Code Release for 2016

Quote:
Originally Posted by TimTheGreat View Post
But what happens when the robot doesn't have a ball. On the field it might be good to always be intaking, but what about in the pit?
Ah, ok, I see.

Yes, the intake is always running when it doesn't have a ball. In the pit we cover the sensor with tape before enabling it to trick it into thinking that it has a ball.

We wanted as many systems to be autonomous as possible, so the driver could focus on more important tasks than manually hitting a button to intake a ball. During a match you always want to pick up a ball if you don't have one, so the code just automates that away.
__________________
Team 2590 Student [2011-2014]
Team 5684 Mentor [2015]
Team 5895 Mentor [2016-]
Reply With Quote
  #7   Spotlight this post!  
Unread 19-05-2016, 14:55
BeckonedCall BeckonedCall is offline
Registered User
AKA: Charles Faulkner
no team
Team Role: Programmer
 
Join Date: May 2016
Rookie Year: 2012
Location: Illinois
Posts: 1
BeckonedCall is an unknown quantity at this point
Re: Team 5895 Code Release for 2016

Quote:
Originally Posted by AGPapa View Post
We wanted as many systems to be autonomous as possible, so the driver could focus on more important tasks than manually hitting a button to intake a ball. During a match you always want to pick up a ball if you don't have one, so the code just automates that away.
Being a driver myself, I can understand wanting to automate as much as you can. I can only imagine that leaving the intake on must have drained the battery. Did you ever have issues with brown out or severe voltage drops during competitions?
Reply With Quote
  #8   Spotlight this post!  
Unread 19-05-2016, 18:43
DonorConohue DonorConohue is offline
Registered User
FRC #5895 (Peddie School Robotics)
Team Role: Driver
 
Join Date: Apr 2016
Rookie Year: 2016
Location: New Jersey
Posts: 1
DonorConohue is an unknown quantity at this point
Re: Team 5895 Code Release for 2016

Quote:
Originally Posted by BeckonedCall View Post
Being a driver myself, I can understand wanting to automate as much as you can. I can only imagine that leaving the intake on must have drained the battery. Did you ever have issues with brown out or severe voltage drops during competitions?
Very rarely. The intake was run by a single minicim.
Reply With Quote
  #9   Spotlight this post!  
Unread 19-05-2016, 19:04
AGPapa's Avatar
AGPapa AGPapa is offline
Registered User
AKA: Antonio Papa
FRC #5895
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2011
Location: Robbinsville, NJ
Posts: 322
AGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond reputeAGPapa has a reputation beyond repute
Re: Team 5895 Code Release for 2016

Quote:
Originally Posted by BeckonedCall View Post
Being a driver myself, I can understand wanting to automate as much as you can. I can only imagine that leaving the intake on must have drained the battery. Did you ever have issues with brown out or severe voltage drops during competitions?
Quote:
Originally Posted by DonorConohue View Post
Very rarely. The intake was run by a single minicim.
Just to elaborate, the intake isn't under much load when it's running and not actively picking up a ball, so it's current draw is close to the 3A free current of a miniCIM. (Actually, because we're not running it at 12V, it could be less). This current draw of the intake is dwarfed by the amout of current that the drivetrain, or even the compressor would be drawing.

In a two and a half minute match, really the only way to drain a battery is to repeatedly stall a motor. Brown outs and voltage drops also happen when there's a big spike in current draw (like when a 6 CIM drive gets into a pushing match), a small motor pulling ~3A wouldn't cause those things.
__________________
Team 2590 Student [2011-2014]
Team 5684 Mentor [2015]
Team 5895 Mentor [2016-]

Last edited by AGPapa : 19-05-2016 at 19:11.
Reply With Quote
  #10   Spotlight this post!  
Unread 18-05-2016, 23:26
TimTheGreat's Avatar
TimTheGreat TimTheGreat is offline
ArchdukeTim
FRC #1418 (Vae Victis)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Falls Church
Posts: 231
TimTheGreat will become famous soon enoughTimTheGreat will become famous soon enough
Re: Team 5895 Code Release for 2016

I like the state machines for teleop. Kind of similar to RobotPy's statefulAutonomous. Take a look at it here. It basically allows you to divide autonomous functions into states, and you can advance based on time or whenever you feel the state is over.

I really liked this feature of RobotPy, and since I wanted it for FTC, I mostly ported to Java. Take a look. It works pretty much the same way. As long as you implement the interface, all should work.

You guys should take a look at autonomous selectors, just to get rid of clutter. You have everything neatly organized into classes, why not go that extra step and make each separate autonomous it's own class as well?

As unorthodox as it is, I like the sped, speed, and speeed. Any reason you didn't declare the double before the switch, then assign a value to it with each case?

Also, looking through some of your intake update method, it seems to always be running, since you don't have a stop mode. Am I reading this right? Seems a little dangerous.
__________________
There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.



2012 - Gracious Professionalism - Greater DC
2014 - Regional Finalist - Virginia | Industrial Design - Virginia | Regional Finalist - Greater DC
2015 - Innovation in Control - Greater DC
2016 - District Event Winner - VAHAY | Innovation in Control - VAHAY | District Event Winner - MDBET | Industrial Design - MDBET | District Champion - CHCMP | Innovation in Control - CHCMP
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 08:44.

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