We have already discussed this on Techno-Science: it is possible to control a cockroach's trajectory by equipping it with electronic equipment. The system can now recognize the type of terrain it encounters and adapt the trajectory almost immediately.
The idea is based on a living animal to which researchers add a small electronic system. Electrical stimulation guides its movements, but the cockroach retains its natural abilities to walk and overcome obstacles. This combination of a living organism and a machine forms what researchers call a biohybrid system.

A young Madagascar hissing cockroach photographed at the Atlanta Botanical Garden.
Photo: Almabes, cropped by WolfmanSF / Wikimedia Commons — public domain
The problem arises when the terrain changes. A conventional navigation system mainly seeks to correct the animal's direction to lead it toward its destination. Yet when faced with a slope or a hole, this correction can cause unnecessary detours and interfere with movements the cockroach already knows how to perform naturally.
Researchers from Osaka University and their colleagues therefore added automatic terrain recognition. The device analyzes the information collected during movement in real time. An artificial intelligence system then classifies the ground into four situations: flat terrain, uphill, downhill, or a hole.
This identification enables the controller to change its behavior. On ordinary ground, it can continue guiding the insect toward its target. When the cockroach encounters a configuration it can overcome on its own, the system instead limits its interventions and allows the animal to make greater use of its own abilities.

To understand the benefit, consider a slope. Continuously forcing the cockroach to follow a theoretical direction is not necessarily the fastest way to cross it. Allowing it to adjust its legs and body naturally may be more effective, after which guidance resumes once the passage has been negotiated.
The trials show that this strategy reduces unnecessary movements and improves navigation on routes containing different types of terrain. The system therefore does not turn the cockroach into a simple remote-controlled robot. It divides the tasks: the electronics decide when to guide, while the animal retains part of the control over its locomotion.
This approach is of particular interest for robotics intended for hard-to-reach places. An insect can move through narrow passages and across uneven surfaces without requiring all the mechanics of a traditional robot. The researchers notably cite search-and-rescue operations among the potential applications.
The next step is to make these biohybrid systems more autonomous in less predictable environments. In particular, their behavior will need to be tested when several types of obstacles and terrain follow one another under conditions similar to those encountered outside the laboratory.