Scientists at Cornell University and University of Pennsylvania have created mobile robots that can autonomously change their shape in order to complete various tasks. The robots are made of 3-inch cubes that can configure themselves into different shapes by connecting with magnets.

The "brain" of the transforming robot is a central sensor module that uses a 3-D camera to perceive and create a 3-D map of the environment in real time, the researchers explain in a paper in the newest issue of Science Robotics. The central module uses a set of algorithms to decide what shape the whole cluster of cubes should take, depending on environmental factors and the task at hand.

Also: Watch a massive homemade 'Transformer' cruise the roads of Beijing CNET

The algorithm is based on a library of robot behaviors and possible shapes and different scenarios in which it should take those shapes. If the robot encounters an obstacle in the environment that it can't get around in its existing form, the central module (the planner) will direct the other cubes to reconfigure themselves.

Researcher Jonathan Daudelin explains in a news teleconference, "The high-level planner takes the information from the perception algorithms of what the current environmental conditions are, it matches that with the required high level task and then searches the library to find robot behaviors and robot shapes that will allow it to carry out the task."

How robots are beginning to stray from the single-grip design Watch Now

Most of the time, the robots are shaped like a car so they can easily move around. However, if the robot is faced with a narrow passageway, it will automatically transform into a long snake-like shape so that it can slither to its destination. It can also turn into an arm to lift and move objects. These robots are autonomous in unknown environments, which is a huge engineering challenge.

"They need to be able to go into a place they've never seen before, gather information and take actions to achieve a task objective all by themselves without any help," says researcher Tarik Tosun.

Also: Flying "tug" drones anchor to objects to pull 40 times their weight

The biggest benefit of this robot compared to others is its flexibility. Instead of needing a bunch of different robots or one gigantic robot, this design is more versatile because it uses a bunch of cubes to build a robot on-demand to suit the environment. In addition to search and rescue and consumer robots, this flexibility could be very useful for space exploration, such as navigating the surface of Mars.

There are also potential industrial applications, but in the current form the robots are not strong enough to lift many useful objects. However, the researchers suggest that in the future the system could be combined with industrial robots to combine a half modular robot, such as Fetch or Rethink's Baxter robot that has a hand made of modules.

This robot isn't nearly as flashy as the transformers in sci-fi stories and movies, but this work is a scientific breakthrough that could actually be used in practical applications in the near future.

Previous and related coverage:

Robotics in business: Everything humans need to know

An executive guide to the technology and market drivers behind the $135 billion roboticsmarket.

Living Machines: A quick history of robots (Part I)

Derided as abominations or celebrated as ingenious feats of human engineering, robots have been around longer than you think.

Wanted: Robot life coach (no, really)

The unique job is a hint of what's to come as robots increasingly join us in the human world

Gorgeous robots made of high tech paper are mesmerizing

Fifty students were given this shapeshifting paper and told to let their imaginations run wild. Here's what they came up with.

Related stories: