View Full Version : Open-source FRC code
JBotAlan
26-12-2007, 23:30
I think more and more often that once the season is finished, I am going to release my custom-made source under an open-source license. I honestly don't see any disadvantages to this; doing so would only encourage others to learn by example. Yes, it would provide drop-in files for different systems, but I don't even believe using code written before the year's build season is FRC-legal.
So I am debating whether or not to use the GPL, or to come up with a license that basically says "Do not use this code in its entirety on a robot; use it as a reference only". I'm leaning towards GPL; but I'd like to hear other opinions.
-I would only do this once the season is finished--I don't believe we are mature enough to get complete blueprints for the competition's machine before ship date...that just seems like it would promote cheating. Maybe someday we can have truly open-source robots, but I don't think that day has come yet.
-I realize I will not be able to relicense any of IFI's stuff, or any of Kevin Watson's stuff. My intent is not to release an entire MPLAB project, but rather just a few files of which I have written from scratch.
So, I'd like to hear your comments.
JBot
i like the idea :)
is there a website that you can put code like this for FIRST? if not im willing to make and host one also if i ever get around to learning how to do cool programming ill post mine for others to use.
...forest
JBotAlan
26-12-2007, 23:47
I seem to remember seeing a site for this specific purpose, but Google is unable to find it, so it must not exist (just kidding...).
I know that I will be hosting code of my own off our team website (http://www.trucktownthunder.com/). That just seems the logical place for it. I just don't have the free time to put together a PHP system for uploading files, creating tutorials...I'm imagining something along the lines of CD-Media, except much more souped-up and targeted at programmers.
Just throwing out ideas at this point.
JBot
id be willing to make a site for this purpose if people will use it. i just need a list of things that would be useful on it so i can lay it out properly. then its the fun part of coding it.
..forest
EricVanWyk
27-12-2007, 00:23
I know that this sort of concept has been thrown around a few times. I like the idea to the point that I believe that open sourcing your code (after the season ends) should be mandatory.
I think frCoder http://frcoder.sourceforge.net/ was the most recent. It appears to be borked right now.
When I was a student, we called it the "Codex" or some such.
AustinSchuh
27-12-2007, 02:38
I love the idea! code.google.com seems like a good place to host your code.
-I realize I will not be able to relicense any of IFI's stuff, or any of Kevin Watson's stuff.
My team would also like to open source our code by putting it on code.google.com this year. During the season, we could then have svn access to our code from anywhere we have an internet connection. Currently Kevin's license is preventing us from just uploading our code. Any ideas about how to deal with this? I don't want to leave out those parts of the code, since they are just as vital to our code as what we wrote and will write.
I have found a couple of other team's code on code.google.com. The current standard seems to be to call your project team$(teamnumber) where $(teamnumber) is your team number. Ours is called team971. It is empty currently since we are still working on what to do about licenses.
JBotAlan
27-12-2007, 08:47
Currently Kevin's license is preventing us from just uploading our code. Any ideas about how to deal with this? I don't want to leave out those parts of the code, since they are just as vital to our code as what we wrote and will write.
As far as the license goes on Kevin Watson's stuff; you have 2 options: get permission to upload (probably won't happen) or don't upload it. I think the second option is your only choice; you will just need to link to Kevin's site and say something like "add KW's serial_ports.c/h to this project before compiling".
I really hope Kevin opens up his licensing a bit, but he does not want commercial use, and using the GPL would allow whatever commercial use, anywhere. We'll have to consult him on this, but it sounds like his trust has been abused, and he is not likely to relicense his stuff because of this.
Thanks for your support. I thought someone was going to shoot this down, but nobody did. Nobody even voted for anything besides "Good" on the poll...:D
JBot
tajmorton
27-12-2007, 16:22
I really hope Kevin opens up his licensing a bit, but he does not want commercial use, and using the GPL would allow whatever commercial use, anywhere.
There's a myriad of different open source licenses (http://opensource.org/licenses). I'm not sure if there are any that explicitly deny commercial use, but you can always modify a license and add whatever restrictions you want to it.
The GPL says that if you use GPL'd code in your software, your software must also be GPL'd. So, for a company to use your GPL'd code, they would have to open source their code as well.
The BSD license (which might be what you're thinking of?) basically says, "do what you want to with this code--but give me some credit somewhere."
There are some Creative Commons (http://creativecommons.org) licenses which explicitly deny commercial use, but they're not recommended for source code (I'm not sure why).
Oh, the wonders of open source licensing. :-)
- Taj
I like the idea of open-source code. It can and will stimulate learning. While all teams need to write fresh code every year, they don't necessarily need to reinvent wheels. I think if enough 'elegant' code is posted, someone might even write a book based on it, much like 'FIRST Robots...Behind the Design' by Vince Wilczynski and Stephanie Slecycki.
EHaskins
27-12-2007, 18:52
I personally don't like the traditional GPL license due to its viral nature.
If you're looking for a reference only license you can look at the MSRL (http://www.microsoft.com/resources/sharedsource/licensingbasics/referencelicense.mspx).
EDIT: Here is an episode of Hanselminutes discussing open source licensing (http://www.hanselminutes.com/default.aspx?showID=104). If nothing else it might give you a good starting place.
JBotAlan
27-12-2007, 23:33
I personally don't like the traditional GPL license due to its viral nature.
That is not a pitfall here as we are trying to promote GPL'd open source free files. Not to mention this "viral nature" was written into the license...and why not? We're looking to promote software freedom. Viral is good in that case.
The GPL says that if you use GPL'd code in your software, your software must also be GPL'd. So, for a company to use your GPL'd code, they would have to open source their code as well.
Correct, but it could still be used in a commercial product. Kevin Watson has specifically said he does not want people making profit from his code.
I still like the GPL for this.
JBot
I'd check on the exact terms of the GPL license before you do this. I'm not sure if you can put some files under the GPL while leaving some files under Kevin's license, as the two licenses are not compatible.
I'll all for the idea though.
JBotAlan
28-12-2007, 13:59
I'd check on the exact terms of the GPL license before you do this. I'm not sure if you can put some files under the GPL while leaving some files under Kevin's license, as the two licenses are not compatible.
Since Kevin Watson has expressly stated that he does not want his files re-posted, I am not going to re-post them. It is perfectly fine to GPL my portions of the project. I am also not re-posting IFI-written code as they still hold the copyright whether or not they choose to enforce it. If this project takes off, I am going to make it very clear that people can only license what they own, and nothing more.
JBot
11Mort11
28-12-2007, 14:08
default code now is ok but open source auton that is written by a teams programmers would probably take away from the competition from team to team to see who has the best code/programmers. there should be other ways to help new teams such as having examples of past years just not open source for the current year
bear24rw
28-12-2007, 14:26
I think it would be cool if we had a place on chiefdelphi where we could all dump our code from the past years into, i guess you could do it with white papers but a place specifically for posting code snippets and example code would be nice
lukevanoort
28-12-2007, 14:46
default code now is ok but open source auton that is written by a teams programmers would probably take away from the competition from team to team to see who has the best code/programmers. there should be other ways to help new teams such as having examples of past years just not open source for the current year
I don't really think that that would happen. Teams have been publishing gearbox designs (with dimensioned drawings and a BOM) for years, and I don't think that has lowered the level of competition. Even if it did make it easier for rookies to write amazing autonomous routines, the competition would still be there--just at a higher level. Plus, I don't think autonomous code from one year will necessarily be applicable to the next (with a few notable exceptions like StangPS). For example, our coolest autonomous routine this year (that never ran.... stupid turret broke) is about 1000 lines of very specialized code; I know that it would be almost completely useless to use much of its structure in the 2006, 2005, 2004, and 2003 games. So, I assume 2008 code will be unusable in 2009 (especially since the control system is changing). In summary, my view of the use of open-source'd robot code is like what Amanda Morrison said about learning to solve a Rubik's Cube: Sometimes, having someone that can teach you just shows you another way to do what you've been doing, but in less moves.
Since Kevin Watson has expressly stated that he does not want his files re-posted, I am not going to re-post them. It is perfectly fine to GPL my portions of the project. I am also not re-posting IFI-written code as they still hold the copyright whether or not they choose to enforce it. If this project takes off, I am going to make it very clear that people can only license what they own, and nothing more.
JBot
What does it mean to say that two licenses are "compatible"?
In order to combine two programs (or substantial parts of them) into a larger work, you need to have permission to use both programs in this way. If the two programs' licenses permit this, they are compatible. If there is no way to satisfy both licenses at once, they are incompatible.
Can I apply the GPL when writing a plug-in for a non-free program?
If the program dynamically links plug-ins, and they make function calls to each other and share data structures, we believe they form a single program, which must be treated as an extension of both the main program and the plug-ins. This means that combination of the GPL-covered plug-in with the non-free main program would violate the GPL. However, you can resolve that legal problem by adding an exception to your plug-in's license, giving permission to link it with the non-free main program.
IANAL, but unless I'm reading this wrong, that would imply that the entire program must be licensed under the GPL, which it is not.
seanwitte
28-12-2007, 20:46
There have been rules in past seasons that more or less require a full rewrite of the code from year to year. While it would be a good learning resource, the code could not be used without modification on an FRC entry.
i have a question. if we as a community get together and develop a library of code and make it available to everyone, sort of like what kevin has done, are we legally allowed to use that code over and over?
trekkiencc74656
31-12-2007, 19:25
i have a question. if we as a community get together and develop a library of code and make it available to everyone, sort of like what kevin has done, are we legally allowed to use that code over and over?
I dont see why not if we started from scratch and everyone who worked on it gave full access to their source to other teams. We could then have our own version of the default code and include in the licence that it can be used as a refence or starting point for rookie teams depending on how much is included in the release.
JBotAlan
01-01-2008, 00:34
Realize that this post contains citations from the 2007 Manual. It has no bearing on the 2008 or prior seasons. Do not use this as an interpretation on future Manuals.
I dont see why not if we started from scratch and everyone who worked on it gave full access to their source to other teams. We could then have our own version of the default code and include in the licence that it can be used as a refence or starting point for rookie teams depending on how much is included in the release.
Actually, technically by last year's rules, using last year's code, even if widely published, is *not* legal. Per section 8.3.3 of "The Robot", "the schedule rules apply to both hardware and software development." Per rule <R17>, "absolutely no fabrication or assembly of any elements intended for the final ROBOT is permitted prior to the Kick-off presentation." These two rules combined mean that we cannot use any pre-kickoff code on our robot.
I wonder if FIRST realizes that IFI's and Kevin Watson's code were in use...and portions of them were pre-Kickoff...I hope we get a clarification this year.
JBot
trekkiencc74656
01-01-2008, 11:06
If we dont know what the rules are yet then why cant we at least write drive code and build the drive train as these are standard between years and should have no effect on the outcome of the match. I mean most teams ours included reuse code from the year before and start working on it prior to the kickoff.
Alan Anderson
01-01-2008, 11:36
Actually, technically by last year's rules, using last year's code, even if widely published, is *not* legal. Per section 8.3.3 of "The Robot", "the schedule rules apply to both hardware and software development." Per rule <R17>, "absolutely no fabrication or assembly of any elements intended for the final ROBOT is permitted prior to the Kick-off presentation." These two rules combined mean that we cannot use any pre-kickoff code on our robot.
The rules permit COTS assemblies to be used. That applies to hardware in an obvious way, but it can be (and has been) interpreted to let teams use prewritten software from a source like IFI or Kevin Watson.
If we dont know what the rules are yet then why cant we at least write drive code and build the drive train as these are standard between years and should have no effect on the outcome of the match. I mean most teams ours included reuse code from the year before and start working on it prior to the kickoff.
I would hope that most teams actually followed the rules and did not use code that they developed before the kickoff. I know that several teams with a reputation for strong software skills had to make an extra effort last year to rewrite functions that they could have copied directly from their code archives.
JBotAlan
01-01-2008, 11:48
If we dont know what the rules are yet then why cant we at least write drive code and build the drive train as these are standard between years and should have no effect on the outcome of the match. I mean most teams ours included reuse code from the year before and start working on it prior to the kickoff.
We do our best to follow the rules. This past years' rules said "no" to writing any code at all for use on the final product. If you want to write code as an exercise, go ahead--FIRST has no jurisdiction over your personal time--but do NOT use that code on the robot if it wasn't written inside build season or a fix-it window. That's just GP.
Consider for a moment the newbie team who has no robot to test with, no compiler/IDE to mess with code, and nothing until they get their KOP on the 5th. Your team would have an unfair advantage over that team if you used last year's code--that newbie team doesn't have anything. We are trying our best to keep the playing field level.
Note that it is perfectly fine to use old code as a reference, but even copying snips of it into the new code is against the 2007 rules, and likely will violate rules in 2008 also.
The rules permit COTS assemblies to be used. That applies to hardware in an obvious way, but it can be (and has been) interpreted to let teams use prewritten software from a source like IFI or Kevin Watson.
Aah...now I understand. IMO that interpretation is really iffy, but at least I understand where the teams were coming from. After reading through the rules again, I can understand how this was originally classified; however, because of one word (emphasis mine): COTS – A “Commercial, Off-The-Shelf” COMPONENT or MECHANISM, in it’s unaltered, unmodified state. A COTS item must be a standard (i.e. not custom order) part commonly available from the VENDOR, available from a non-team source, and available to all teams for purchase.
(in my eyes) the code is not legal. Take from this what you will, and if I see it pop up again in the 2008 rules, it's going directly to the Q+A.
My intent was not to lawyer, but rather to show that the rules do not support what every team has done and will continue to do. WPIlib is another package that this rule outlaws, IMO.
OK, I'm done threadjacking...:D
JBot
lukevanoort
01-01-2008, 11:59
available from a non-team source, and available to all teams for purchase.
(in my eyes) the code is not legal. Take from this what you will, and if I see it pop up again in the 2008 rules, it's going directly to the Q+A.
Can you not purchase something for $0.00? Or similarly, one can offer a service instead of money for a purchase. A service like, say, giving Kevin or the writers of WPIlib the satisfaction of knowing that their code is helping young folk learn about software?
JBotAlan
01-01-2008, 12:06
Can you not purchase something for $0.00? Or similarly, one can offer a service instead of money for a purchase. A service like, say, giving Kevin or the writers of WPIlib the satisfaction of knowing that their code is helping young folk learn about software?
Hahaha! I guess that works! :D
I just wish it didn't feel like a loophole to me...all FIRST would need to do is drop "for purchase." off the end of that sentence, and we'd be all set. But I'll leave that up to them.
JBot
If the open-sourced code were available in some central repository to all teams, then this rule wouldn't be an issue as long as people only reused code from that repository, would it? All the teams would have equal access, and therefore no unfair advantages.
So I am debating whether or not to use the GPL, or to come up with a license that basically says "Do not use this code in its entirety on a robot; use it as a reference only". I'm leaning towards GPL; but I'd like to hear other opinions.
I would wait until kickoff to decide - which I'm sure you will anyway. The discussion still rages about what uses of pre-kickoff code are legal.
If GPL-ing your code puts it in the same category as Kevin's code, then you might want to use a different license. If the rules prohibit using freely available code written before kickoff, then the GPL seems like a good choice.
I see no problems with using the GPL and combining it with non-GPL software. The only catch is that you shouldn't re-distribute the non-GPL code or binaries which were built with non-GPL code (unless those licenses permit it).
I see no problems with using the GPL and combining it with non-GPL software. The only catch is that you shouldn't re-distribute the non-GPL code or binaries which were built with non-GPL code (unless those licenses permit it).
Whether or not you see a problem with it is irrelevant if the licenses are not compatible. Incompatible licenses means you CANNOT license your code under the GPL.
lukevanoort
01-01-2008, 22:01
Instead of all this arguing about GPL vs non-GPL, why don't we just make our own license? As I see it what we need absolutely need is:
1) Redistributable
2) Intellectual property (not like Monster Cables, may they burn in whatever place their religion proscribes to people who rip off innocent customers with imaginary techno-jargon and sue all their competitors over idiotic claims, but just to keep people from saying 'I made this' when they didn't)
3) Compatible with Kevin's license
A thing that I think may make teams more likely to post code:
1) An additional clause teams can choose to license their code under if they want to that requires that the code not be used verbatim
Anyone else think making our own license is a good idea?
Or how about something awfully simple, such as the BSD license. It can be used in commercial projects, but the company would still have to attribute the copyright-holder. There's tons of open-source licenses out there besides the GPL, you just have to choose the right one.
Copyright (c) <YEAR>, <OWNER>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
JBotAlan
01-01-2008, 22:33
IANAL, but unless I'm reading this wrong, that would imply that the entire program must be licensed under the GPL, which it is not.
If I license my code under the GPL and release one or two files, it has no ties to any other pieces of code. At all.
You download it, you put it in your project, but realize that you cannot distribute the entire project now--you cannot relicense the entire thing to be GPL. But that's irrelevant--if you are using this for a private use, the GPL does not apply to any of it.
From the GPL FAQ (http://www.gnu.org/licenses/gpl-faq.html#UnreleasedMods):
The GPL permits anyone to make a modified version and use it without ever distributing it to others. [snip] It is essential for people to have the freedom to make modifications and use them privately, without ever publishing those modifications.
I think this is entirely clear.
I will take into consideration future rule changes, and may write my own license, because we do *not* want teams to copy anything out of this code repository verbatim.
JBot
JBotAlan - Yes, you are correct. GPL is fine for diffs, but you cannot redistribute your code along with Kevin's (which I guess his license prevents anyway). Sorry, I got confused with the whole distribution thing.
I'm surprised you don't want anybody copying the code verbatim though. If you don't want that, why not just release psuedo-ish code to show the process you went through? I'm not sure what the point of making the code open-source is if nobody can use it.
I personally believe a publicly available repository of code used by FIRST teams would be a major asset and even contribute to leveling the playing field between teams with huge resources and teams with few resources. Besides, a lot of the code will need to change, unless you release your complete robot plans and someone clones your robot too. I find it unlikely that someone would blindly copy a piece of code into their robot, and have it actually work properly.
artdutra04
02-01-2008, 03:31
You could just zip up the functions and files that you wrote (minus WPIlib, Kevin Watson's, and/or IFI's code) and upload it to CD-Media as a White Paper, and provide it "as is".
Just remember, we're getting a new Controller in 2009. For all we know they might want us to program it in Scheme*.
* Oh the horror. (I (will (never (look (at (a (parenthesis (the (same (way (ever (again)))))))))))).
For all we know they might want us to program it in Scheme*.
Hey, don't knock Scheme too hard. It's a good language to know, and there's a lot of powerful things that can be done with it.
While functional languages (scheme, lisp, ml, etc) are not used nearly as much as procedural languages, it's still useful to know one. Having more tools in your belt (or knowledge in your head) gives you more ways to approach a problem, which will help to make you a better programmer. Once you know any one object-oriented procedural language, like C++ or Java, it becomes very easy to learn another. That does not translate so well to learning a functional language.
When reviewing resumes of applicants at work, I always look to see what languages they list. If they include some functional language, I always mentally give them a few bonus points.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.