Archive of May 2009


Fri 29 May

Why I Don't Like RobotC

Next semester I'm going to be the TA for COMP 060: Robotics with Lego, a first year seminar at UNC Chapel Hill to introduce first year students to programming and computer science by means of the Lego Mindstorms robotics kit. Last fall, I took an "advanced" version of the class in which we used the RobotC development platform for our projects. Or at least, I did for most of the class until I got so fed up with it I switched to Lejos. Here are a few of the reasons why I wound up stopping using RobotC, and why we won't be using it for our first year seminar in the fall.

  • Windows only, proprietary. More and more students are using non-Windows systems as their primary machines, particularly those interested in computer science. Requiring those students to use a seperate platform is unfair for them and a pain for instructors. Moreover, RobotC costs $30. Now, I have nothing against paying for software, but when there are free alternatives that don't have half the problems RobotC does, I can't justify spending my money or asking students to spend theirs.
  • Poor documentation. RobotC is repeatedly described as "C-like". While this is generally true, my classmates and I were continually faced with bizarre limitations of the language that prevented us from writing our programs as we would have done in real C. For one, there are no pointers! Moreover, technical documentation was sparse to non-existent, and that which did exist was presented at too high a level to be useful to us. I could see how this makes sense for the middle and high school level competitions RobotC is often used for, but it was exceedingly frustrating for those of us who had even the most basic programming experience or were working on moderately complex problems.
  • Bizzarre bugs. This is what killed me the most. Sometimes I swore RobotC's error states were nondeterministic. There were times when the exact same piece of code would run fine five, ten times, and then suddenly cause erratic behavior in the robot (i.e., driving wildly around, seemingly ignoring sensor inputs, etc). On the next ten runs, no problems. Somtimes the robot would get stuck in an error state and could only be recovered by reflashing the control brick with the RobotC firmware. One of my classmates even had to do this every time he loaded a new program onto the robot! Further, the IDE used with RobotC would sometimes refuse to connect to the robot, a situation that could only be solved by deleting all RobotC's registry keys--bye bye any preferences you had set.
  • RobotC and that is all. It's not easy to integrate other software packages with your RobotC programs. For my final project in Lejos, I was able to use the standard libraries to create a GUI for my application that ran on my laptop, and I was able to communicate with the robot via Bluetooth using standard sockets. Try doing that with RobotC!

I don't want to spend the whole time dwelling on RobotC's shortcomings though. For all the grief RobotC brought me, it did have some strong points that I missed when I switched to Lejos.

  • Integrated IDE. I'll be honest: I'm a big fan of Eclipse and the ability to use that when I switched to Lejos was a plus for me. But for those who have not developed my affinity for Eclipse, having everything you need to write, debug, and load your programs onto the robot in one place was very helpful.
  • Good debug tools. I really valued being able to quickly view raw information coming back from my sensors; not only did the debug window provide all the information I needed, it did so in a very clear format that I imagine would be very useful for beginning programming students. In fact, one of the first things I did when I switched to Lejos was to develop a simple replacement for the sensor debug tool included with RobotC.

I've mentioned Lejos a lot in this post. As you may have guessed, I really like it. I'll be sure to post a follow up to this article about why I think Lejos is the best platform for Lego robotics programming and why we're going to be teaching it in the fall.

· Tags: , , ,