Go to Post So kudos for asking advice... you've got plenty of good advice so far in this column... but honestly, if Orville and Wilbur Wright had taken good advice they would have packed up and gone back to their bicycle shop. - dtengineering [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 Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 07-01-2015, 08:12 PM
Phoenix Spud's Avatar
Phoenix Spud Phoenix Spud is offline
Everyone. Everywhere.
FRC #3132 (Thunder Down Under)
Team Role: College Student
 
Join Date: Jan 2009
Rookie Year: 2004
Location: Sydney, Australia
Posts: 702
Phoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond reputePhoenix Spud has a reputation beyond repute
How do you use the WPILib?

As part of a university project, I'm looking at the WPILib (language independent) and how teams use it. In particular I'm interested in:

What classes do you use the most?
Do you edit any of the provided classes?
Do you extend any of the provided classes?
What features do you wish WPILib had?

Thanks!
__________________
Sarah Heimlich
Outreach Mentor | Business Mentor
FIRST® TEAM 3132
  #2   Spotlight this post!  
Unread 07-01-2015, 10:07 PM
Ben Wolsieffer Ben Wolsieffer is offline
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 520
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
Re: How do you use the WPILib?

What classes do you use the most?

Well, for one, all the classes relating to hardware control (Jaguar, Talon, Double/SingleSolenoid). Also, our code uses are huge amount of Commands and CommandGroups.

Do you edit any of the provided classes?

We wrote our own analog gyro driver that was an edited version of the Gyro class. It was designed to follow the same pattern as the accelerometer drivers.

Do you extend any of the provided classes?

We extended the Command class to provide the ability to set parameters through the SmartDashboard easily. Also, we extend the Command, IterativeRobot and Subsystem classes through the normal usage of the API.

What features do you wish WPILib had?

I could probably think of a few smaller things if I were working on the robot code right now, but there is no major addition or change that I can think of.
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists
  #3   Spotlight this post!  
Unread 07-05-2015, 11:30 PM
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,033
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: How do you use the WPILib?

What classes do you use the most?

SampleRobot, Solenoid, AnalogInput, Jaguar/Talon et al, and Timer.

Do you edit any of the provided classes?

Well, we rewrote most of them in python...

The python version of WPILib tends to very strictly follow the spirit of the C++/Java API. I believe very strongly that if our team needs to modify WPILib, then we make a patch available on the WPILib bug tracker so that others can benefit from it, in all languages. Other modifications will tend to either extend existing objects, or create new objects based on the existing objects instead.

Do you extend any of the provided classes?

I tend to prefer creating new objects that hold WPILib objects as member variables instead of extending them.

What features do you wish WPILib had?
  • I think command-based programming is too verbose.
  • I would like better testing/simulation support in WPILib
__________________
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
  #4   Spotlight this post!  
Unread 07-06-2015, 12:46 AM
SoftwareBug2.0's Avatar
SoftwareBug2.0 SoftwareBug2.0 is offline
Registered User
AKA: Eric
FRC #1425 (Error Code Xero)
Team Role: Mentor
 
Join Date: Aug 2004
Rookie Year: 2004
Location: Tigard, Oregon
Posts: 485
SoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant future
Re: How do you use the WPILib?

What classes do you use the most?

SampleRobot
Solenoid
VictorSP
AnalogInput
CANTalon
DigitalInput
DigitalOutput

Do you edit any of the provided classes?

Bugfixes only.

Do you extend any of the provided classes?

SampleRobot: Wrapper turns the various calls into it a call of a single function with what is happening as an argument.

What features do you wish WPILib had?

Simplicity and correctness. Despite the fact that we write C++ we wrap WPIlib extensively to avoid using its interface to the extent this is practical.
  #5   Spotlight this post!  
Unread 07-06-2015, 06:53 AM
calcmogul's Avatar
calcmogul calcmogul is offline
WPILib Developer
AKA: Tyler Veness
FRC #3512 (Spartatroniks)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Santa Maria, CA
Posts: 51
calcmogul is just really nicecalcmogul is just really nicecalcmogul is just really nicecalcmogul is just really nice
Re: How do you use the WPILib?

What classes do you use the most?

This year, we used the CANTalon in place of Encoder, PIDController, and DigitalInput.

SampleRobot
CANTalon
Solenoid
Timer

Do you edit any of the provided classes?

We edited the PIDController class to include dt in the I accumulation and error derivative calculations. In other cases, we replace classes. Some of the interfaces we've written already had equivalents in WPILib, but we didn't use the provided ones because we either didn't know about them, like the Preferences class, or we didn't like their implementation, like NetworkTables. There could also be some FUD with respect to the command-based paradigm versus our state machine classes (although we approached it differently than WPILib).

Do you extend any of the provided classes?

We wrap motor controllers in a GearBox template class when they control motors in the same physical gearbox. It allows us to control them as a single unit and includes an interface for shifting, encoders, and PID control.

