Hexpod Beginnings

I’ve been fascinated by robotics for a long while but have not done very much - mostly because I like programming a lot more than I like hacking hardware. However, in 2006 I decided to have a go at building a hexapod (6-legged robot) using parts from lynxmotion.com. I got all enthusiastic for a while and then moving from Antibes to London and staring a new job led to me putting the project to one side for over 18 months. I’ve started working on it again so this first article just summaries progress up to now.

I decided at the beginning that a microcontroller wasn’t going to provided enough compute power for some of the thins I wanted to try so I thought I’d use a micro ITX board for the controller as I’d be able to run a modest Linux install.

Tranquil T3 PC

I had to take a hacksaw to the case of the Tranquil T3 and the WG311 mounting plate had to come off but the Netgear wireless LAN card is now installed. I need to convince Linux to talk to it now…

Tranquil T3 with Netgear

Robot bits
The bits arrived, Now all I need to do is construct a 6-legged robot out of all this

Complete leg
One of 6 legs for a 6-legged (hexapod) robot. Each leg has 3 servos.

Skeleton
Complete hexapod skeleton

Complete mechanics
Complete mechanics

Me holding the complete hexapod mechanics to show the scale. Now the mechanics are complete the fun stuff (programming) begins.

Dr Frankenstein

I discovered the GP2X and decided that would make a cool controller since it already runs Linux and is designed to be battery power. Even the breakout board and GP2X together are quite small and light and run off a 3v power source and so perfect for battery operation.

The GP2X therefore displaces my micro ATX board as the main contender for the robot controller. Unfortunately, I found I like it too much for game playing so had to visit ebay to get a second one for the robot.

GP2X and breakout board

The GP2X is plugged into the breakout board using its EXT port and the
breakout board board’s serial port is plugged into the laptop allowing me to
get debugging info out of the GP2X

Gp2X test setup

James Ward: Sexier Software with Java and Flex

On Friday 11th July, I attended a talk by James Ward at Adobe’s Regents Park
offices in London. Free beer, soft drinks and pizza were provided and this
ensured that there was a fairly healthy turnout.

James started by showing two example Flex applications. The first was a demo
to an insurance company to show how Flex could allow claim information to be
entered more easily with the need for long textual descriptions replaced by
annotated diagrams - for example detailing how the accident occurred involved
dragging cars into position on an outline of the road, adjusting lines showing
their trajectories and indicating where the collision occurred.

The second example application ran using AIR and appeared to the user like an
ordinary desktop application. James showed how an interface chart in the
application could be dragged into MS Word (where it became a static image) and
similarly how tables could be dragged from the application and dropped into
excel. Both applications looked very slick - I asked James later how long they
had taken to build and he said about a couple of weeks.

James then moved to showing us how to build Flex applications. The Flex SDK is
free to download and Flex applications can be build using only this and a text
editor; however during the talk James used Adobe’s commercial FlexBuilder
eclipse plugin.

A document written in MXML describes the
application - James showed us variations on an application that would download
photos from flickr tagged with “orange” and display them first using a widget
like Apple’s “cover flow” and then as a simple list. The MXML code consisted
of about 5 lines of which 2 were boilerplate and the rest served to define the
data source, define the display widget, instruct the display to watch the data
source for updates and start the search when the application was complely
loaded.

The MXML for the examples were very similar for both the web and desktop
versions but unfortunately not identical since different elements are used for
the application top level tag. James did mention though that “library
projects” could be created to contain code common to both the web and desktop
versions of a Flex application and then separate web and desktop projects
could reference the common code and contain only the code specific to their
environment.

Individual components are written in Actionscript - this is very close to
Javascript except that there seemed to be some proprietary extensions to, for
example, indicate that variables can be used as data sources or sinks. James
stated that statically defining types for variables was options but that
adding types would tend to give better performance. Using static types also
apparently allows FlexBuilder to provide code-completion and other useful
features.

The combination of MXML and Actionscript components are compiled to a SWF file
for web deployment meaning that Flex applications can run on a normal Flash
runtime.

Web targetted Flex applications run in the browser and can make use of normal
browser facilities (such as support for HTTPS connections). AIR applications
run on the desktop - the AIR runtime includes Webkit to handle HTML rendering
and also includes additional APIs to provide additional services such as
access to the local filesystem.

