Posts Tagged ‘ programming ’

Progress on programming on the NXT

I have built the “Quick Start” model yesterday and played with it a little bit (video), at least we know that the motors are working, Bluetooth connection is working and the communication between NXT and the motors is working. To my surprise the mobile application software from LEGO includes a java application for my old Sony Ericsson W800, which can act like a remote control for the NXT, yay!

Then I googled three topics on the NXT:

  1. Camera for the NXT
  2. Focus puller using LEGO
  3. Programming C/C++ on the NXT

There is some wireless camera that costs about $40 and is of reasonable size, but the particular model is sold out. Nevertheless, I realized that any wireless camera should do in this case since most of the computation has to be done on the terminal (some computer) and the NXT robot only needs to “hold” the camera and receive instructions from the terminal, so there is really no need for a camera designed specifically for direct communication with the NXT (although there is some).

I have a Canon 5D Mark II so I am really interested in the idea of auto-focus puller. A couple of months back our studio was shooting a short video and in one of the scenarios I had to manually rotate the focusing ring to follow the actress that is walking towards the camera. It was difficult. Hence if I could build a focus-pulling rig with programmable motor, I could tell it to focus from a distance to another in a given speed. That would be very cool! Some work has been done towards this end (Solutions 1, 2 and 3). For me ideally I would like to have some standard follow focus gear that could interface with some of the LEGO gears, but this solution might be expensive and the teeth might not engage well. I am no mechanical engineer so I would like to use components that are readily available (can be purchased), as you can tell from the fact that I bought a LEGO-based robot. The first and the third solutions, although don’t seem quite polished, should work just fine. But we will see.

For the third topic, I came across this comparison chart which I find very useful (here’s another one). From the look of it, I would probably try RobotC first and then LEJOS OSEK. The problem with RobotC is that it is not free (sorry I am cheap), but I will try it out and drop the $30 if I like it. What’s good about RobotC is that it uses the standard firmware and its execution speed is much faster than its peers. As for LEJOS OSEK, it is more C-like but it does require custom firmware and it runs much slower (comparing to RobotC).

Besides the solutions for writing programs that execute directly on the NXT, I also found some interfacing libraries in C++ that can communicate with the NXT via Bluetooth: NXT++ and Anders’ C++ communication library. Both look very easy to use and worth trying. I am also assuming that these libraries require an active Bluetooth connection with the NXT, instead of initialize the connection themselves. A question remains: how do they know which COM port is being used for the connection though? I will find out tonight if the ease of use comes with a catch.