Go to Post Frank is frank, and I like that. - rsisk [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 17-05-2013, 23:04
William Kunkel William Kunkel is offline
Programming Lead
AKA: Kunkel
FRC #0422 (Mech Tech Dragons)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Richmond, VA
Posts: 94
William Kunkel is an unknown quantity at this point
How much of WPILib is required for robot code to be legal?

I've been considering making a sort of fork of WPILib, to fix some of the problems that my team had with it this year. However, I don't know how much of WPILib is needed for a robot to be legal. I assume modifying some basic things like the Joystick class would be fine, but where is the line drawn? If I were to modify, say, START_ROBOT_CLASS, would that make the robot illegal for competition?
Reply With Quote
  #2   Spotlight this post!  
Unread 17-05-2013, 23:14
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: How much of WPILib is required for robot code to be legal?

WPILib is not required for your robot to be legal. Don't expect FIRST/NI support if you change anything major, though.
__________________
Team 973 (2016-???)
Team 5499 (2015-2016)
Team 254 (2014-2015)

Team 1538 (2011-2014)
2014 Driver (25W 17L 1T)
日本語でOK
Reply With Quote
  #3   Spotlight this post!  
Unread 17-05-2013, 23:45
William Kunkel William Kunkel is offline
Programming Lead
AKA: Kunkel
FRC #0422 (Mech Tech Dragons)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Richmond, VA
Posts: 94
William Kunkel is an unknown quantity at this point
Re: How much of WPILib is required for robot code to be legal?

If WPILib isn't required then how do they enforce things like the FMS? Clearly that's handled somewhere.
Reply With Quote
  #4   Spotlight this post!  
Unread 18-05-2013, 00:09
Tanaythan's Avatar
Tanaythan Tanaythan is offline
Programmer
AKA: Tanay Nathan
FRC #3256 (Warriorborgs)
Team Role: Programmer
 
Join Date: Feb 2011
Rookie Year: 2010
Location: San Jose
Posts: 27
Tanaythan is an unknown quantity at this point
Re: How much of WPILib is required for robot code to be legal?

Quote:
Originally Posted by MaraschinoPanda View Post
If WPILib isn't required then how do they enforce things like the FMS? Clearly that's handled somewhere.
What Connor means is that you do not need WPILib on your robot. You can remake all the files in WPILib to your own needs or even rewrite the whole code. WPILib is there to make the job of programming in FRC much easier.
__________________
Tanay Nathan
Programmer
Team #3256 Warriorborgs
Reply With Quote
  #5   Spotlight this post!  
Unread 18-05-2013, 00:47
William Kunkel William Kunkel is offline
Programming Lead
AKA: Kunkel
FRC #0422 (Mech Tech Dragons)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Richmond, VA
Posts: 94
William Kunkel is an unknown quantity at this point
Re: How much of WPILib is required for robot code to be legal?

Yeah, I understand that he means you don't need WPILib. But without WPILib, how does the FMS have a common interface to your robot? How is that handled?
Reply With Quote
  #6   Spotlight this post!  
Unread 18-05-2013, 01:33
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: How much of WPILib is required for robot code to be legal?

Quote:
Originally Posted by MaraschinoPanda View Post
If WPILib isn't required then how do they enforce things like the FMS? Clearly that's handled somewhere.
Either your robot connects and works or it doesn't... If it never connects your robot will just be bypassed every match.
__________________
Team 973 (2016-???)
Team 5499 (2015-2016)
Team 254 (2014-2015)

Team 1538 (2011-2014)
2014 Driver (25W 17L 1T)
日本語でOK
Reply With Quote
  #7   Spotlight this post!  
Unread 18-05-2013, 08:03
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: How much of WPILib is required for robot code to be legal?

Quote:
Originally Posted by MaraschinoPanda View Post
If WPILib isn't required then how do they enforce things like the FMS? Clearly that's handled somewhere.
Based on the headers I would say it's handled in FRC_NetworkCommunications.out which is part of the cRIO image. The system watchdog component is presumably in the FPGA because one of the reasons you would need it to activate is if the NetworkCommunications Task crashes.

If you had problems with WPILib have you tried filing a bug report on the Tracker? FIRST/WPI may either fix them for you or merge any patch you submit into WPILib. That would likely be much easier than trying to maintain a fork and merge in any desired changes from the main branch at kickoff.
Reply With Quote
  #8   Spotlight this post!  
Unread 18-05-2013, 09:05
androb4's Avatar
androb4 androb4 is offline
..is trying to take this year off.
AKA: Andrew A.
no team
Team Role: Alumni
 
Join Date: Feb 2010
Rookie Year: 2003
Location: Houston, TX
Posts: 220
androb4 is a splendid one to beholdandrob4 is a splendid one to beholdandrob4 is a splendid one to beholdandrob4 is a splendid one to beholdandrob4 is a splendid one to beholdandrob4 is a splendid one to beholdandrob4 is a splendid one to behold
Re: How much of WPILib is required for robot code to be legal?

Quote:
Originally Posted by MaraschinoPanda View Post
Yeah, I understand that he means you don't need WPILib. But without WPILib, how does the FMS have a common interface to your robot? How is that handled?
Well to put it in a simple way.. Without WPILib, that's your problem.
__________________
FRC 441 Mentor 2012-2015
FRC 441 Alumni 2009-2012
FTC 4673 Alumni 2011-2012
FRC 1484 Alumni 2006-2008

Reply With Quote
  #9   Spotlight this post!  
Unread 18-05-2013, 13:09
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: How much of WPILib is required for robot code to be legal?

WPILib provides easier-to-use wrappers to some of the control system elements, but it doesn't directly interact with the FMS, in fact nothing on the robot does.

When the robot receives a packet from the DS, the info is parsed and held by the FRC_NetworkCommunications task. When you ask WPILib for joystick info, it asks FRC_NC and returns the latest. This also tells you what mode (auto, tele, or disabled) that the DS told the robot to be in. When an FMS is present, it coordinates the DSes and they tell the robots.

To set a motor, you tell WPILib, and WPILib eventually calls into the ChipObject component that pokes an integer into a memory-register on the FPGA. The FPGA also knows about the mode and ignores the PWM register if the robot is disabled.

So, I'd encourage you to look through the WPILib code, put in print statements, put in breakpoints, etc. I think you'll find that the lower levels that set motors and such are still understandable and are probably doing what you'd do in your new code anyway. If not, you can be more specific in your request or rewrite.

Greg McKaskle
Reply With Quote
  #10   Spotlight this post!  
Unread 18-05-2013, 16:05
William Kunkel William Kunkel is offline
Programming Lead
AKA: Kunkel
FRC #0422 (Mech Tech Dragons)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Richmond, VA
Posts: 94
William Kunkel is an unknown quantity at this point
Re: How much of WPILib is required for robot code to be legal?

Thanks for the clarification. This isn't really intended as a set of bug fixes for WPILib, it's more a result of dissatisfaction with the way robot code is organized, as well as an attempt to learn more about how the code is handled at a low level. It might not result in anything, but I think it would be a good experience to try rewriting some or all of WPILib.
Reply With Quote
  #11   Spotlight this post!  
Unread 19-05-2013, 14:00
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: How much of WPILib is required for robot code to be legal?

It's all about the learning. That is why I offered up the lower level details. In my opinion, learning to read the code of others and understand why it was written that way is probably the single most critical skill for a programmer to develop.

Rarely is code perfect, and even if it is, there are alternatives which are likely just as good or better based on the judgement criteria. Being able to read WPILib well enough to improve upon it or discuss alternate implementations may be the reason why it was distributed as source code ... in several different languages.

Greg McKaskle
Reply With Quote
  #12   Spotlight this post!  
Unread 27-05-2013, 11:18
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: How much of WPILib is required for robot code to be legal?

If you come up with any good bugfixes or additions, please pull request to https://github.com/rbmj/wpilib

I won't take compatibility breaking changes, because I'm trying to stay source-level compatible with upstream to make it easier for teams to drop in - right now it's mostly just changes to build system, c++11 stuff, and killing warnings.

I was thinking about making a community developed fork of wpilib - I've always been a tad dissatisfied with how opaque development of wpilib is, the release cycle, and how difficult it is to get changes in from outside the project. If I thought there was enough skilled manpower to sustain it...

I wish I still had a cRIO.
__________________
FRC 612 '12
USNA '16
Reply With Quote
  #13   Spotlight this post!  
Unread 02-06-2013, 12:35
MrRoboSteve MrRoboSteve is offline
Mentor
AKA: Steve Peterson
FRC #3081 (Kennedy RoboEagles)
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2011
Location: Bloomington, MN
Posts: 578
MrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond repute
Re: How much of WPILib is required for robot code to be legal?

I'd be interested in hearing more about the issues that you ran into with your robot code this year. While I have some "would have done it differently" moments with the command-based approach, we have not run into anything that prevented us from achieving our goals.

I mentally model WPILib as having several different subsystems, with important ones being:

. a class hierarchy that represents all of the physical devices that can be attached to the robot
. the NetworkTables abstracting, which is a state sharing mechanism between the DS and the robot
. A layered set of application-building frameworks that allow you to build a robot control system at one of three levels of abstraction:

Simple -- you handle the loop
Iterative -- loop abstracted out
Command-based -- event-driven

If you don't like the application-building frameworks that are provided, there's nothing in WPILib today that prevents you from building your own along side/above what is already there. In fact, if you build something new, it's adopted by teams, and you are careful about code ownership issues, you'd be in a good position to lobby to get your framework adopted into WPILib. The best model for this would be a library that is designed to work alongside WPILib.

If there are bugs in WPILib that you'd like fixed, the best approach is to report them with good repros attached, or a fix if you have one available. I've found the maintainers are very responsive to issues that I've reported. If you need the fix for your robot to work, bring the code for the class into your robot, give it a different class name, fix the bug, and run with that. No need to fork the whole thing in most cases.

Be sure you're ready to take on these issues with your fork:

. competition year updates (1-3) will need merging and resolving
. will need to quickly handle (1-2 days) any week 1 software updates (a la this year)
. harder for CSAs to provide support at competition (e.g., validating all required updates have been applied to the library)
__________________
2016-17 events: 10000 Lakes Regional, Northern Lights Regional, FTC Burnsville Qualifying Tournament

2011 - present · FRC 3081 Kennedy RoboEagles mentor
2013 - present · event volunteer at 10000 Lakes Regional, Northern Lights Regional, North Star Regional, Lake Superior Regional, Minnesota State Tournament, PNW District 4 Glacier Peak, MN FTC, CMP
http://twitter.com/MrRoboSteve · www.linkedin.com/in/speterson
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 03:21.

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