James then moved on to some examples showing how a Flex user interface could
be integrated with a Java backend. James stressed that Flex is a UI technology
and so is not in competition with Java technologies used on the server side
(Spring, EJB, hibernate etc). For this part of the talk James used an
application that queried a Java servlet and displayed the results in a table
using Flex. Flex supports a number of data transfer formats including JSON,
XML and the binary AMF
format. James showed how using AMF increased performance relative to using
XML. If I understand it correctly AMF is a binary format close to the
Flex/Flash in-memory representation of objects - this means that very little
processing is required to handle a AMF data stream on the client side. James
said that AMF performs better than XML since there is no need for
serialisation and deserialisation - I felt this was somewhat misleading since
obviously the Java backend will need to serialise the objects to AMF format
even if deserialisation is not required on the client (since the objects can
be presumably directly loaded into memory).

AMF is a proprietary Adobe protocol and was originally part of the commercial
Lifecycle Data Services product. Adobe have now open sourced the code for AMF
as the Blaze DS
project.

Lifecycle Data Services remains a commercial product though and includes
additional features such as the ability to keep multiple clients synchronised
as a data source changes whether the data is changed by the server or by a
client. James demonstrated three Flex applications running at once - one in a
web browser, one embedded into a PDF document and the other running as a
desktop application - each client displayed an editable table and updates to
each table were propagated to the server and other clients without the
application developer having to write code to handle this.

Although he did not describe it, James mentioned that there is an API for
handling conflicts caused by multiple clients modifying the same data.

I felt James’s talk was an excellent introduction to Flex and some of the
possibilities it provides. I hadn’t really considered using Flex before but
now I definitely intend to give it try.

Some photos from the meetup can be found
here.

Review: The Lucifer Effect-- How Good People Turn Evil by Philip Zimbardo

The premise of this book is that otherwise good (or at least not actively bad)
people can do bad, indeed evil things and that this can be explained by the
situation in which the acts took place. In 1971 Zimbardo conducted the
“Stanford prison experiment” in which students enacted the roles of prison
guards and prisoners - the results so traumatised Zimbardo that supposedly he
never gave the experiment the complete write-up he intended to. Many years
later he acted as an expert witness for the defense of one of the soldiers in
the Abu Ghraib prisoner abuse scandal. It was this experience and his
frustration with organisations who still explain wrongdoing as being the work
of a “few bad apples” rather than a “bad system” that caused him to write this
book.

Just under half the book (chapters 2-9, 192 pages) is a description of the
Stanford Prison Experiment, followed by another two chapters of reflection on
the events during the experiment. There is now a website dedicated to the
Stanford Prison Experiment at prisonexp.org so I won’t
give a detailed summary of the experiment here. Suffice it to say that from a
group of young male volunteers some were chosen at random to act as prison
guards and the rest to act as prisoners in a pretend prison in the psychology
department basement. The experiment had been due to last two weeks but
Zimbardo abandoned it on the tenth day because of the worsening treatment of
the “prisoners” by the “guards.”

Chapters 12 (Investigating Social Dynamics: Power, Conformity and Obedience)
and 13 (Investigating Social Dynamics: Deindividuation, Dehumanisation and the
Evil of Inaction) are the most interesting chapters as they give several short
summaries of various experiments and events that show how people can be
persuaded to do things that they would normally insist that they would never
do.

Chapter 14 describes Zimbardo’s experience as an expert witness at the court
martial of one of the soldiers involved in the Abu Ghraib prisoner abuse
scandal.

Chapter 15 describes the systemic elements that Zimbardo feels are the root
causes of Abu Ghraib prisoner abuse.

Finally chapter 16 gives some case studies of heroes who have resisted
systemic forces such as Hugh Thompson who confronted superior officers and
forced (using the guns on his helicopter) them to halt the My Lai massacre in
Vietnam and Joe Darby who blew the whistle on the prisoner abuse at Abu
Ghraib. Chapter 16 also gives some pointers on how people can resists
situational forces and avoid drifting into committing evil acts.

I think one problem with this book is that the Stanford Prison Experiment is
presented in such detail - half the book (if the two post-mortem chapters are
included) is devoted to the experiment and yet of all the cases mentioned in
the book it is perhaps the least interesting - the shorter case studies get to
the point quicker, Abu Ghraib is more notorious and others such as the Rwandan
genocide are more horrifying. I feel that Zimbardo felt that he had to give
detail on the Stanford Prison Experiment to back up some of his claims and yet
by including all that detail he makes the book less interesting overall. The
Stanford experiment is also the one that Zimbardo has the most personal
experience with.

