Log in

View Full Version : Next Year's code


ExarKun666
21-04-2008, 20:11
I was confused at nationals, they said that they were going to have available C++, and Lab View (I think was the name) as languages, does this mean C won't be in use? Also second question for Lab View were can you find tutorials on it??

Andrew Schreiber
21-04-2008, 20:25
http://decibel.ni.com/content/community/first try looking there

DonRotolo
21-04-2008, 20:51
...or just Google LabView. It's very well documented and known.

chaoticprout
21-04-2008, 20:52
They made it pretty clear that it would be C or C++ when describing the new controller.

EHaskins
21-04-2008, 22:14
I was confused at nationals, they said that they were going to have available C++, and Lab View (I think was the name) as languages, does this mean C won't be in use? Also second question for Lab View were can you find tutorials on it??

C++ is a super-set of C, so you cound use plain C. This doesn't mean your existing robot control code will run, since it will be a different platform, but any of the purly algorithm code will still work.

ExarKun666
21-04-2008, 23:10
Is there any suggestions on what code I do use?

slavik262
22-04-2008, 00:05
If you're comfortable using C, I would strongly recommend C++. C++ just adds features such as objects and templates to C. If you are familiar with C syntax, picking up C++ should be fairly easy.

Robostang 548
22-04-2008, 08:12
I'm really eager to get my hands on some of the default code for the new controller. I'd like to see how its communicating with these modules and initializing them. I'm excited to see that it is multi-lingual (even thought I was hoping we could use python :) ) however I’m a bit disappointed. My team's programming mentor and myself are opposed to using labview. We kind of feel like we are going to be forced to use it because while yes you can probably do everything in c or c++ that you can do in labview, you know that they are going to make it easier for you to do it in labview (like programming the vision system). I don't know how much support or tutorials NI will provide for teams who do choose to program their robot in c or c++ and if they chose not to use labview they will be left to fend for themselves. Either way I think that the Chief Delphi community will be a huge help to teams that chose to not use labview. Plus, I had some discussion with my team and we talked about how the c code could be executed from lab view. Therefore you could write your code in c/c++, have lab view do the vision processing, then write a flag with what it sees to a global, where then labview would execute your c/c++ code as a module. You could get the best of both worlds and your actual c/c++ code would be what’s making the decisions for the bot.

Greg McKaskle
22-04-2008, 08:46
The SW engineers at NI know LV, but they are first and foremost C/C++ programmers. So, while we may encourage you to give LV a try from time to time, we also know C/C++ and when we say we are going to have parity in the libraries, we mean it. The vision libraries will be exposed through both a C interface and a LV interface.

As for documentation and tutorials for C/C++, that is the role that WPI is playing on this team.

Greg McKaskle

Kingofl337
22-04-2008, 09:24
Seeing the new controller is programmed with WPILIB I would suggest tinkering with the existing version for the current controller. After speaking with Brad he said everything available in Lab View should be available in C/C++.


I'm really eager to get my hands on some of the default code for the new controller. I'd like to see how its communicating with these modules and initializing them. I'm excited to see that it is multi-lingual (even thought I was hoping we could use python :) ) however I’m a bit disappointed. My team's programming mentor and myself are opposed to using labview. We kind of feel like we are going to be forced to use it because while yes you can probably do everything in c or c++ that you can do in labview, you know that they are going to make it easier for you to do it in labview (like programming the vision system). I don't know how much support or tutorials NI will provide for teams who do choose to program their robot in c or c++ and if they chose not to use labview they will be left to fend for themselves. Either way I think that the Chief Delphi community will be a huge help to teams that chose to not use labview. Plus, I had some discussion with my team and we talked about how the c code could be executed from lab view. Therefore you could write your code in c/c++, have lab view do the vision processing, then write a flag with what it sees to a global, where then labview would execute your c/c++ code as a module. You could get the best of both worlds and your actual c/c++ code would be what’s making the decisions for the bot.

