I have recently voluteered to be a mentor for a local inexperienced FIRST robotics team. The main area I will be mentoring is the programming aspect of the competition. The controllers for last years robot was programmed using LabView but they also can be programmed in C++. The better teams in the league with the more capable bots program their's in C++. What would be the best ways to teach High School kids how to program in C++? I was think of starting out with flow charts and robot relate problems to example conditionals i.e. move robot forward till its a foot from the wall. Once they have an understanding of how to structure pseudo code algortihms then I would start getting into how to transfer the pseudo code to actual C++ code. Does this seem like a good method to start with.

Recommended Answers

All 2 Replies

As with many such questions the answer is "it depends". You have to start with the group you are dealing with. I've had disappointing results in robotics projects, mainly due to a lack of common agreement as to what the commitment level was. Some people thought it was a cool club and they'd spend an hour here and there, some really dedicated themselves to it and were disappointed when other members of the team didn't. But ther was no firm agreement on the commitment level.

So figure that out first. Maybe your students have no interest in learning C++, in which case it doesn't matter how you teach it. In which case, stick with Lab View. Maybe others are gung ho and really want to learn and are truly willing to put in the effort. I which case, teach the C++, but tie it in really quick with robots. In my experience, fairly or not, flow charts, unless done very well, quickly glaze peoples' eyes over, particularly high schoolers.

I strongly believe the best way to learn to program in the field of robotics is from the ground up. In other words, learn how the hardware ties in to the high level software engineering and only then get into the subject of how to control the mechanics with high level software design. I believe it's counter productive to teach an aspiring robotics software engineer C++ if he does not know how to first read a data sheet or a schematic. It could be argued that these hardware details are concealed by the kits used to drive the I/O of the robot, but a robotics engineer probably will not be very effective if they have no idea how the hardware ties into the software.

In other words, C++ alone in the robotics world is decorating a big black box.

When I was in 9th grade I was programming in assembly language and controlling a 68000 processor. I soon afterwards taught a class on robotics (in the 9th grade) in an after school program. I admit not many people could follow my rants on flip flops and MOSFETs, but those with a genuine interest in the subject became quite good at controlling electronics with software. As I learned first hand, building a solid understanding of the physics behind the code is an ultimate approach to facilitate the design of high level control programs and provide important insight into artificial intelligence coding.

Now this is just my own opinion. You can take it however you'd like. It may not be compatible with your students, and frankly in the age of the iPOD and mobile internet, may not even be compatible with the times. Robotics is the future to be sure, but I don't think there should be any black boxes in a subject like this, where control is more important than well written object oriented code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.