I thought that this might be an interesting metric to see.
You left out:
wish we could, the students aren’t there yet
I’d prefer to see, “Haven’t used it before, will be experimenting with it this season and hope to use it in the future”
We contemplated switching over to Python this year but with a new batch of students and a new controller, a new language seemed a bit much.
We’re in the same boat.
Kinda confused about this–Python is a MUCH easier language to learn then C++ or Java, or even labview in some ways. Mind explaining what you mean?
Since python isn’t a supported language(as far as I know) the API support isn’t there like it is for the other languages. Therefore much more of the background work is going to need to be done compared to the other 3 languages.
This is just my assumption though.
There’s a debugging and support cost. Java/C++ are very well supported and coming on CD and asking a question nets you a wide group that can answer questions. At events the CSA and likely a half dozen teams know the language and can help you debug. Python has less of a group.
As far as the API goes, the 2015 robotpy includes a full-fledged, feature-complete port of the java wpilib. It will be a huge improvement over the python setups of previous years.
The biggest barrier at the moment to using python is community support. The group of teams using python is currently rather small, but it is growing rapidly. More and more teams are becoming aware of it’s validity as an frc programming language
It is correct to say that python is not officially supported by FRC, and that at a competition if you have a problem there will be less teams that will be able to help you with a language-specific problem.
However (as far as I know), because of the WPILib interface has been identical to the supported languages, most problems that people have when using python in FRC are the typical problems that anyone else in FRC has – how to use the various devices that WPILib provides you. This means that other teams at a competition can help you, as long as you don’t have a language specific problem. It’s the same reason Java and C++ teams can help each other.
In it’s 4 year history, there have been very few problems that affected the python WPILib that did not also affect the other languages.
In 2015, the WPILib interface will be 100% python, instead of wrappers, so this year it is arguably more risky to use than in previous years. Once again though, the interface will be identical to a supported language. Additionally, we’ve created a lot of unit tests, and are aiming for high test coverage to mitigate those potential problems.
Additionally, in 2015 python will have expanded language-specific documentation, full gazebo simulation support, and eclipse plugins with similar functionality to the C++/Java functionality.
Thank you for your hard work on this. I’m excited to try this out this season.
How will the imaging be done for python?
We haven’t ironed out the details quite yet, but it will be similar to previous years: use the official FRC imaging tool to stick the right things on it, then run an installation script to copy the right files to it. It’s possible that we’ll build this functionality into the Eclipse plugin too.
One thing that I’m hoping to do is make it super easy to install other python packages on the robot too. That too, is TBD. However, I’ve got a lot of vacation/holiday time coming up…
For anyone interested in contributing to RobotPy, let me know, and I’ll give you read access to our 2015 github repositories + wpilib source for 2015. There’s a lot of work done – and yet still a lot to finish up! The more people that contribute, the better the end product will be.
Sure, but to me that wouldn’t mean “the students aren’t there yet”—that would be “we aren’t there yet, as a team, to be able to cut ourselves off from the safety provided by other languages”. Which is totally a legitimate opinion! Its why I’ve never used python in a competitive environment. But don’t blame the students yo
The issue I am having in deciding which language or team should use this year is which is the most useful to learn. Many of the rookies are completely new to programming in general and for that reason I thought python is the easiest to get started with; however, I am not a huge fan of Java even though we have used it for the past few years. What are the general opinions on C?
I have found that it’s really easy to teach students python, certainly easier than C/C++.
However, the thing that is argubly most important is teaching your students how to properly think about problems, and break them down and solve them. Once they know how to think about the problems, the rest is “just syntax”*.
Another possibility is to write the code in multiple languages. Python and java aren’t that dissimilar*, and once you figure out the hard part – eg, how the robot code needs to interact with the hardware – making it work in multiple languages is a pretty easy exercise IMHO. Seeing the same thing expressed in two different ways may help the student’s comprehension.
- Ok, ok, I’m oversimplifying here…
Just providing some additional datapoints we use in helping choosing a language for our team.
First to answer the OP question:
We used the python port of network tables last year, and plan to use it again if available in 2015. We program the robot in Java, and Vision in C++.
We teach our kids Java only because that is most likely the language they will be learning going to college, so we feel this gives them a leg up on the rest of applicants. After all, that is our primary mission.
It is very important to make the distinction for your team: Are you a team who has mentors whom can teach the language and solve problems, or is your team student driven, and they wish to follow a certain language. If the students are passionate about a certain language, try your best to accommodate that above all else. Student Interest trumps rationale.
My first language was C++ and assembly of a 8051.
In terms of easy to learn: My opinion is that Java is a good first start language, especially for someone who hasn’t programed before. The reason I say this is because Java is still a compiled language (technical it is 1/2 compiled and 1/2 interpreted), and the sytax it has is pretty easily identifiable in many other mainstream languages (C++/C# which are used extensively in industries today). For our specific use of Robotics because Java is a compiled language some errors can be identified at compile time, making code easier to debug, and faster to correct. There are still run-time errors that you can not get away from.
Python is a scripting language and its syntax is very similar to other scripting languages like Matlab (which I use everyday at work) but is rather different than mainstream languages.
I think it is easier to learn Python syntax after knowing Java, then trying to learn Java syntax after knowing python. I believe it is a lot easier to remove things from syntax, than to add them (like the necessity of brackets in Java, but the lack of them in python). (I also believe it is easier to learn Java after knowing C++, rather than trying to learn C++ after knowing Java, like dealing with destructors)
Python, is not a compiled language, it is an interpreted language, so the only errors you find are that at run-time. In my opinion, and this is only my opinion, it is harder to program Robots because errors are caught much later in the process.
Now, if FRC was a work assignment that I was doing on my own, my language of choice would be C++. This is because our task is an embedded application, and the C++ language gives the advanced user extreme control over execution, direct access to the operating system, and we get rid of any interpreter overhead by the java virtual machine.
However, because our goal is to give our students experience in a language they are more likely to use in college and personal projects (mobile apps, etc.), our language of choice is Java.
In the end, it doesn’t really matter what language you choose, all can get the job done in FRC as we have seen over the years, choosing the language which best suits your team must come from some external reason. There is no right answer for FRC alone.
However, one pro of python is that you can write the same application much quicker and with a lot fewer lines than its C++ or Java counter part. That’s because python removes all the extraneous syntax. When coding advanced algorithms, I typically code them in matlab first (another scripting language), just to get the logic right and not have to worry about syntax of Java and C++. Python and Matlab has that “It just works” feeling when writing code. Once I have the algorithm set in the scripting language, I can convert it to Java or C++, its a much quicker and easier process.
Also, python modules for scientific calcs blow Java and c++ libraries for similar purposes out of the water in my opinion in terms of availability and ease of use.
Hope this helps,
Kevin
P.S I am fully aware there are modules which you can use to compile python first, but in my opinion, its a waste of the reason you use the python language. Let the python interpreter compile and interpret in real time, with the efficiencies built in, like it was meant to do.
P.P.S Thank you to all that are working on the python FRC port. It is an invaluable resource, and without their efforts we wouldn’t even be able to consider python an option.
Just providing some additional datapoints we use in helping choosing a language for our team.
First to answer the OP question:
We used the python port of network tables last year, and plan to use it again if available in 2015. We program the robot in Java, and Vision in C++.
We teach our kids Java only because that is most likely the language they will be learning going to college, so we feel this gives them a leg up on the rest of applicants. After all, that is our primary mission.
It is very important to make the distinction for your team: Are you a team who has mentors whom can teach the language and solve problems, or is your team student driven, and they which to follow a certain language. If the students are passionate about a certain language, try your best to accommodate that.
My first language was C++ and assembly of a 8051.
In terms of easy to learn: My opinion is that Java is a good first start language, especially for someone who hasn’t programed before. The reason I say this is because Java is still a compiled language (technical it is 1/2 compiled and 1/2 interpreted), and the sytax it has is pretty easily identifiable in many other mainstream languages (C++/C# which are used extensively in industries today). For our specific use of Robotics because Java is a compiled language some errors can be identified at compile time, making code easier to debug, and faster to correct. There are still run-time errors that you can not get away from.
Python is a scripting language and its syntax is very similar to other scripting languages like Matlab (which I use everyday at work) but is rather different than mainstream languages.
I think it is easier to learn Python syntax after knowing Java, then trying to learn Java syntax after knowing python. I believe it is a lot easier to remove things from syntax, than to add them (like the necessity of brackets in Java, but the lack of them in python). (I also believe it is easier to learn Java after knowing C++, rather than trying to learn C++ after knowing Java, like dealing with destructors)
Python, is not a compiled language, it is an interpreted language, so the only errors you find are that at run-time. In my opinion, and this is only my opinion, it is harder to program Robots because errors are caught much later in the process.
Now, if FRC was a work assignment that I was doing on my own, my language of choice would be C++. This is because our task is an embedded application, and the C++ language gives the advanced user extreme control over execution, direct access to the operating system, and we get rid of any interpreter overhead by the java virtual machine.
However, because our goal is to give our students experience in a language they are more likely to use in college and personal projects (mobile apps, etc.), our language of choice is Java.
In the end, it doesn’t really matter what language you choose, all can get the job done in FRC as we have seen over the years, choosing the language which best suits your team must come from some external reason. There is no right answer for FRC alone.
However, one pro of python is that you can write the same application much quicker and with a lot fewer lines than its C++ or Java counter part. That’s because python removes all the extraneous syntax. When coding advanced algorithms, I typically code them in matlab first (another scripting language), just to get the logic right and not have to worry about syntax of Java and C++. Python and Matlab has that “It just works” feeling when writing code. Once I have the algorithm set in the scripting language, I can convert it to Java or C++, its a much quicker and easier process.
Also, python modules for scientific calcs blow Java and c++ libraries for similar purposes out of the water in my opinion in terms of availability and ease of use.
Hope this helps,
Kevin
P.S I am fully aware there are modules which you can use to compile python first, but in my opinion, its a waste of the reason you use the python language. Let the python interpreter compile and interpret in real time, with the efficiencies built in, like it was meant to do.
P.P.S Thank you to all that are working on the python FRC port. It is an invaluable resource, and without their efforts we wouldn’t even be able to consider python an option.
I agree with Kevin that I’d be very hesitant to use a non-compiled language for on-robot code during competition. More and more large web companies are discouraging Python in production code because it is too easy for small errors to sneak past static analysis tools, and achieving 100% code coverage in unit tests is almost impossible. An unanticipated runtime error on a robot could be disastrous.
Using Python during prototyping, as a non-essential process on the robot (ex. logging, web server, etc.) or on the driver station? I’m a huge fan!
We tried out python at both our off-season competitions after using java in our 2014 season. We had no issues with it and due to a number of our rookies having prior python experience we will probably use it in the upcoming season. While I’m not the programmer I usually end up adjusting a few variables and being able to program the robot with just a ssh client was a really useful feature.
While their are some disadvantages to using it, notably in support and reliability keeping our programmers happy and working quickly especially when we only have 1 or 2 is a fair trade-off for us.
Regarding Jared’s point – runtime errors are definitely a real concern when using a language like python. However, a big focus of RobotPy development in the last few years has been improving off-robot testing capabilities. While it’s definitely difficult to get to 100% code coverage, robot code in FIRST is generally simple enough where you can get to ‘good enough’. Besides, learning how to make your code robust in the face of unexpected errors is a good thing.
Last season I don’t think there was a single time in a competition match where our robot crashed because of a runtime error that a compiled language would have caught. The practice field is a different story, however…