However, despite find the overlong description of the Stanford experiment
somewhat sleep inducing in places the book is genuinely interesting and
chapters 12, 13 and 16 do go a long way to explaining why people do evil
things and how people could better resist being caught up in a situation and
led to do evil.

In chapter 12, Zimbardo quotes from C.S. Lewis and I’m going to reproduce the
quote below since I agree with Zimbardo that it perfectly summarises how
social presures can cause people to do things that are not in accordance with
their own ethical beliefs.

To nine of ten of you the choice which could lead to scoundrelism will come,
when it does come, in no very dramatic colours. Obviously bad men, obviously
threatening or bribing, will almost certainly not appear. Over a drink or cup
of coffee, disguised as a triviality and sandwiched between two jokes, from
the lips of a man, or woman, whom you have recently been getting to know
rather better and whom you hope to know better still - just at the moment when
you are most anxious not to appear crude, naive or a prig - the hint will
come. It will be the hint of something, something that the public, the
ignorant, romantic public, would never understand. Something which even the
outsiders in your own profession are apt to make a fuss about, but something,
says your new friend, which “we” - and at the word “we” you try not to blush
for mere pleasure - something “we always do.” And you will be drawn in, if you
are drawn in, not by desire for gain or ease, but simply because at that
moment when the cup was so near to your lips, you cannot bear to be thrust
back again into the cold outer world. It would be so terrible to see the other
man’s face - that genial, confidential, delightfully sophisticated face - turn
suddently cold and contemptuous, to know that you had been tried for the Inner
Ring and rejected. And then, if you are drawn in, next week it will be
something a little further from the rules, and next year something further
still, but all in the jolliest, friendliest spirit. It may end in a crash, a
scandal, and penal servitude; it may end in millions, a peerage and giving the
prizes at your old school. But you will be a scoundrel.

Case studies in chapter 12 include well know classics such as the Milgram
experiments in which subjects believed that they were giving lethal electric
shocks and yet still went ahead and pressed the button. Other examples include
the “strip search scam” in which someone impersonating a police officer phones
the assistant manager of a fast food restaurant with the news that one of his
young female employees has been involved in some criminal activity such as
shoplifting or selling drugs. The imposter says that he, and other police
officers, are on the way and suceeds in persuading the manager to isolate the
employee in a room and then, over the phone, persuades the employee to submit
to a strip search conducted by the manager. This escalates from a simple
search to performing various degrading acts such as perforning oral sex with
another older male employee. This might sound like a one-off incident but
Zimbardo reveals that this scam was perpetrated 68 times, in 32 different
states, half a dozen different fast-food chains and with both male and female
assistant managers. Zimbardo quotes socialogist EsterReiter who states that
the most valued trait in fast-food workers is obedience to authority and a
retired FBI agent who says the following:

You and I can sit here and judge these people and say they were blooming
idiots. But they aren’t trained to use common sense. They are trained to say
and think, “Can I help you?”

Another example was of a woman being attacked who manages to temporarily
escape and rush naked into the street where she is seen by a crowd of people
and yet her attacker is able to recapture and drag her back inside where he
rapes and murders her without anyone intervening. Situations like this seem
completely insane - given the large number of witnesses one would think that
at least someone would be driven to act and save the poor woman from her fate.
However, it seems that the larger the number of onlookers the less likely help
is to arrive because people are more likely to act like the majority (ie do
nothing).

Chapter 13 discusses the roles of deindividuation and dehumanisation - in
other words the less known about an individual or group and the more they are
made to seem less than human the easier it will be to persuade someone to
commit an evil act upon that individual or group.

In summary, I did learn something from this book about powerful and insidious
situational forces could be in persuading people to act against their better
natures. I do feel though that too much time was given to the Stanford Prison
Experiment and that the book would have benefited if the text on the Stanford
experment had been cut by half and the space gained used to expand on the
material in chapters 12, 13 and 16.

Links

Review: PRIMER by Shane Carruth

I stumbled on the DVD of this film while aimlessly browsing the racks of DVDs
in a local DVD store and was intrigued by the blurb on the back of the box -
perhaps because of what it does not say as much as what it does.

PRIMER is set in the industrial park/suburban tract-home fringes of an
unamed contemporary city where two young engineers, Abe and Aaron, are members
of a small group of men who work by day for a large corporation while
conducting extracurricular experiments on their own time in a garage. While
tweaking their current project, a device that reduces the apparant mass of an
object placed within it by blocking gravitational pull, they accidentally
discover that it has some highly unexpected capabilties - ones that could
enable them to do and have seemingly anything they want. Taking advantage of
this unique opportunity is the first challenge they face. Dealing with the
consequences is the next.