What features do you wish WPILib had?

With regards to external features, one of my students wants the CANTalon PID interface and PIDController class to match so that one can switch between them easily.

Most of my complaints are about WPILib's implementation, and I'm trying to get them fixed. Const correctness was an issue, but a patch got accepted for that recently. There's also thread safety, which is being C++11'ified (if that's a thing) for maintainability. I wish WPILib handled ownership of objects properly with move semantics. Currently, one can pass pointers into classes like RobotDrive and still need to delete them externally later. (At least that's what the examples do.) It makes more sense for the RobotDrive instance to take ownership of them via smart pointers. I'm told there will be patches for that ready for review soon. The interfaces for classes could be smaller as well. I think some of it is common behavior and could be refactored back into its respective base classes.
  #6   Spotlight this post!  
Unread 07-06-2015, 07:34 AM
marshall's Avatar
marshall marshall is offline
My pants are louder than yours.
FRC #0900 (The Zebracorns)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2003
Location: North Carolina
Posts: 1,229
marshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond repute
Re: How do you use the WPILib?

Quote:
Originally Posted by Phoenix Spud View Post
What classes do you use the most?
Network Tables.

Quote:
Originally Posted by Phoenix Spud View Post
Do you edit any of the provided classes?
Network Tables.

Quote:
Originally Posted by Phoenix Spud View Post
Do you extend any of the provided classes?
Network Tables.

Quote:
Originally Posted by Phoenix Spud View Post
What features do you wish WPILib had?
Better Network Tables.

Yes, my tongue was firmly implanted in my cheek for those responses. Though we do use Network Tables and it really does need some work. Last I heard the WPI folks were working on it.
__________________
"La mejor salsa del mundo es la hambre" - Miguel de Cervantes
"The future is unwritten" - Joe Strummer
"Simplify, then add lightness" - Colin Chapman
  #7   Spotlight this post!  
Unread 07-06-2015, 09:39 AM
Andrew Schreiber Andrew Schreiber is offline
Data Nerd
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,055
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: How do you use the WPILib?

Quote:
Originally Posted by virtuald View Post
What features do you wish WPILib had?
  • I think command-based programming is too verbose.
  • I would like better testing/simulation support in WPILib


I'll second both of these. One of the big reasons we're evaluating python for future uses is the strong simulation and testing support. (Ok, and the fact that I think Java is too verbose in general).
__________________




.
  #8   Spotlight this post!  
Unread 07-06-2015, 02:31 PM
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,070
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: How do you use the WPILib?

We use LabVIEW currently, but are potentially looking at switching to .NET or Java.

Since LabVIEW works differently then the other 2, the WPILib is different there. However, since I've been working on the .NET port, better simulator support would be very helpful. I've been using Pythons implementation as a base, and it easily works better then either of the 3 officially supported languages. If teams had an easy to use simulator and test bench, I bet we would see much better code from teams.

The other think I would like to see is more code uniformity. I know they are working on that, so it should be better for next season, but for now you can tell it's been written over 5 years, and its time for some cleanup.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
  #9   Spotlight this post!  
Unread 07-06-2015, 09:20 PM
Camilo86's Avatar
Camilo86 Camilo86 is offline
Registered User
AKA: camilo
FRC #0125 (Nutrons)
Team Role: Programmer
 
Join Date: Jun 2013
Rookie Year: 2012
Location: Boston
Posts: 21
Camilo86 is a glorious beacon of lightCamilo86 is a glorious beacon of lightCamilo86 is a glorious beacon of lightCamilo86 is a glorious beacon of lightCamilo86 is a glorious beacon of lightCamilo86 is a glorious beacon of light
Re: How do you use the WPILib?

Would be nice if there was any support for simulation/testing like robotpy has
__________________
Hopper finalist 2015
Dean's List winner 2015
  #10   Spotlight this post!  
Unread 07-06-2015, 10:42 PM
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,033
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: How do you use the WPILib?

Actually, we use NetworkTables extensively too -- I forget it's part of WPILib because we split it out from WPILib for the python implementation.

I'm pretty sure the Java/C++ implementations of NetworkTables have difficult to reproduce deadlock issues in them, which is something I wish they would fix.
__________________
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
  #11   Spotlight this post!  
Unread 07-07-2015, 10:32 AM
Joey1939's Avatar
Joey1939 Joey1939 is offline
Registered User
AKA: Joey Holliday
FRC #1939 (Kuhnigits)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Kansas City, Missouri
Posts: 139
Joey1939 has a spectacular aura aboutJoey1939 has a spectacular aura aboutJoey1939 has a spectacular aura about
Re: How do you use the WPILib?

What classes do you use the most?

CANTalon (With direct encoder input and PID control)
RobotDrive (Makes driving easy)
CommandGroup (Create multiple autonomous modes easily)
Command

