|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Seeking advice for rookie programming
Hello! I'm a member of the newly created FRC Team 6420, and am looking for advice on programming. I've been the main programmer for FTC for the past two years, using Android Studio. You can view my work for this year here.
I'm familiar with Java & IntelliJ, but our main mentor is recommending we use C++ because teams in the area use it and we will be able to get help. I have some limited experience with C++, and no experience with eclipse. I'm aware the Labview exists, but I really don't like any sort of visual programming. It seems exceedingly clunky to me. So. What would you recommend? Are there online tutorials for FRC programming? How is it similar / different to FTC programming? Anything else you'd like to add? Thanks! |
|
#2
|
||||
|
||||
|
Re: Seeking advice for rookie programming
Welcome to FRC!
WPILIB ScreenStepsLive is the definitive FRC programming tutorial. If you have experience with Java, I would personally recommend using that. Changing IDEs is a lot easier than changing languages. I've also seen some people using IntelliJ and Gradle to do robot code. If you know Python (or don't, it's easy to learn!), that's also an option, using robotpy. |
|
#3
|
|||
|
|||
|
Re: Seeking advice for rookie programming
There may be other opinions, but I would recommend staying with what you know -- in this case Java. The "pain" of learning C++ just isn't worth it. (And this coming from a mentor who knew C++ and had much more C++ experience prior to starting this mentor gig and having to learn Java). Also, if there continue to be FTC teams that you are drawing students from, you have the advantage of having incoming programming team candidates with Java expertise.
I mentor both FRC (2992) and FTC (8991 and 10337) teams for programming using Java, and we have found the advantage of having incoming FRC students with FTC Java experience to be a great jump starter. I recommend you check out https://wpilib.screenstepslive.com/s/4485 which is the documentation for the controls and programming from last year. AFAIK the 2017 version is not yet posted (though there is some 2017 beta info at that same site). Whether you use C++ or Java, you will likely be using Eclipse. It's not that different from Android Studio. Installation instructions at the above website are reasonably easy to follow. Its actually a bit easier to setup for Java than C++. The API tutorial for Java is pretty decent. You will see a ton of similarity w/ FTC API for accessing hardware and driver station. The IterativeRobot base class is very similar to the OpMode base class for FTC. While it may seem a bit more complex at first, I strongly recommend you look into the "Command Based" programming model. The "Robot Builder" tool that comes w/ the API is a good way to jump start into Command Based programming. My first year as a mentor, the team had lost all of its programming resources so we were essentially programming rookies. We switched that year from C++ to Java and started off doing IterativeRobot but switched partway through build season to Command Based as it makes Autonomous programming much easier (it enables a base class called CommandGroup similar to LinearOpMode from FTC). Command Based also allows easy multitasking for your robot, with each "subsystem" able to operate fairly independently, making your code easier to implement and troubleshoot. Finally, make sure you take a look at the SmartDashboard tool and API. This is similar to (but much more powerful than) the Telemetry functions in FTC. I took a quick look at your FTC code, and it looks good. I don't expect you to have any issues making the FRC transition. Good luck and have fun Mike |
|
#4
|
||||
|
||||
|
Re: Seeking advice for rookie programming
Disclaimer: my team is switching from C++ to Java this year
C++ Pros
Java Pros:
Last edited by euhlmann : 12-19-2016 at 11:39 AM. |
|
#5
|
||||
|
||||
|
Re: Seeking advice for rookie programming
Disclaimer/Background: I'm a software engineer with 30+ years experience programming in C and C++, but I know a fair amount of Java as well. I have been working with our FRC team doing C++ code for 11 years. I have no experience with FTC code.
I'm not going to tell you what you should choose, but here are are few points to consider:
![]() Save Save Save Save Last edited by MamaSpoldi : 12-20-2016 at 09:53 AM. Reason: typos |
|
#6
|
||||
|
||||
|
Re: Seeking advice for rookie programming
I agree with much of what has been said in this thread, but...
For 99.9% of FRC teams, this doesn't matter. Python is even slower than Java and you can build a high performance robot using it. If you find that you are running into speed issues solely because you're using Java, you're almost certainly doing something wrong and should reevaluate your approach. |
|
#7
|
||||
|
||||
|
Re: Seeking advice for rookie programming
Quote:
Quote:
Basically, the general idea is that C++ provides several ways to store, transfer, and access data while in Java there's only one way. You don't really need to know this unless you plan on learning C++ |
|
#8
|
|||
|
|||
|
Re: Seeking advice for rookie programming
My team has used C++ for the past several years, but we are switching to Java this year because it's the language our school teaches in a programming course and we're sick of pointers.
I've used both C++ and Java, and I'd say that Java is much easier to work with. Switching from Java to C++ might seem reasonably easy, but there's a bunch of quirks you will need to learn. Nothing is different with syntax, but, as has been mentioned on this thread, the ways data is stored is rather different. |
|
#9
|
|||||
|
|||||
|
Re: Seeking advice for rookie programming
In your situation, I'll unhesitatingly recommend java. Unless you already know c++ quite well, or are working from a considerable existing code base, or are doing something requiring really tight optimization, the "advantages" of C++ over java are really just more rope to hang yourself. It sounds like none of these apply in your situation. Outside of assembler, about the only thing which can cause as much confusion as a pointer arithmetic error with so little effort on the part of the programmer is an abused FORTRAN common block, and for pretty much the same reason.
|
|
#10
|
||||
|
||||
|
Re: Seeking advice for rookie programming
Another thing to consider when selecting a language, sustainability. We have some good programmers, and they were thinking about switching from Java to C++. There were some robotics stuff that they wanted to try, that might require a faster processing loop than WPI-Lib. So we talked about it. Our high school teaches Java, so if they wanted to switch to another language, they had to be able to develop a program to teach future programmers C++. They then decide that they would stay in Java, since it fits with what the school teaches.
So TLDR, pick a language that's best for the club and can live one |
|
#11
|
|||
|
|||
|
Re: Seeking advice for rookie programming
There are lots of good arguments on both sides in this thread, but I think that sticking with what your team as a whole knows best will serve you better. When push comes to shove, your team needs to be able to sort out its own code issues--your neighboring teams won't be there in your pit when the inevitable competition-day bugs arise!
I'd also argue that you're more likely to get urgent programming help here on these forums than from neighboring teams--there's simply a MUCH larger pool to draw on here! Think about the number of responses you've received to this question here in less than 12 hours! Either way you go--good luck! It's a blast! |
|
#12
|
||||
|
||||
|
Re: Seeking advice for rookie programming
Quote:
One thing that I will note is that the teams that need help are disproportionately using languages other than C++. This suggests to me that teams are more conservative about moving to it than they need to be. |
|
#13
|
|||
|
|||
|
Re: Seeking advice for rookie programming
Quote:
(I've heard some object to this by arguing that it is indeed pass-by-reference, but variable assignment in java is best interpreted as name-binding. But this is not how the language specification describes it.) Last edited by Oblarg : 12-19-2016 at 10:25 PM. |
|
#14
|
||||
|
||||
|
Re: Seeking advice for rookie programming
Quote:
|
|
#15
|
|||
|
|||
|
Re: Seeking advice for rookie programming
Hint: Programmers like to argue about their favorite languages :-)
On our team our mentors (myself included) prefer C++ as a language; however, our FTC feeder system (in Michigan FTC is generally a middle school program) is now in Java and our high school AP Programming class is taught in Java. Based primarily on these two factors we (the mentors) supported the idea of using Java even though it is not our personal favorite programming language. Prior to that we had been using LabVIEW which, while I will admit I never grew to love, I least felt I had a pretty good understanding -- but we never found it easy to create work flow that supported 10+ programmers without more discipline than we were able to maintain with high school students during build. I would suggest writing up a pro and con for each language. Keep in mind your primary goals -- different teams can easily have different goals. For us it was choosing a language which will allow us to engage the most students (we have a large programming sub-group) and field a competitive robot. Other teams may want to prioritize the learning of only one or two programmers and they are personally going to get more out of using C++ or Python -- there is no one perfect answer. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|