Programming for Robotics
October 3, 2014 10:25 AM   Subscribe

I'm just started helping the local high school's robotics team as a programming mentor. They've worked in LabView before and are trying Robot C this year as well. Are there more "modern" languages that would be easier to work with? They compete in the FIRST Robotics Competition; I don't know if that restricts the options.

I've done a bit of research and I see a number of packages that will compile back to LabView if necessary and I know enough C to get by if that's the only option, but it feels like there must be newer, simpler ways of doing this, especially since most of the "JV team" have never programmed before. On the other hand, I don't want to go forcing them to work in Python or Ruby simply because I'm more comfortable in those languages.
posted by yerfatma to Technology (8 answers total) 6 users marked this as a favorite
 
The Botball tournament from the KISS Institute for Practical Robotics in Oklahoma (a) is totally something you should look into, and (b) provides a C variant, KISS C that middle- and high-school kids use to build their fully autonomous robots.

(KISS = keep it simple, students)
posted by colin_l at 11:10 AM on October 3, 2014 [1 favorite]


Also, the succinctly-titled Robot Programming is an excellent book.
posted by colin_l at 11:23 AM on October 3, 2014 [1 favorite]


National Instruments has LabWindows/CVI which has C like programming but allows access to the full set of commands that LabVIEW has.
posted by Confess, Fletch at 1:28 PM on October 3, 2014


Best answer: I'm afraid that if you're looking for an answer that involves Python or Ruby, you're going to be disappointed. While there are hobbyist ways of programming robots with Python, I work in the robotics industry and I've done a lot of work with FIRST and C and its variants are really the way to go for "real world" experience for the kids. (but yeah ignore Labview) Plus, most of the FIRST library will all be in the suggested language, so the students wouldn't be able to take advantage of other code libraries released for the competition, which is an important part of teaching them how to program.

As far as what options you do have, there should be a very lengthy manual available from FIRST that details what you can and can't do.

At this stage, depending on what level of the competition they're competing at, if you're just doing labs with them rather than working on the competition robot you can teach them programming logic in a language you're more comfortable with, then translate that all to C-specific stuff. It's a skill they'll have to learn anyway if they want to write code, right?

A good resource for you might be the Chief Delphi forums (too lazy to link on my phone but Google it). It's where all the teams talk shop about what they're doing, help others, and there are places for mentors to ask questions like this and find resources to help.
posted by olinerd at 2:32 PM on October 3, 2014


Obligatory FIRST judginess- I coached a VEX team awhile back.

In my experience, there are no real good alternatives. That being said if Robot C is anything like Easy C, it's super easy- I picked it up in a weekend
posted by KernalM at 3:38 PM on October 3, 2014


Response by poster: While there are hobbyist ways of programming robots with Python, I work in the robotics industry . . .

How strange, like a world frozen in 1999. I get the drawbacks of slower languages sitting on top of C for a bomb disposal robot, but for kids trying to build robots that throw balls around, it's weird to force C on them.
posted by yerfatma at 6:09 PM on October 3, 2014


Could be a lot worse. My rookie year on a team in 2001, we had to use PBASIC!

FIRST and similar programs are awesome for kids no matter what language they're using. Good on you for mentoring, and good luck!
posted by olinerd at 6:57 PM on October 3, 2014 [1 favorite]


Best answer: yerfatma: "How strange, like a world frozen in 1999. I get the drawbacks of slower languages sitting on top of C for a bomb disposal robot, but for kids trying to build robots that throw balls around, it's weird to force C on them."

Robotics, especially on a high school extraciriculuar event budget, is basically embedded software programming. And Embedded tends to run 10-15 years behind modern computing. And as far as I can tell, the robot controller environment they're using heavily leans embedded. When you realize FIRST is strongly sponsored by National Instruments, the embedded / LabView focus makes more sense.

And really, C isn't that bad for simple robotics. In the FIRST competition context, the deficiencies in Python are immediately apparent: Ruby and Python generally require a POSIX-like operating system to function. In contrast, LabView programs can be compiled to run on bare hardware (and is apparently capable of programming the onboard FPGA module). The algorithms required for FIRST competitions are not particularly complicated, and the deficiencies in C should not really be noticable; you won't be need to implement red-black trees or adjacency matrices, when 95 percent of the robot time is remote control. You just read the radio controls, and relay them to the servos and stepper motors. C is basically the fastest, most direct way to that goal.

Nor is C impossible for high school students. My high school taught a first semester of programming BASIC and a second in C in 1997; if anything it should be easier today, with C variants like Not Quite C and Robot C. Even Arduino, designed for art / design students, is just C with a library and the tiniest of bit of an application framework. You shouldn't need to deal too much with pointers, printf formatting rules, or even structs too much.
posted by pwnguin at 2:34 PM on October 4, 2014 [1 favorite]


« Older Damaged blender blade.. but not that damaged. Can...   |   Marriage hacks Newer »
This thread is closed to new comments.