This video shows the impressive tech behind robots walking on rough terrain

While robots taking a tumble is pretty funny, watching how these humanoid machines figure out how to walk autonomously without falling is absolutely fascinating.

In a new video, the Florida Institute for Human and Machine Cognition (IHMC) showcased an automatic footstep planning system for Boston Dynamics’ Atlas and NASA’s Valkyrie robots. The method uses the machines’ sensors to work out the most efficient path to a human-selected location. It also works on rough and narrow terrains.

Previously, the IHMC relied on a manual method that required a human operator to place the desired footsteps in a special user interface. Unfortunately, this method was rather slow and cumbersome, which is why the IHMC has been working on a new autonomous approach that completely removes the need for a human operator.

Indeed, the IHMC notes that the human-operated approach was one of the reasons why the Atlas robot it programmed fell during The Defense Advanced Research Projects Agency’s (DARPA) Robotics Challenge in 2015.

To circumvent human error, the new system lets an operator select the desired location, but ultimately relies on an algorithm to figure out how to get the robot there and avoid obstacles.

While the new method works almost flawlessly in flat environments, it still has lots of progress to made when it comes to narrow and rough terrains. “Currently, narrow terrain has a success rate of about 50 percent, rough terrain is about 90 percent, whereas flat ground is near 100 percent,” the IHMC notes.

In the future, the researchers hope to boost the algorithm’s planning speed, as well as its ability to navigate through mazes and other complicated terrains.

The IHMC isn’t new to spearheading research in robotics. Earlier this year, the institute said it’s developing its own hydraulics-powered humanoid robot that promises to offer previously unseen gains in power and range of motion. It’ll be interesting to see how the machine stacks up against Valkyrie and Atlas, though.

Read next: CHEAP: Get $530 off an Alienware Aurora desktop computer