Saturday, 29 January 2011

Mathematics in robotics

We had a film crew in our Cambridge lab on Wednesday from the Institute of Mathematics. They wanted to film how mathematics is used in programming the robots and applications. I had the dubious pleasure of explaining on camera how I used trigonometry to solve the reverse kinematics but first I had to understand how on Earth I did it in the first place. I had to 'reverse engineer' my own code that I first wrote 25 years ago into mathematical functions and I honestly could not understand my own code for a while. It's said that any code you haven't looked at for more than 6 months might as well have been written by someone else and this was 25 years.

Which brings me to documentation. I read a blog recently in which a programmer argued that documenting your code was less important than explaining the reasons for doing it. Forth and RoboForth are largely self documenting in any case so it's tempting not to add notes. What is more important than documenting what you did is documenting *why* you did it.

The team interviewed myself and Geena (application engineer) and we look forward to seeing the final cut.

Sunday, 2 January 2011

iPhone alarm didn't work

News is in that iPhone 4 alarm didn't work on 1st and 2nd Jan. Amazing!
And they already had a problem when the clocks went forward in November. All around the world iPhone 4 alarms did not go off.
Digital clock/calendar software is so so easy. I did it 30 years ago. Incredibly simple! How on Earth can Apple get it wrong?
Because the software in these things is so immense and so geared to looking good that simple things like it actually working can be neglected. Even my own phone sometimes needs reminding that it is first and foremost a phone and a gadget second.
Testing is obviously something that didn't happen. Engineers are supposed to test. I remember when I programmed digital clock/calendar I took the trouble to set up possible special cases like daylight saving, new years, leap years. Wait for it let's see if the iPhone alarms work properly on Feb 29th 2012.