Go to Post Step 1. Understand the game and how to win the match and the event. - Chris Fultz [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 30-09-2010, 13:29
dotbran dotbran is offline
Registered User
AKA: Brandon Olsen
FRC #3219 (TREAD)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Auburn, WA
Posts: 68
dotbran is on a distinguished road
Best way to start?

I'm interested in programming our robot in C++ this year, but neither I nor anyone on the team has any experience with it. What are the best resources I could use to learn C++ coming from a background in LabVIEW?

(I know bits and pieces of ActionScript 2.0 and HTML as well, but not much.)
Reply With Quote
  #2   Spotlight this post!  
Unread 30-09-2010, 14:33
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Best way to start?

Your question implies that having a background in LabVIEW makes a difference. It doesn't. Graphical vs. text, procedural vs. dataflow, inherently single-threaded vs. inherently parallel...you will basically have to forget everything about LabVIEW anyway, so don't worry about how C++ relates to it.

Go to the recent "C++ Noob" thread for advice on learning C++. But if you know LabVIEW and nobody on the team knows C++, why switch?
Reply With Quote
  #3   Spotlight this post!  
Unread 30-09-2010, 19:30
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Best way to start?

If the C++ is robot related, then hopefully the common terminology, common parameterization, and common structure of the libraries will help a bit. There was an intentional decision to offer much of WPILib in source, and to show alternate language implementations to assist in cross-language communications and to hopefully assist in learning a subsequent language using WPILib and robotics as a common element.

I'd suggest opening examples that perform similar tasks and looking for similarities. Use reference books and/or tutorials to learn the stuff you don't know. As you make it through those examples, work your way to the starter code, vision code, etc. As Alan stated, these are very different languages, so don't expect it to be easy, but if you can learn both, you have your head wrapped around far more than the typical SW student.

Good luck.

Greg McKaskle
Reply With Quote
  #4   Spotlight this post!  
Unread 30-09-2010, 20:23
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Best way to start?

Cause C++ is used more often than LabView in the "real world". Do not argue, it is true, no one uses LabView to make video games, video games are a huge business, so I can infer that.


I digress, start small, literaly "hello world" then a small input out put program, then try making functions, then transition into classes and inheritence and polymorphism. Then you can try friend classes, structs and other stuff. Pointers too, those are important. I suggest not to focus on robotics programming, because chances are you rarely make a lot of classes and only will use the ones already in the library. One thing to keep in mind, it takes small steps, I learned the hard way and tried using classes before I learned some of the more basic stuff and gotten messed up.
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
Reply With Quote
  #5   Spotlight this post!  
Unread 10-10-2010, 21:26
Straberrie's Avatar
Straberrie Straberrie is offline
The Plague
AKA: Rebecca
FRC #0375 (Robotic Plague)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2007
Location: New York
Posts: 59
Straberrie will become famous soon enough
Re: Best way to start?

Hey dotbran!

I myself didn't know a line of code when I started and I can tell you from experience that FIRST makes it very easy to learn C++ in a painless way! Here are a few helpful links that can get you started!

http://first.wpi.edu/Images/CMS/Firs...ming_Guide.pdf

The link above will take you to the FIRST guide to C++. It is very useful and gives you the idea of what you can do to pretty much make anything work! This guide covers drive functions, basics of working the camera, and lots of other goodiness!

http://users.wpi.edu/~bamiller/WPILib/WPILib.pdf

This link will give you the library of the functions you will need to use. So, the first link tells you how and this link elaborates!

http://www.cplusplus.com/doc/tutorial/

If you are interested in learning C++ outside of the FIRST applications, take a look at the link above. It explains the ins and outs of the language and is very popular among beginners ( at least I like it).


If you have any questions, feel free to pm me! GOOD LUCK!

Ps. Take a look at the Windriver software! It has sample codes that you can use as a base for your robot code. Check out the "Simple Template"!
__________________
Team 375: The Robotic Plague
Current Robot: I-Chihuahua
Last Event: Big Apple Breakaway

Last edited by Straberrie : 10-10-2010 at 21:29.
Reply With Quote
  #6   Spotlight this post!  
Unread 10-10-2010, 22:01
Chris is me's Avatar
Chris is me Chris is me is offline
no bag, vex only, final destination
AKA: Pinecone
FRC #0228 (GUS Robotics); FRC #2170 (Titanium Tomahawks)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Glastonbury, CT
Posts: 7,720
Chris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond reputeChris is me has a reputation beyond repute
Send a message via AIM to Chris is me
Re: Best way to start?

Quote:
Originally Posted by davidthefat View Post
Cause C++ is used more often than LabView in the "real world". Do not argue, it is true, no one uses LabView to make video games, video games are a huge business, so I can infer that.
Sure you can argue with that. More people program things that aren't video games than things that are video games. Controls engineering and similar fields use Labview all the time.

(I do have to question how you fell you can speak with authority on the manner having never worked a job using CS, ever...)

I feel it's worth noting that my school issue laptop came with Labview pre-installed, but not a C++ IDE.
__________________
Mentor / Drive Coach: 228 (2016-?)
...2016 Waterbury SFs (with 3314, 3719), RIDE #2 Seed / Winners (with 1058, 6153), Carver QFs (with 503, 359, 4607)
Mentor / Consultant Person: 2170 (2017-?)
---
College Mentor: 2791 (2010-2015)
...2015 TVR Motorola Quality, FLR GM Industrial Design
...2014 FLR Motorola Quality / SFs (with 341, 4930)
...2013 BAE Motorola Quality, WPI Regional #1 Seed / Delphi Excellence in Engineering / Finalists (with 20, 3182)
...2012 BAE Imagery / Finalists (with 1519, 885), CT Xerox Creativity / SFs (with 2168, 118)
Student: 1714 (2009) - 2009 Minnesota 10,000 Lakes Regional Winners (with 2826, 2470)
2791 Build Season Photo Gallery - Look here for mechanism photos My Robotics Blog (Updated April 11 2014)
Reply With Quote
  #7   Spotlight this post!  
Unread 10-10-2010, 22:10
Straberrie's Avatar
Straberrie Straberrie is offline
The Plague
AKA: Rebecca
FRC #0375 (Robotic Plague)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2007
Location: New York
Posts: 59
Straberrie will become famous soon enough
Re: Best way to start?

Oh woww you guys (davidthefat and Chris is me) XD I think they will soon come out with a book "Labviewers are from Mars, C++'ers are from Venus" based on the passionate programmers of FIRST
__________________
Team 375: The Robotic Plague
Current Robot: I-Chihuahua
Last Event: Big Apple Breakaway
Reply With Quote
  #8   Spotlight this post!  
Unread 10-10-2010, 22:25
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Best way to start?

Quote:
Originally Posted by Chris is me View Post
Sure you can argue with that. More people program things that aren't video games than things that are video games. Controls engineering and similar fields use Labview all the time.

(I do have to question how you fell you can speak with authority on the manner having never worked a job using CS, ever...)

I feel it's worth noting that my school issue laptop came with Labview pre-installed, but not a C++ IDE.
LOL True that, I have not worked a day as a CS. Yea I am aware that control engineering use it all the time, thats why I brought up gaming industry, so my argument is still valid
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
Reply With Quote
  #9   Spotlight this post!  
Unread 10-10-2010, 23:27
Andrew Schreiber Andrew Schreiber is offline
Joining the 900 Meme Team
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,068
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: Best way to start?

Quote:
Originally Posted by davidthefat View Post
LOL True that, I have not worked a day as a CS. Yea I am aware that control engineering use it all the time, thats why I brought up gaming industry, so my argument is still valid
So, by selecting some arbitrary subset of the real world based on your perceptions rather than facts you are making "valid arguments".

I also assume you neglected to remember that one of the largest growing sectors in gaming is the online market (Farmville...) as well as the rapidly growing mobile market (iPhone). Additionally, most of the Microsoft provided tools for creating games use C# and the Dot Net framework.

Additionally, the engines for most games might be written in C++ but they more then often involve at least a portion written in python or lua as a scripting language.

So, yes, I am going to argue.

As for learning C++. If you know LabView and have no compelling reason for switching I would suggest staying with LabView and slowly learn C++ by taking your old robot and reprogramming it in C++ in the offseason.
__________________




.
Reply With Quote
  #10   Spotlight this post!  
Unread 10-10-2010, 23:32
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Best way to start?

Quote:
Originally Posted by Andrew Schreiber View Post
So, by selecting some arbitrary subset of the real world based on your perceptions rather than facts you are making "valid arguments".

I also assume you neglected to remember that one of the largest growing sectors in gaming is the online market (Farmville...) as well as the rapidly growing mobile market (iPhone). Additionally, most of the Microsoft provided tools for creating games use C# and the Dot Net framework.

Additionally, the engines for most games might be written in C++ but they more then often involve at least a portion written in python or lua as a scripting language.

So, yes, I am going to argue.

As for learning C++. If you know LabView and have no compelling reason for switching I would suggest staying with LabView and slowly learn C++ by taking your old robot and reprogramming it in C++ in the offseason.


But seriously I won't argue. Arguing has not brought me much good. Lets leave it at that
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.

Last edited by dez250 : 11-10-2010 at 18:53. Reason: removed inappropriate link.
Reply With Quote
  #11   Spotlight this post!  
Unread 24-10-2010, 15:20
Ginto8's Avatar
Ginto8 Ginto8 is offline
Programming Lead
AKA: Joe Doyle
FRC #2729 (Storm)
Team Role: Programmer
 
Join Date: Oct 2010
Rookie Year: 2010
Location: Marlton, NJ
Posts: 174
Ginto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of light
Re: Best way to start?

Quote:
Originally Posted by davidthefat View Post
Cause C++ is used more often than LabView in the "real world". Do not argue, it is true, no one uses LabView to make video games, video games are a huge business, so I can infer that.
First, I agree with Andrew. Basing such a statistic off of simply the video game industry is simply foolish.
Second, you're actually fairly correct, though your justification is wrong. LabVIEW is more often used in specialized areas where you don't need as much power (ie. data structures and some other widely used programming features), whereas C++, or more correctly, C-based languages (including C# and Java), is used more often in the business world.
Though that's not to say that non-C-based languages aren't used. If you work mainly with AI, you're probably more likely to use a functional language; though once again, it is not the only choice.
And even then, if you work more with the web, you could be using PHP, ASP (possibly with .NET), or even Python.

I guess the point I'm trying to get across is that there is no specific "real world" programming language. It depends on what area of the software world that you work in. Each language has different strengths, as well as its own weaknesses; therefore, bickering about languages shouldn't even come into the equation.
However, I must applaud dotbran and his team for entering into the often more difficult world of C++, because it is definitely one of the more oft-used languages than LabVIEW.
Reply With Quote
  #12   Spotlight this post!  
Unread 24-10-2010, 16:14
synth3tk's Avatar
synth3tk synth3tk is offline
Volunteer / The Blue Alliance
AKA: David Thomas
no team
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Ohio
Posts: 2,005
synth3tk has a reputation beyond reputesynth3tk has a reputation beyond reputesynth3tk has a reputation beyond reputesynth3tk has a reputation beyond reputesynth3tk has a reputation beyond reputesynth3tk has a reputation beyond reputesynth3tk has a reputation beyond reputesynth3tk has a reputation beyond reputesynth3tk has a reputation beyond reputesynth3tk has a reputation beyond reputesynth3tk has a reputation beyond repute
Re: Best way to start?

While slightly unrelated since it was Java, I'd like to mention that I had to program our robot as a mentor due to lack of interest from students (which I'm hopefully fixing this season). I didn't find this out until Kick-Off. So I got started by reading Java By week 3, I believe, we had a robot that ran using the joysticks, and at shipping, we had a gamepad setup to run through a simple loop for our pneumatic kicker. Sure, we needed professional eyes to fix a small issue with the loop, but the majority of the code worked.

Did we have autonomous? Nope, not really, though I did try. Was the code efficient or purdy to look at? Definitely not, but it worked. Was it elaborate, try to cook you breakfast, could it run Crysis? Not really.


I forgot what my original point was when I started typing up this post. >_<
Reply With Quote
  #13   Spotlight this post!  
Unread 31-10-2010, 23:43
Bethie42's Avatar
Bethie42 Bethie42 is offline
Registered User
AKA: Bethany Carlson
FRC #0956 (Eagle Cybertechnology)
Team Role: Alumni
 
Join Date: Dec 2009
Rookie Year: 2008
Location: Oregon
Posts: 126
Bethie42 is a splendid one to beholdBethie42 is a splendid one to beholdBethie42 is a splendid one to beholdBethie42 is a splendid one to beholdBethie42 is a splendid one to beholdBethie42 is a splendid one to beholdBethie42 is a splendid one to beholdBethie42 is a splendid one to behold
C++ vs. LabVIEW for beginners?

Glad to find this thread. Our team has a little panic attack going on: our lead programmer graduated last year, and this year's programmer may or may not be on the team after all. There's really no-one else who knows how to program, with the exception of our mentor who says 'You really don't want me to program', and me, who loves to tool around with programming but really knows nothing...

We have a load of new [not all freshmen] students this year, and several of them have expressed interest in learning to program [C++ probably]. We're making plans for a winter-break intensive study-programming course, but need to find a teacher/really good tutorial...

And then, now that our lead programmer may not be on the team, we obviously need one person who really knows what they're doing. It's looking like I may be stepping up to the plate on that [our school is sadly lacking in programmers].

So! I've done a bit with C++, trying to teach myself on my own, but I haven't usually gotten very far due to lack of time. And I know almost nothing about programming for an FRC robot: just the sample programs in C++ books. Is it possible to learn C++ well enough over the few weeks of winter break [plus build season] to be able to do reasonably well?

I know all y'all lifelong programmers are going to say it takes years to get really good at a text-based language...


Another thing that came up was LabVIEW. Apparently it's a lot easier to learn that quickly, than C++ or Java. [I've worked with NXT programming for FLL, not that that is terribly similar.] I would personally rather learn C++ for several reasons, but I also really want to make sure we have people besides me [a senior] who know how to program for next year, and perhaps LabVIEW would be a better option for them?

