Author Archive for eeyore

Our Naos now walk!

We are proud to share with the world that we have achieved a new milestone in walking. Our very own motion engine was able to propel the robot forward for 20 or so centimeters without falling down. Joho and I are very excited about what lies ahead. We have all sorts of neat ideas about the future and where we would like to go.

Here’s a video of it on youtube: Our Nao walking

C++ programming woes

It took me hours and hours to find this bug today. The following code works (even though in my opinion it shouldn’t). The code is more pseudo- than real. The real thing wouldn’t be understandable anyway.


Matrix *m1 = (Matrix*)malloc(sizeof(Matrix));
free(m1);
useMatrix(m1);

The code did exactly what it was supposed to do even though I free up the memory in between the calls in a more complicated scenario. However, when I modified the code to this


Matrix *m1 = (Matrix*)malloc(sizeof(Matrix));
free(m1);
Matrix *m2 = (Matrix*)malloc(sizeof(Matrix));
useMatrix(m1);

I got a segfault and couldn’t figure out why creating a new object would cause my program to crash. In my opinion a more sensible scenario would be that the first code snippet would cause the program to segfault, so I knew that there was something wrong already.

Bizzare… The platform is OS X Leopard with gcc 4.0.1. The current theory is that even though I free the memory, the contents are still intact and the OS is able to use them, but once I malloc again, the same region of memory got overwritten and the old pointer was marked invalid. I don’t know…

Anyone who comes across this and has a good way of explaining this awful behavior to me, I would be happy to hear it.

Role switching on its way

I’ve set up the foundations. It is working whimsically as of now, but it has great promise. It is certainly necessary to perfect this since the full game test we made today caused all 3 dogs to get stuck into each other and couldn’t continue playing unless taken away from each other. In a real game they would have all gotten penalized for 30 seconds…Not a good thing!

Before the dog goes into approach state, it considers whether there is another dog that is closer to the ball. If there is, stay put. This is all based on communicated localization from other dogs on the field. Eventually, we could give idle standers-by some other work while a single robot approaches the ball.

Setting up Cygwin under Windows

For any of you that have a windows machine and want to use it – here’s what you do.

First of all you download cygwin from here. This is a setup file, it will ‘guide’ you through the setup process, but not too much since it is a linux application and they believe in the intelligence of their users. Basically, if you go clicking next until the thing goes away, you won’t get what you need. You need to check that you have a few programs which don’t come back with the official bundle. I suppose you can download the whole thing, but it’s something in the order of 800 MB, so I don’t know how useful that will be.

Anyways, what you need to get on there:

  • make, gcc-g++, subversion from the “Devel” section
  • rsync from the “Net” section
  • more from the “Text” section
  • These might also be useful.

  • cvs, gdb, libxml2-devel from “Devel”
  • openssh from “Net”
  • libjpeg62, libpng12-devel, zlib from “Libs”
  • You can always rerun the setup and choose additional packages that you need.

    Now we need the OPEN-R libraries from their official website.
    I can’t give a direct link because there is a login part, and you’ll need to register (if you haven’t already). So, get these from in there somewhere:

  • OPEN_R_SDK-XXX-rX.tar.gz
  • mipsel-devtools-XXX-bin-rX.tar.gz
  • Extract them in /cygwin/usr/local. Now you should have everything you need to compile open-r related c files. I hope I’m not just clogging up the place and annoying people with this.

    Note: semi-copied from here. I just took out the essential, but you can check out the original. I take no credit for it. It’s how I set up my own cygwin.