Nasa is working on the ultimate in adaptable spacecraft - Ants, or autonomous nanotechnology swarms.

The first steps have just been taken at the Goddard space flight centre in Maryland by an awkward robot creature called the Tetwalker hobbling across the floor of the lab.

Tet stands for tetrahedral: the prototype is an empty pyramid with four electric motors at each node linked to each other by six struts.

Tet can telescope the length of each strut, thus altering the robot's centre of gravity so it topples - enabling it by successive topples to move flip-flop fashion in any direction.

Future models will have motors measured in thousandths of a millimetre, and eventually millionths. Struts will be replaced by carbon nanotubes invisible to the eye and completely retractable - enabling the pyramid to shrink until its motors touch.

In perhaps 30 years, millions of Tetwalkers will work in swarms, equipped with collective artificial intelligence, changing collective shape as needed, journeying to planets by forming solar sails riding on the pressure of sunbeams.

Entering an atmosphere, they could form an aerodynamic shield; on landing, they could morph into a snake and slither over broken ground. If they found something, they could grow into an antenna and radio Earth. And if they hit something, they simply flow back into the right shape.

"When we get hurt, new cells replace damaged ones. In a similar way, undamaged units in a swarm will join together, allowing it to tolerate extensive damage and still carry out its mission," said Steven Curtis, of Nasa. "If current robotic rovers topple over on a distant planet, they are doomed.

"Tetwalkers move by toppling over. It's a very reliable way to get around."