PDA

View Full Version : Learn C++ or Labview in a Summer?


RyanJK
05-03-2008, 11:53 PM
So, I was wondering if I can get some help in decided a programming method. Here's the story:

In this our rookie year, our team had 2 competent programmers, but both of them have now graduated out of the school and are going to colleges out of the state. Add on top of that the fact that they were the only ones in the team who knew how to program, and the fact that we have not been able to find any mentors who could program, I think you can all realize that we're in pickle for next year.

I was the only kid on the team that expressed any fraction of interest in learning how to program the robot next year, so now I've got a new problem. I have got to learn how to program this summer beofre the season starts up. The hard choice will be deciding to learn C++ or Labview.

I was wondering what your thoughts are on what method I should learn. Through research, I can tell that both methods should give me decent control over the robot. My question is which do you guys think I can learn in a summer. Also, once I have decided on a method to program with, how should I learn it? Would buying a book off Amazon be enough to learn how to code? Help PLEASE!

Tottanka
05-04-2008, 12:16 AM
The following is just my own opinion:

i woulds suggest you learn both. One summer is more than enough to master those 2 languages in a level required to program in FRC.
The LabView might be a bit easier for you to learn, as it is a graphical programming language.
C++ is much more useful in the world and in finding a job. I suggest you learn it never mind what you are planning to do in FRC, taking this chance to learn C++ would be great for you.
I also would strongly suggest you convince at least 1 more member from your team learn programming too, as you will have a hard time alone in this.

- Liron

Akash Rastogi
05-04-2008, 12:23 AM
I agree with Liron, you could easily learn both over the summer if you're committed to it, as you said. I know people who have learned languages like Python in a couple of days. And plus, you have people here on CD to help. :)
Check around in the white papers on here for programming advice, they really do help.

Plus, I've been told by a friend that next year's control system will be very easy to program. So easy that he'll let me try my hand at programming after only a few short lessons.

David Doerr
05-04-2008, 06:32 AM
This summer is a great opportunity to learn both.

For C++, try the tutorial at http://www.learncpp.com/. As a companion to the tutorial, download Visual C++ Express 2008 at http://www.microsoft.com/express/. When you are finished and comfortable with those, download and get familar with the eclipse CDT at http://www.eclipse.org/cdt/.

For LabVIEW, load the copy of that came in the 2008 KOP. Begin with the "Getting Started with LabVIEW" under "Resources" in the right pane when you first start LabVIEW.

Learning the languages is only the first step in programming robots with the languages. You can get started with robot programming if you have access to a LEGO Mindstorms NXT robot.

For LabVIEW programming, download the NI LabVIEW Toolkit for LEGO Mindstorms at http://digital.ni.com/worldwide/bwcontent.nsf/web/all/EF8C9AC1BB5B13908625723D006A9E7A.

Robolab -- based on LabVIEW -- is another excellent way to get used to programming NXT robots in LabVIEW. You will have to buy a copy, however, for about $70. Buy version 2.5.4 at http://www.legoeducation.com/store/detail.aspx?CategoryID=159&by=9&ID=371&c=1&t=0&l=0, and then download the latest patch at http://www.legoengineering.com/content/view/87/140/.

You can also program NXT robots in C (not C++) with RobotC. You can download a trial version -- I think it's good for 30 days -- at www.robotc.net.

RobotC and Robolab are excellent companion programs because they have all of the same functionality implemented as LabVIEW SubVIs in Robolab and as procedures in RobotC. On the FLL teams I've coached for the last few years, the students have done all of their program development in RobotC, because it is very fast to do so, and then have ported their programs to Robolab to stay legal for FLL competition. (against the rules to use C in FLL) It is very easy to port back and forth due to the almost one-to-one correspondence in functions, and it's a great way to learn both text and graphical based programming side-by-side.

You can also program NXT robots using C++ if you go here: http://lejos-osek.sourceforge.net/ -- with the added bonus of being able to learn the eclipse CDT. I have not tried this yet, but it looks like it's worth checking out.

-Dave

Adam Y.
05-04-2008, 11:17 AM
The following is just my own opinion:

i woulds suggest you learn both. One summer is more than enough to master those 2 languages in a level required to program in FRC.

I wouldn't necessarily be too sure about that. Sure learning C++ is easy but the problem is that there are other areas that maybe useful to learn. You can easily write some pretty convoluted code without learning about design patterns.

slavik262
05-06-2008, 11:02 PM
I would say learn both. www.learncpp.com really helped get used to C++ and really taught me a lot.

gunsanbob
05-07-2008, 05:02 PM
Like http://www.learncpp.com/ (for C++) is their any good website like this for labview

I took programming class for Visual basics and Pascal
,but i never programmed in C or C++. will it be easy to learn C++ because I took Visual Basics and Pascal. I also have another question is there any website that specially for FRC robots.

ComradeNikolai
05-07-2008, 05:06 PM
If you are familiar with both VB and Pascal, learning C++ should be a piece of cake, since you should already have the programming logic down, understanding of types, etc. The hardest thing will just be learning the new syntax, which will probably seem a bit odd at first, especially having to terminate a line with a semicolon (VB just uses the line break).
There aren't any specific FRC programming websites which I'm aware of, but there is LOTS of material on CD, and the default code itself gives you enough of an intro that you can learn lots from it. However, please keep in mind that next year's controller will be programmed differently, as the control system is being switched.

willson.thomas
05-08-2008, 09:45 AM
I would suggest learning both as most have said. I think that mastering the current control system would also be a good idea as it gives you programming experience and a platform for prototyping. Also, I believe most code would be able to be ported without too much trouble. You could figure out how to do autonomous modes, which could definitely be useful in the future.

I am in a similar boat to you. Our only programmer is graduating this year. Over the past couple months, I have become familiar with the control system, mecanum programming, and teleoperated code. Now I just have to figure out how to use encoders and sonars to guide the robot.

slavik262
05-08-2008, 08:07 PM
Especially if you're starting coding now, I would take a look at WPILib. WPILib is a library for the current controller that simplifies many tasks, such as using encoders and ultrasonic sensors and outputting to motors, and is used as an alternate to Kevin Watson's default code. Also, from what I understand, next year's system will incorporate WPILib.

Our entire robot was coded with WPILib this year, and I would be more than happy to provide samples and help if you want. Feel free to contact me in any way.

I am extremely excited for next year due to the fact that we will finally be able to use floating-point numbers, opening up an entire avenue of possibilities.

Salik Syed
05-09-2008, 11:57 PM
I would encourage you to rather learn general programming concepts (i.e design patterns, data structures, algorithms) rather than focusing on getting the specifics of a certain language down... C might even be enough for that. You might want to check out "The Art and Science of Computer Programming" by Donald Knuth. I haven't read it myself but I hear it's the best for learning everything there is to programming.