How Autonomous Robots Work: Perception, Mapping, Planning, Control
How autonomous robots perceive, localize, map, plan and control their motion: the software stack behind warehouse robots and Mars rovers, plus its limits.
An autonomous robot works by running a continuous loop. It senses its surroundings, estimates where it is, decides where to go, plans a path and sends motor commands, then checks the result and repeats. The international robotics vocabulary, ISO 8373, defines autonomy as the "ability to perform intended tasks based on current state and sensing, without human intervention" [1]. In practice, autonomy comes in degrees. A warehouse robot may navigate on its own but stop and wait for a person when blocked. NASA's Perseverance rover can drive itself around hazards, while a human team still plans its overall route [6].
This article explains the software stack behind that loop, using mobile robots as the main example. For robotics basics, start with our complete guide to robotics. For the special case of cars, see autonomous driving levels.
The autonomy stack at a glance
Layer | Question it answers | Typical techniques |
|---|---|---|
Sensing | What raw data do I have? | Lidar, cameras, depth sensors, wheel encoders, inertial sensors |
Perception | What's around me? | Obstacle detection, object recognition, costmaps |
State estimation | Where am I? | Odometry, sensor fusion, map-based localization, SLAM |
Behavior | What should I be doing now? | Task logic, state machines, behavior trees |
Planning | Which route gets me there? | Global path planners over a map |
Control | How do I move this instant? | Local controllers producing velocity commands |
Safety | Must I stop? | Independent safety-rated sensors and stop functions |
Perception: building a picture of the world
Raw sensor data isn't directly useful for decisions. Perception turns it into a representation the planner can use. In the widely used open-source ROS 2 navigation framework, Nav2, that representation is a costmap: "a regular 2D grid of cells containing a cost from unknown, free, occupied, or inflated cost" [4]. Plug-in layers write information from lidar, radar, sonar and depth images into the grid.
Cameras add semantic understanding: that's a person, that's a pallet, that's a doorway. The IFR describes machine vision for detection and robot guidance as "already established and industry-grade" [8].
State estimation: where am I?
A robot can't plan a route without knowing its position. Two sources are combined:
- Odometry tracks motion from wheel encoders and inertial sensors. It's smooth and fast but drifts over time. Sensor fusion, commonly an extended Kalman filter, blends several sources (for example wheel odometry and an IMU) into one smoother estimate; Nav2 notes the Robot Localization package is typically used for this fusion [3].
- Localization corrects drift by matching sensor data to a map. Nav2 provides AMCL (Adaptive Monte Carlo Localization), a particle filter that localizes the robot on a known, static map: it maintains many candidate poses and keeps those whose expected sensor readings best match the map [3].
Nav2 formalizes this with two transforms. A global positioning system (such as SLAM, GPS or motion capture) provides map โ odom, and an odometry system provides odom โ base_link. That follows the ROS community's REP 105 conventions, which require at minimum a full map โ odom โ base_link tree [3]. In practice, odom โ base_link stays smooth and continuous, while the positioning system updates map โ odom to correct accumulated drift [3]. Nav2 notes that lidar isn't required. Vision- or depth-based positioning works as long as it follows those conventions [3].
SLAM (simultaneous localization and mapping) handles the case where no map exists. It means "the concurrent construction of a model of the environment (the map), and the estimation of the state of the robot moving within it" [2]. A landmark survey notes that SLAM has seen "a steady transition of this technology to industry" over three decades of research. It reviews robustness and scalability in long-term mapping and lays out the open challenges that remain [2]. The difference from AMCL is that SLAM builds the map as it goes; Nav2 ships SLAM Toolbox as its default SLAM option, used to position the robot and generate a static map [3]. A common workflow is to map a site once with SLAM, save the map, then localize against it with AMCL in daily operation.
Behavior: deciding what to do
Above navigation sits task logic: go to station 4, pick up the tote, return to dock, charge when the battery drops below a threshold. Nav2 uses behavior trees to orchestrate these steps: when the tree reaches a step, it calls the matching server, such as the planner or controller [5]. Nav2 also includes recovery behaviors to "get the robot out of a bad situation" [5]. Its documentation gives examples: clearing the costmap when faulty perception fills it with fake obstacles, backing up or spinning in place when stuck, and, in a total failure, calling an operator for help [5].
Planning and control: getting there
Navigation splits motion into two levels.
Global planning computes a full route across the map from the current position to the goal. In Nav2, the costmap is "searched to compute a global plan" [4].
Local control turns that plan into immediate velocity commands while reacting to things the map didn't show, like a person stepping into an aisle. Nav2 describes the controller's task as computing "a valid control effort to follow the global plan." Controllers can also be written for docking with a charger or boarding an elevator [5]. The controller samples the costmap to compute its commands [4] and many controllers project the robot forward and compute a locally feasible path at each update [5], so newly sensed obstacles change what it does.
Nav2 runs planners, controllers, smoothers, a route server and behaviors as separate servers hosting interchangeable algorithm plugins [5]. That design lets builders swap algorithms without rewriting the stack.
A real example: driving on Mars
NASA's Perseverance rover shows the same loop where remote control isn't practical. NASA says its AutoNav system "makes 3D maps of the terrain ahead, identifies hazards, and plans a route around any obstacles without additional direction from controllers back on Earth" [6].
Its engineers improved autonomy by letting the rover plan while moving. JPL rover planner and driver Vandi Verma explained that "the rover is thinking about the autonomous drive while its wheels are turning." NASA said that could let it reach up to 393 feet (120 meters) per hour, against about 66 feet (20 meters) per hour for Curiosity with an earlier AutoNav [6].
Safety: a separate layer
Autonomy software is complex, so safety doesn't rely on it alone. OSHA describes industrial mobile robots as navigating autonomously and integrating technologies that detect obstacles in their path, using "obstacle avoidance and/or collision avoidance to prevent possible impacts" [7]. OSHA also lists the hazard: like a vehicle, a mobile robot "could also drive into a worker" [7]. In industrial settings, safety-rated sensors and stop functions are typically designed to work independently of the navigation software. For speed-based safety, OSHA says "the speed should have an associated safety function that monitors that the needed speed will not be exceeded" [7].
Where autonomy still struggles
- Changing environments. Maps go stale when racks move, crowds gather or lighting changes. The SLAM survey highlights long-term robustness as an open problem [2].
- Rare situations. Robots handle what they were designed and tested for. Nav2's own examples of failures include perception faults that fill the map with fake obstacles [5].
- Manipulation in the loop. Navigating is more mature than picking up varied objects. The IFR rates general-purpose "Physical AI" and learning from simulation and experience as "not yet industry-grade" [8].
- People. Shared spaces add risk. OSHA notes a mobile robot can strike a worker much like a vehicle can [7].
Self-driving cars face the same problems at higher speed and with far higher stakes; our upcoming self-driving cars explainer covers that domain. For warehouse robots specifically, see our upcoming guide to autonomous mobile robots.
Frequently asked questions
What makes a robot autonomous?
Its ability to perform intended tasks based on its current state and sensing, without human intervention, as ISO 8373 defines autonomy [1]. Most real robots are partially autonomous. They handle routine navigation and decisions themselves but escalate to people for exceptions.
What is SLAM in robotics?
Simultaneous localization and mapping: building a map of an unknown environment while estimating the robot's position within it [2]. It lets robots operate without pre-installed markers or guide wires.
Do autonomous robots need lidar?
No. Lidar is common, but frameworks such as Nav2 work with vision- or depth-based positioning and other obstacle sensors, provided the robot follows standard frame conventions [3].
How do robots avoid obstacles they've never seen?
Local controllers continuously read a costmap updated from live sensor data. A new obstacle shows up as occupied cells, and the controller adjusts its commands to steer or stop [4][5].
Can an autonomous robot ask for help?
Yes, and good designs plan for it. Nav2's documentation describes recovery behaviors that try to free a stuck robot, and, if those fail, a recovery that calls an operator's attention for help [5]. Mars rover operations combine onboard autonomy with routes planned by a human team [6].
Sources
- International Federation of Robotics, "Service Robots: Definition," citing ISO 8373. https://ifr.org/service-robots
- Cesar Cadena et al., "Past, Present, and Future of Simultaneous Localization and Mapping: Towards the Robust-Perception Age," arXiv:1606.05830 (IEEE Transactions on Robotics, 2016). https://arxiv.org/abs/1606.05830
- Nav2 project, "Navigation Concepts: State Estimation." https://docs.nav2.org/rolling/getting_started/navigation_concepts/state_estimation/
- Nav2 project, "Navigation Concepts: Environmental Representation." https://docs.nav2.org/rolling/getting_started/navigation_concepts/environmental_representation/
- Nav2 project, "Navigation Concepts: Navigation Servers." https://docs.nav2.org/rolling/getting_started/navigation_concepts/navigation_servers/
- Pat Brennan, NASA Jet Propulsion Laboratory, "NASA's Self-Driving Perseverance Mars Rover 'Takes the Wheel'," July 1, 2021. https://www.jpl.nasa.gov/news/nasas-self-driving-perseverance-mars-rover-takes-the-wheel/
- OSHA, "OSHA Technical Manual, Section IV, Chapter 4: Industrial Robot Systems and Industrial Robot System Safety." https://www.osha.gov/otm/section-4-safety-hazards/chapter-4
- IFR Statistical Department, "Executive Summary, World Robotics 2026 โ Industrial Robots," September 2026. https://ifr.org/img/worldrobotics/Executive_Summary_WR_2026_-_Industrial_Robots.pdf