If you’ve never had a robot snake constrict around your leg, let me tell you, it’s a weird feeling. As it curls its way up your ankle, then shin, then finally wraps around your knee, it gets tighter and tighter. Fortunately, unlike a real snake, it doesn’t have teeth. Unfortunately, also unlike a real snake, it’s made of metal joints that pinch harder and harder until you say, “OK, that’s enough,” and the young man at the controls hits a button and calls off the machine.

Here at the Biorobotics Lab at Carnegie Mellon University, there's a veritable menagerie of mechatrons. The snake slithers, a robot insect crawls about, and a wheeled biped speeds down the hallway—until you try to give it a push and it crashes into a wall. This is the strange melding of animal and machine, looking to nature not to copy it one-for-one, but to find inspiration in the bodies that evolution has crafted over millions of years.

But snakes, why did it have to be snakes? Because serpents have a lot to teach us about locomotion that looks nothing like our own. Snakes can swim, they can climb, they can slither forward and sidewind sideways to tackle virtually any kind of environment. Hell, they can even fly. Snakes also come in a convenient shape that can squeeze into tight spaces—which might be handy one day for rescue robotics. (These researchers did take their robot snake to Mexico after September’s monster quake to explore collapsed buildings for survivors. The problem, though, is that for the time being it’s better to hunt for signs of life with microphones than it is to visually probe the rubble.)

Carnegie’s snake robot is a modular machine made of 16 motors known as actuators. Think of these as a whole bunch of joints running down the body, making the robot highly dexterous. By manipulating the actuators in the right sequence, the researchers can get the snake to pull off a surprising range of movements, from undulating like a sine wave (think about someone doing the worm) to constricting up legs.

It isn’t built exactly like a snake because, well, it’s impossible to replicate all those bones and muscles. The robot is an homage to a snake, not a copy of one. “This is going to prohibit you from achieving exactly what we're able to observe in biology,” says CMU roboticist Matt Travers. “But it also means that there's going to be things that this robot can do that a biological snake can't.” For instance, rapidly rolling around like an alligator tearing a piece of flesh off a buffalo.

There’s an interesting interplay here between nature and robotics. First of all, it’s about teasing apart the subtleties of biological locomotion. Travers and other researchers, for instance, did experiments that revealed how sidewinders can move up a slope in loose sand. Turns out the snakes ripple with two different waves, one that grips the ground while the other bit moves forward. They then reprogrammed their robot to do the same—and sure enough, it was better able to tackle the same kind of slope.

What you really want, though, is a robot snake that can feel. So this lab’s next-gen snake is made of actuators that can sense the force placed on it. “So now we have this robot that can not only move and looks like biology, but it can feel just like a biological system may,” says CMU roboticist Howie Choset. “So like when you're walking through the woods, you're not planning every possible footstep. Your feet are sort of feeling their way as you go along.”