Do you edit any of the provided classes?

No

Do you extend any of the provided classes?

Yes, I extended Joystick to make a custom mapping for our specific joystick. I may extend CANTalon next year to make controlling it easier.

What features do you wish WPILib had?

1. A built in way to simulate the code running on a RoboRIO, manipulate inputs, and display outputs. (Side note: I realize that there are other options for this, but all of them require you to use their library. I prefer using the plain WPILib library.)
2. Documentation on how to make SmartDashboard plugins/more plugins
__________________


  #12   Spotlight this post!  
Unread 07-07-2015, 11:58 AM
Toa Circuit's Avatar
Toa Circuit Toa Circuit is offline
Thaddeus Maximus
AKA: Thad Hughes
FRC #4213 (MetalCow Robotics)
Team Role: Leadership
 
Join Date: Nov 2012
Rookie Year: 2012
Location: Shirley, IL
Posts: 131
Toa Circuit is an unknown quantity at this point
Re: How do you use the WPILib?

What classes do you use the most?
IterativeRobot, Jaguar/Talon/Victor etc. DoubleSolenoid... DigitalInput... Encoder... you know, your basic I/O stuff.
And SmartDashboard.

Do you edit any of the provided classes?
We don't modify source... but...

Do you extend any of the provided classes?
YES. Most classes get extended:
1. Joystick gets a custom class with stuff like GetButtonTripped(), GetLX(), GetLMagnitude(), GetLAngle(), etc. specific to the joystick mapping.
2. Jaguar/Talon/Victor have:
- A "invert" flag so we can wire correct colors AND have our higher level code look like what corresponds to what is going on (I.E. invert one side of a tank drivetrain)
- A throttle variable so we can slowly ramp up/down a motor

What features do you wish WPILib had?
Having the invert flag built into the SpeedController interface would be nice.
An intelligent SmartDashboard which guaruntees values will exist for the client to modify. I.E. SmartDashboard.guarunteeValue("Gyro KP", 1.5);
I know it isn't really WPILib, but fixing SmartDashboard so it actually retains layouts and values would be great. WPILib is nice and stable, not much to change. It's the other tools that are icky.
__________________

2012 Head of Programming and Electrical
2013-14 Overall Team Captain and Programming Head
2012-14 Mentor of FLL Team Power Surge
2014 Dean's List Finalist
2014 CIR Xerox Creativity Award
Webpage
  #13   Spotlight this post!  
Unread 07-07-2015, 10:21 PM
calcmogul's Avatar
calcmogul calcmogul is offline
WPILib Developer
AKA: Tyler Veness
FRC #3512 (Spartatroniks)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Santa Maria, CA
Posts: 51
calcmogul is just really nicecalcmogul is just really nicecalcmogul is just really nicecalcmogul is just really nice
Re: How do you use the WPILib?

Quote:
Originally Posted by Toa Circuit View Post
2. Jaguar/Talon/Victor have:
- A "invert" flag so we can wire correct colors AND have our higher level code look like what corresponds to what is going on (I.E. invert one side of a tank drivetrain)
SpeedController already has a SetInverted() method that does what you describe.
  #14   Spotlight this post!  
Unread 07-07-2015, 11:45 PM
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,547
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: How do you use the WPILib?

Quote:
Originally Posted by mathmogul View Post
SpeedController already has a SetInverted() method that does what you describe.
It was added this summer.
  #15   Spotlight this post!  
Unread 07-10-2015, 01:33 AM
Peter Johnson Peter Johnson is offline
WPILib Developer
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 243
Peter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud of
Re: How do you use the WPILib?

Quote:
Originally Posted by virtuald View Post
Actually, we use NetworkTables extensively too -- I forget it's part of WPILib because we split it out from WPILib for the python implementation.

I'm pretty sure the Java/C++ implementations of NetworkTables have difficult to reproduce deadlock issues in them, which is something I wish they would fix.
I have good news for you (and others who've run into issues with NetworkTables). I'm currently rewriting the NetworkTables implementation core from the ground up as a portable C++ library (with C interfaces) to fix the deadlocks and improve performance. The plan for WPILib is to update both the C++ and Java higher level classes to use this core library (similar to how NetworkCommunication is used) for consistency across languages. It's currently TBD whether LabView will use this library or continue using a LabView-native implementation. And before anyone asks, yes, the new implementation will be extensively unit-tested (I'm expecting to have at least several hundred unit tests).

In addition to the implementation rewrite, we're revising the protocol (in a backwards-compatible way) to fix a number of issues (more consistent synchronization) and make the protocol in general a bit more robust. As part of this, we're also adding a few features, including integrated value persistence (think Preferences++), remote procedure calls, server reboot detection, and client self-identification.
__________________
Author of ntcore - WPILib NetworkTables for 2016+
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)
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 04:47 AM.

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