marccenter
22-04-2008, 09:27
Although I have not used Labview, I have used a similiar product Matlab and it's associated program, Simulink, for the past four years on the GM Hybrid Program.
We used this platform to create the 2008 Model Year software for the recently released GMC Tahoe and Chevrolet Silverado. Simulink is a graphical based programming environment similar to Labview developed by Mathworks.

For those of you who have only used C/C++ environment, you will be missing out on all of the advantages of a graphical environment, most importantly the ability to debug your software on your desktop. You should be able to create
simple input functions that exercise your code and watch the output's respond.
Believe me, that functionality alone will quickly entice teams to make the switch from text based programming to graphical programming. :D

I am not certain what direction CD47 will go at this point. It appears that FIRST is leading us in the direction of Labview
while maintaining a legacy C-based environment.

Tom Line
22-04-2008, 09:43
The SW engineers at NI know LV, but they are first and foremost C/C++ programmers. So, while we may encourage you to give LV a try from time to time, we also know C/C++ and when we say we are going to have parity in the libraries, we mean it. The vision libraries will be exposed through both a C interface and a LV interface.

As for documentation and tutorials for C/C++, that is the role that WPI is playing on this team.

Greg McKaskle

That is absolutely awesome Greg, and is probably my biggest "worry". If the libraries are equal, then that is just about everything everyone in FIRST could ask for - 3 different programming languages with 2 different IDE's is far more than we have today.

ExarKun666
23-04-2008, 03:47
So then Lab View is basically in C language, but with the addition of a graphical enviroment to test that programming on?

Alan Anderson
23-04-2008, 08:19
So then Lab View is basically in C language, but with the addition of a graphical enviroment to test that programming on?

No. LabView is not a GUI for C. It is a graphical programming language. I have no simple way to describe it besides that. If it doesn't help you understand, I think you'll have to try it out for yourself.

And you can try it out for yourself. Every FRC team has a copy.

JesseK
23-04-2008, 10:16
You may also download labview from ni's first community website for a 30-day trial. I plan to take this trial and figure out what workshops should be made for our students in the Fall.

All I have to say is, I spent only an hour after install on it last night and I was able to create the in's and out's of our skid drive into the VI. All that's left is to put in the neutral zones we have and then test/tweak. Timewise YMMV, but this little bit was very easy to do. What I can't seem to remember is where the "custom script" box is so I can plug in our proportional control algorithm...

I plan to try to do this for a driver-centric mecanum drive by the end of the trial using (finally!) proper unit vectors, but who knows how successful the testing will be. This would also be possible to code in C/C++, but the "testing" would consist of console outputs whereas in LabView I can easily have graphs and meters for visual history.

psyco_klown
23-04-2008, 10:48
It's too bad Easyc will not be available next year. It made a difference on our team. The only way we could get it for next year is email FIRST and let them know how much we want it.

jtdowney
23-04-2008, 10:56
It's too bad Easyc will not be available next year. It made a difference on our team. The only way we could get it for next year is email FIRST and let them know how much we want it.

I overheard in the NI booth that easyC would be an option but obviously I have no confirmation from Intelitek or anyone else.

psyco_klown
23-04-2008, 11:17
Ya its an option but FIRST has left Intellitek out of the loop on the new controller. Intellitek can have it ready, It's just matter of FIRST giving them info on the design.

Greg McKaskle
23-04-2008, 20:56
So then Lab View is basically in C language, but with the addition of a graphical enviroment to test that programming on?

Not at all. The most obvious difference is that LV uses icons instead of words, but fundamentally, the big differences are that LV uses data flow for scheduling, and can therefore easily do multitasking at a pretty fine-grained level. Also, LV wires represent values, not references to values. This helps to avoid many side effects of procedural code.

Finally, LV encourages and rewards you making functions. Each function has a panel for entering values, and seeing results. These make very good modules for testing a portion of your algorithm "before" your robot is moving across the floor. You can test as many input sets and boundary conditions as you see fit. You can also have graphs and other useful indicators for looking at complex data.

So some of these are not language, but environment things, but these are fundamentally more important that the fact that LV is graphical instead of typed.

Greg McKaskle