So firstly this is movie about two geeks, secondly my curiosity cannot resist
knowing what the unique device is and thirdly the price (only about 6) was
right so the DVD ends up coming home with me.

Now, this is the first film that has inspired me to watch the director’s
commentary in it’s entirety after watching the film itself so that’s some
indication of how intriguing I found it and also that the plot was hard to
follow in places and I was curious enough to want to investigate further.

I think this is the first time travel film I’ve seen where the scriptwriter
has actually thought really hard about how it would work and how ordinary
people might react given that capability. Thankfully the main characters do
not suddenly transform into stereotypical Hollywood action heroes. Rather than
committing the normal Hollywood error of explaining so much that a drugged 5
year-old [1] would find it too simple the story perhaps leaves out a little
too much (or maybe I just drunk too much beer while watching). That’s not
necessarily too bad - I got a lot of extra enjoyment trying to figure it out
and searching the web for more information.

With a film like this there is a temptation to over-analyse as can be a seen a
little in the film’s forum but
looking at some of the fan produced
timelines shows how much
there is to the actual story of which only a fraction is actually present in
the film.

While watching the film it’s obvious that it’s low budget but that does not
detract too much from the experience. I certainly wouldn’t have thought that
the budget was as low as $7000. It also happens to be Shane Carruth’s first
film. While I think he got carried away with some of the camera work and it’s
obvious he was learning as he went I’d love to see what he could do with a
“real” budget.

- Film website
- Timeline
- Wikipedia
-
Amazon.com

View the discussion
thread.

Review: The Last Stand Of The 300 - The Real Story

I ordered this documentary after watching the film
300 and wondering how much of the film
was based on fact.

Note to self: Next time you want to know the facts behind an event, buy a book
by a reputable expert in the field.

Note to David Padrusch & Matt Koed: Can I have the last 120 minutes of my life
back please?

The thinking behind this film seems to have been “If you can say something
once then why not say it five times.” Perhaps this was orginally made for TV
and the endless repetitions were designed to be recaps after a long advert
break. In any case the repetions quickly became annoying.

The product description at Amazon says visually stunning with breathtaking
dramatisations and graphics. The dramatisations and animations weren’t bad,
but I think most of them were repeated at least twice and the documentary
makers obviously decided that they couldn’t show simple pictures of swords,
shields, helmets etc unless they had animated lines whizzing around them.

For all the content in this documentary it could have been easily compressed
into 30-45 minutes simply by removing the repetition and the result would have
been much better for it.

Find this DVD at
Amazon.co.uk

View the discussion
thread.

Review: Mothership by John Brosnan

We’ve heard this before right? A civilisation happily doing it’s thing unaware
that is in fact doing it’s thing not on a planet but on a generation ship on
its way to the stars. My personal favourite example of this theme is Gene
Wolfe’s Book of the Long
Sun
series.

That said, this is a compentently written book and I enjoyed the ironic tone of the
narrative of the principal character. It’s no masterwork, and doesn’t have the
depth of the “Book of the long sun,” but it’s worth a read.

The ending leaves some loose ends which made me wonder if a sequel was planned
and indeed amazon.co.uk lists Mothership Awakening
which appears to have been published in 2005 but which seems to be
unavailable.

View the discussion
thread.

Review: White Mars by Brian Aldiss and Roger Penrose

Oh dear, oh dear! It’s quite hard to make me stop reading a novel once I’ve
started - I’m too curious to know how it finishes. This book made me bail out
at page 71 (out of 323) and it was only an act of will that kept me going that
far.

It’s my own fault really, the blurb does give fair warning:

How can we achieve a better world? A happier future? A new understanding of
human life? This startling and authoritative book shows how such a society
could be built. In so doing it produces a beautiful and grim new myth.

but wait, there’s more!

And while the utopian debate is in progress, the question of alien life
enters in a dramatic way. Oh yes, size matters!

The novel throngs with characters. People are important. They must co-
operate or perish. The mover and shaker is Tom Jefferies; on the austere world
on which he and his company are exiled, he slowly creates his goal, the
humanising of science, the improvement of human existance, the freeing of the
mind from its dangerous past.