On the other hand, there are a lot of other local FRC teams and they all program in C++ or Java, so finding help would be easier with either of those.

I'd love to hear your input on this! [I.e. I am begging for help! ]
__________________
Robot is now a verb.

We're back to square one...while we're at it, let's redesign square one!

Team 956: Celebrating ten years of FIRST!

Code:
Team record 2002-2011
2002: Highest Rookie Seed, AOR
2003, 2006, 2012: Xerox Creativity Award, AOR
2006: Semi-finalist, Sacramento Regional
2009: Quarter-finalist, AOR
2010: Quarter-finalist, AOR
2011: Semi-finalist, AOR, and Dean's List finalist, AOR 

Personal record: 
2008: Lead scout
2009: Lead scout, publicity
2010: Lead scout, publicity, fundraising, Chairman's, videography
2011: Team captain, lead programmer, fundraising, Chairman's, publicity, wrench-turning, Dean's List finalist at Autodesk Oregon Regional
Reply With Quote
  #14   Spotlight this post!  
Unread 01-11-2010, 04:01
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 671
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: Best way to start?

Just to add another data point to your consideration. If you ever want to use source control to manage your code, LabView, being a graphical programming language and saved as a binary file, is very difficult to work with using source control because you cannot do a "diff" between two versions of the code as easy as the text-based language. Although I heard somebody said there may be a graphical diff tool from NI, I did not find any hint of that anywhere. But of course, I didn't look very hard since we do not use LabView.
__________________
Reply With Quote
  #15   Spotlight this post!  