ExarKun666
23-04-2008, 20:58
Well, okay if Lab View is all graphical, and I do now understand how to make it work, where exactly is probably some really good tutorials on it??
Also, just how different is C from C++??

mathking
23-04-2008, 21:21
How different C is from C++ pretty much depends on how you write code. The big difference is that C++ has objects, which opens up a lot of programming options. On the other hand, you can write purely or almost purely procedural code in C++, that looks pretty much like C. Picking up the syntax differences (which are really additions) in C++ is pretty easy if you know C already. But programming in an object oriented manner is not that easy to just pick up if you haven't done it before. On the other hand, if you know Java and C then picking up C++ is pretty easy.

Now here is a plea from a computer science teacher to all the students out there. Give Lab View a try. Don't be seduced by the argument that since it is graphical it is somehow less worthy than C/C++. There are a lot of good programming practices that Lab View can teach you. First and foremost among these is testing modules of code. This makes debugging much easier and leads to better overall coding. (One of the things I love about Java as a teaching language is the ability to add a main method to each class in order to test it.)

ExarKun666
23-04-2008, 22:09
Well, I was just thinking could you just simply use both, for example go and program in C/C++ then go into Lab View but it into the a simulator, and debug it, this might work, I am not sure on the extent, if Lab view can read C/C++ or not, but it's a thought I had.

TDohse
23-04-2008, 23:45
Well, I was just thinking could you just simply use both, for example go and program in C/C++ then go into Lab View but it into the a simulator, and debug it, this might work, I am not sure on the extent, if Lab view can read C/C++ or not, but it's a thought I had.

Using both languages is a good idea and a great way to make yourself a better programmer, but keep in mind LabVIEW is a full programming language itself, not an IDE or simulator for C.

LabVIEW does have the ability to call C functions in libraries, but if you want to debug C code you should be using the tools with your C compiler/IDE. For the 2009 FRC you will have the Wind River Workbench for C/C++ development & debugging.

where exactly is probably some really good tutorials on it??

Check out http://ni.com/community/first for tutorials and information. You should also have example code included with the copy of LabVIEW in your 2008 FRC kit.

Bomberofdoom
24-04-2008, 06:19
I'm trying to think of what are the main advantages of writing the robot's code next year in C++.

I know most of the language and i've done a project in Visual C++ before but I'm just thinking forward for next year to see what does this means for the robot.

What I can think for now is that it can help make all the robots functions for specific critireas (autonmous, teleop, disabled) orginized in a simple and recognizable way so anyone could understand the code better.

Classes could help define the set of functions that will work in this case and in that case (like I said, with the auto, tele and disabled, but also in the case of a certain switch turned on before the match and stuff like that).

Can't think of any much else. :-/ :confused:

StevenB
24-04-2008, 16:24
LabView is certainly cool software, and I'm excited that we have the chance to use it more fully. I'm also very glad to hear that C/C++ will be fully supported by NI.

For those of you who have only used C/C++ environment, you will be missing out on all of the advantages of a graphical environment, most importantly the ability to debug your software on your desktop. You should be able to create
simple input functions that exercise your code and watch the output's respond.
Believe me, that functionality alone will quickly entice teams to make the switch from text based programming to graphical programming.
Really, you should be able to do this with any programming language. That's the whole point of encapsulation with classes and functions.

ExarKun666
24-04-2008, 20:11
LabView is certainly cool software, and I'm excited that we have the chance to use it more fully. I'm also very glad to hear that C/C++ will be fully supported by NI.


Really, you should be able to do this with any programming language. That's the whole point of encapsulation with classes and functions.

Yeah that's what I thought, so that's why I was curious to which program language would in fact be better C/C++ (using encapsulation with classes and functions to debug) or Labview(using graphical imaging to debug your code) or third option of just first coding it in C/C++, then going to Lab View and re code the C/C++ in Lab View Code (yes this would take longer, and is it worth it?)

neutrino15
27-04-2008, 15:29
From another thread, an answer:

http://www.chiefdelphi.com/forums/showpost.php?p=743335&postcount=22