Go to Post I guess everyone cant play real defense, like actually pushing the other robot instead of ramming it with the intent to destroy. - Dillon Compton [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 24-03-2013, 20:06
gixxy's Avatar
gixxy gixxy is offline
Programming and Arduino Mentor
AKA: Gustave Michel III
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Ruston, LA
Posts: 207
gixxy is on a distinguished road
Thumbs up Share your Java Utilities and Object Classes

So I am sure just about every team has written a class for something that isn't in the library, or some other utility to aid in code development/testing. In the spirit of Gracious Professionalism and Open Source, I would love to have us share our creations.

For my contributions:

XboxController Class that is compatible with the CommandBase OI Button and Scheduler system. It also assists by using subclasses for the buttons and axises to alleviate memorizing the button/axis numbers.
XboxController

Threaded RaspberryPi Socket Connection. This is a little more specifically written to our uses, but it is likely useful for any co-processor using a TCP Socket Connection in a separate thread to prevent the robot from crashing if the thread crashes.
ThreadedPi
ThreadedberryPi (subsystem)

Then I have python code for a RaspberryPi for processing images and using a TCP Socket Server. This was not written by me, but we used it on our competition robot which has perfect killer accuracy. It calculated Distance(in millifeet) and pixels from center. The distance wasn't quite accurate, but was consistently inaccurate(useful if you recorded target points).
PyGoalFinder

I hope these helps someone. And thanks for sharing if you do so!
__________________
Programmer - A creature known for converting Caffeine into Code.
Studying Computer Science @ Louisiana Tech University
Associate Consultant @ Fenway Group

2012-13: 3946 - Head of Programming, Electrical and Web
2014 - 3468 - Programming Mentor
2015 - Present - Lurker
Reply With Quote
  #2   Spotlight this post!  
Unread 24-03-2013, 21:36
Bryce Paputa's Avatar
Bryce Paputa Bryce Paputa is offline
FF TSL: Frog Farce
FRC #0503 (Frog Force)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2008
Location: Novi Michigan
Posts: 454
Bryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond repute
Re: Share your Java Utilities and Object Classes

Here is our current code, we have quite a few of these things,
  • util.CoupledTalons is a class we have to run two talons in sync with eachother, it also ramps the power on them.
  • calibrations.* are classes that let us calibrate sensors and get usable numbers from them, we have one for an encoder with a limit switch at one end of it's travel, and one for a pot with one on each end.
  • limitSwitches.* are classes that make using limit switches easier. There is NCLimitSwitch which is a wrapper for the normal digital input class that inverts the input so we can't forget to do it. LimitSwitchSystem is an interface for a class that helps with using limit switches as bounds, SingleLimitSwitchSystem is one that just has one limit switch, DualLimitSwitchSystem is for two. They both return values of the LimitSwitchState enumeration, which has values for when the switches are pressed and for when they aren't.
  • controllers.* are classes that generalize motor control using the calibrations and limit switch systems. There is SimpleController which works exactly like a normal motor controller, except for the fact that it uses the limit switch states to limit the motion. StringPotPidController and EncoderPIDController add PID on top of the simple controller.
The code isn't commented very thoroughly yet as the code is still changing and we haven't had a lot of time to comment it, so don't hesitate to PM me with questions.
Reply With Quote
  #3   Spotlight this post!  
Unread 24-03-2013, 21:45
cgmv123's Avatar
cgmv123 cgmv123 is offline
FRC RI/FLL Field Manager
AKA: Max Vrany
FRC #1306 (BadgerBOTS)
Team Role: College Student
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Madison, WI
Posts: 2,073
cgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond repute
Re: Share your Java Utilities and Object Classes

https://github.com/team1306/Badgerbo...badgerbots/lib
__________________
BadgerBOTS Robotics|@team1306|Facebook: BadgerBOTS
2016 FIRST Championship Tesla Division | 2016 Wisconsin Regional Engineering Inspiration Award

2015 FIRST Championship Carson Division | 2015 Wisconsin Regional Chairman's Award

2013 FIRST Championship Curie Division | 2013 Wisconsin Regional Chairman's Award

2012 FIRST Championship Archimedes Division | 2012 Wisconsin Regional Engineering Inspiration Award, Woodie Flowers Finalist Award (Lead Mentor Ben Senson)

Reply With Quote
  #4   Spotlight this post!  
Unread 25-03-2013, 18:39
shindigo shindigo is offline
Registered User
AKA: Mike Parker
FRC #0102
Team Role: Mentor
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Somerville, NJ
Posts: 33
shindigo is an unknown quantity at this point
Re: Share your Java Utilities and Object Classes

Thanks for the thread, thanks for the posts. Always good to read other people's code. I do not have much to contribute, but we have found this library useful for Math functions that Java ME does not provide: http://javolution.org.

Does anyone know a simple lib for formatting floating-point numbers since printf is not available?
Reply With Quote
  #5   Spotlight this post!  
Unread 27-03-2013, 15:30
BigJ BigJ is offline
Registered User
AKA: Josh P.
FRC #1675 (Ultimate Protection Squad)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Milwaukee, WI
Posts: 945
BigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond repute
Re: Share your Java Utilities and Object Classes

gixxy's is probably superior, but here is a link to a mapping file we use for XBox gamepads (We just use the Joystick class and these mapping values).

Quote:
Does anyone know a simple lib for formatting floating-point numbers since printf is not available?
If you just want to fix to a specific number of decimal points x, you could make a simple helper class/method that multiplies it by 10^x and casts to an integer, then divides it back down to a float... but you probably already thought of that

Last edited by BigJ : 27-03-2013 at 15:35.
Reply With Quote
  #6   Spotlight this post!  
Unread 31-03-2013, 20:33
armgeek's Avatar
armgeek armgeek is offline
Raspberry Pi Enthusiast
AKA: Tyler Pawlaczyk
FRC #0340 (Greater Rochester Robotics)
Team Role: Programmer
 
Join Date: Mar 2013
Rookie Year: 2011
Location: Rochester, NY
Posts: 10
armgeek is an unknown quantity at this point
Re: Share your Java Utilities and Object Classes

Quote:
Originally Posted by gixxy
Threaded RaspberryPi Socket Connection. This is a little more specifically written to our uses, but it is likely useful for any co-processor using a TCP Socket Connection in a separate thread to prevent the robot from crashing if the thread crashes.
ThreadedPi
ThreadedberryPi (subsystem)
We bit-banged an SPI-interface for the Raspberry Pi, but assuming nettables doesn't interrupt your solution, yours looks much better.

Our team also wrote code for a Raspberry Pi that we intended to use on the robot (we couldn't due to weight limitations), and we used C++ and OpenCV to create an image processing program. Our team intends on publishing a Raspberry Pi image designed for FIRST this summer. Thanks for publishing this.
__________________
I enjoy ARM processors.
Looking to earn rewards for working on Open-Source projects that help FIRST? You may be interested in the Summer of FIRST 2013 project. More info: 2013.summeroffirst.org
Also, visit my (sparse) blog: rainingbitsandbytes.blogspot.com
Reply With Quote
  #7   Spotlight this post!  
Unread 01-04-2013, 02:15
gixxy's Avatar
gixxy gixxy is offline
Programming and Arduino Mentor
AKA: Gustave Michel III
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Ruston, LA
Posts: 207
gixxy is on a distinguished road
Re: Share your Java Utilities and Object Classes

Quote:
Originally Posted by armgeek View Post
We bit-banged an SPI-interface for the Raspberry Pi, but assuming nettables doesn't interrupt your solution, yours looks much better.
A TCP Socket Connection is basically Serial over a Network. While I'm not going to say Net Tables CAN'T cause a problem, I would find it very peculiar if it did.

We used the RPi (with said posted code) at competition this year and besides issues with autonomous (if it wasn't fully booted in time) it worked perfectly!
__________________
Programmer - A creature known for converting Caffeine into Code.
Studying Computer Science @ Louisiana Tech University
Associate Consultant @ Fenway Group

2012-13: 3946 - Head of Programming, Electrical and Web
2014 - 3468 - Programming Mentor
2015 - Present - Lurker
Reply With Quote
  #8   Spotlight this post!  
Unread 28-08-2013, 19:13
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: Share your Java Utilities and Object Classes

I'm not sure how relevant this is, since the topic seems kind of old, but I wrote this up last season and think it was extremely useful. 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.

https://github.com/Ipiano/Parsable_Autonomous
__________________
________
Genius is one percent inspiration and ninety-nine percent perspiration.
--Thomas A. Edison
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:38.

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