Unread 01-11-2010, 08:29
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Best way to start?

A couple things.

NXT G is a close variant of LabVIEW. The rbt file is a VI with a custom extension. If you know NXT G and want to try LV, there are lots of new editor elements, but the language is closely related, just skinned for a younger audience.

As for source code control. Professional shops use it with LV, and the tool to diff text will of course not work well on LV VIs or on Photoshop files, pngs, or any other binary files. For that, you need a diff utility with knowledge of the content storage. The tool is in the Source Code Control menu item along with configuration for when to invoke SCC actions.

My input for learning any language is to take a guess at what work a well for you, and get started. If you get stuck, switch to one of the other methods. The methods most often used are ...
1. Read a book on the topic.
2. Take a class on the topic.
3. Open sample programs, or examples that perform something you are familiar with, and read them looking for the things you understand and the things you do not. Ask or investigate the things you do not. Then move on to other samples.

At some point you need to start writing or modifying code to see what happens.

Greg McKaskle
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best Way Of Scoring? KingBK General Forum 18 05-01-2009 21:08
Best way to detect a bot dpeterson3 Electrical 24 04-01-2009 14:56
Best Way to Get Points SSMike Rules/Strategy 54 09-01-2008 16:46
Best way to start Torboticsmember Programming 4 06-02-2007 12:27
Best way to make money! SPDEXL Fundraising 17 21-07-2003 01:19


All times are GMT -5. The time now is 03:25.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi