Monthly Archive for March, 2008

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.

The Naos are coming soon!

Last week we got word that the parts for the first batch of Nao had arrived in Paris, and that we would be getting our first two robots soon. Manuela Veloso from CMU went to visit the Aldebaran plant in Paris, and was apparently impressed with the Nao she saw. Check out the video here .

I was surprised that the robots are being assembled in France – I was expecting them to come ready-made from China or Taiwan like every other piece of electronics I know. Hopefully this means they will be higher quality, so long as no one forgets to plug in the cable to the camera or something! Also, the German Team has discovered from the video that the simulator prototype and the real robot have a different joint order in the legs relative to the Webots prototype, so probably there will be other discrepancies we’ll need to tackle once we get them.

On Friday we got the billing request, so hopefully that means once they get the money they’ll ship us ours! We could get them as soon as next week, which would give us 8 weeks of prep time for the demo at the US OPEN on the 24th of May. Eight weeks should be enough to tune our walk to work on the real robot, and to implement some simple soccer behaviors, so we could see some real soccer at the demonstration!

Edit: We have received word that the Nao are to ship on Monday, March 31.

Webots 5.8 released with new field, new goals and better performance

We installed Webots 5.8 today, which has included the changes from the new Nao rules. Beacons have been eliminated, the goals are much bigger, and the field size grew slightly. Why no one announced this release is puzzling, but it was only released about 10 days ago, so maybe they haven’t had the chance.

This version of Webots also has the Nao contest setup, which we hear rumors of starting any day now. Allegedly, the winner of the online contest will receive a Nao, and a PRO license of Webots. Though I can’t see any non-RoboCup team winning the competition, since it takes a lot of infrastructure development to make a successful team.

We’ve tested our vision algorithms on the new goal size, and they seem to be working great. Also, the new verison seems to be running faster than before on our Mac Pro, even though Webots refuses to take advantage of the multiple cores to do it’s physics processing.

Semi-Finals Victory Dinner



Semi-Finals Victory Dinner, originally uploaded by rachydachy.

Nao turn-in-place demo

After a breakthrough in robot motion technology, our nao’s can turn in place at an astounding rate of 16 degrees-per-second. The aibos probably turn at least 10 times that fast. Eventually we will run machine learning on the gait to get a faster one, but this one is pretty good.

The key to having a stable turn is to be able to widen the angle between the legs and take one step with wide legs, and then a step which restores them to normal. The only joint on the Nao which can widen this angle is the HipYawPitch, so you need to compensate for it’s use with the other Hip joints.

See the video here.

More Development Stats

Joho’s post from a little while ago about commits and code changes in SVN got me interested. So today when I came across a very cool and very extensive utility appropriately called StatSVN I immediately downloaded a copy of the code. Running it on the trunk took quite a bit of time and ultimately outputted over 480 html and png files, to make a nifty web page on my box. I’ve put some of the files up and I’ll be looking at maybe setting up some of the information for view here on the site.

Here was my favorite picture (with a close second going to the fact that our lowest amount of code change comes around lunch time).

LOC and Churn

LOC [Lines of Code] and Churn shows the usual LOC with the amount of code touched per day. Hopefully this should go decreasingly towards a release.