This is the first time I’ve seen a novel described as “authoratitive” and I
don’t believe it merits that classification either. It does manage to be dry,
slow moving and lacking in characters that have any real depth. Now, if this
was a relic from the so-called “golden age” of science fiction we could
perhaps forgive the book some of these flaws but it was published in 1999 and
so the authors have no excuse whatsoever.

Instead of a compelling narrative we are treated to pages of description (of
dubious merit) of the problems with previous human societies which makes even
Vogon poetry seem appealing.

Definitely do not buy this book. I borrowed it free from my local library and
I still feel cheated.

View the discussion
thread.

Review: Echoes of the Great Song by David Gemmel

I’m a great fan of David
Gemmell
‘s work and was saddened
to hear of his death in 2006. I’ve got at least 17 of his novels at home and
thought I’d read everything except the Troy series (which doesn’t really
appeal to me) when I stumbled accross “Echoes of the Great Song” at my local
library.

This book doesn’t fit into any of Gemmell’s other series and I don’t think
it’s one of his best but it’s worth a read all the same.

The basic premise is that the world and even time itself is all part of a
“great song” and if you can play the right music and have the right power
source you can manipulate matter (build great cities), heal, have eternal
youth and change the rate at which you experience time. The avatars had
discovered these principles and a way of using crystals to store energy
gathered from the sun. They then proceeded to dominate their world living like
gods and treating all other races as inferior.

After two thousand years of civilisation all is not going well for the avatars
however. A great cataclism has resulted in a new ice age; their capital city
and main source of energy is buried under ice and only a few hundred living in
remote cities remain. Knowing that the avatars power is dwindling the formerly
sub-subservient civilisations are plotting rebellion.

Things get worse however when another civilisation very similar to the avatars
in a parallel universe escapes from its own cataclism by invading the avatar’s
world. The invaders seek only blood to power their crystals and so pose a
threat great enough to force ther natives into an uneasy alliance.

As other
reviews
have pointed out, we soon arrive at the standard bunch of ill-matched
characters on a quest to defeat the invadors but this is being slightly unfair
since this happens against of a backdrop of politics and betrayal played out
elsewhere in the world and we do see a lot of character development as avatars
and ordinary humans learn to trust each other.

Gemmell has never been one to go for the “happily ever after” style of ending
and his books tend to end with heroes that are victorious but dead or a
victory that is real but temporary. Some of his endings, particularly of the
Rigante series are almost heartbreaking. I sense that Gemmell has always been
interested in having a degree of realism regarding how characters interact and
evelop and in some cases uses his books to explore issues from our history -
for example the Rigante series deals with the collision of a Roman-like
civilisation with a celtic-style tribal civilisation founded on personal
honour.

This book won’t leave you with a warm glow of happiness either but it’s the
journey that’s important not the destination and this is a book worth reading.
If you find some of the other fantasy writing out there a bit too sugary for
your taste you should definitely give Gemmell a try.

Links

Review: Never Let Me Go by Kazuo Ishiguro

I’m not sure what prompted me to take a break from my normal diet of science
fiction and computer science books but something prompted me to pick Never Let
Me Go off the shelf while browsing an airport book store and I’m so glad I did
since it’s a superb work of fiction.

This is a story on many levels - there is love and friendship but I think
there is also a level in which the story can be seen as warning on what
happens once a society since starts assigning different rights to people
because of an accident of birth.

The story is narrated in the first person by kathy who, at the age of thirty-
one and near to the end of her life is looking back over her life, loves and
friendships. At first it seems Kathy is at a slightly eccentric boarding
school but although everything seems normal to Kathy it’s possible to sense
very early on that something is not quite right. It’s a creepy feeling like
watching the beginning of a horror film where you know there’s a monster but
you haven’t yet seen it and you don’t know the form it will take.

We soon learn that Kathy and almost everyone she knows is doomed but that the
doom is many years off. Kathy and her friends have time grow up, form
friendships, fall in love while knowing all the time that everything is going
to be ripped away from them and there is little they can do about it.

The characters are superbly observed and believable; the writing is subtle and
never heavy handed. There is no blatant sentimentality or hand-wringing - the
quality of the writing made me feel for the characters and I felt a real sense
of loss at the end of the story.

This is not a happy book - it is bittersweet at best - and yet it demonstrates
the old axiom that it’s better to have loved and lost than to have never loved
at all in spite of the pain when one’s love is lost.

You might not think this sounds like your kind of book, but give it a try
anyway. It’s not fast paced but if you let yourself be drawn in you won’t want
to stop reading.

Links

View the discussion
thread.