====== Planning and Control in the AV Stack ====== Planning and control are the parts of an autonomous system where perception turns into action. A vehicle does not become autonomous simply by detecting objects or building a map of the world. It must also decide what to do next, determine how that decision can be executed safely, and then convert the planned motion into actuator commands. In other words, this chapter sits in the middle of the autonomy loop: it connects the understanding of the environment to the physical behavior of the vehicle. The closed-loop chain can be viewed as follows: - perception and localisation estimate the state of the vehicle and its surroundings; - prediction estimates how other agents may move; - decision-making selects the intended maneuver or behavior; - motion planning generates a feasible path or trajectory; - control tracks the trajectory through steering, braking, throttle, thrust, or other actuators; - monitoring and fallback functions supervise execution and trigger replanning or a safe state when needed. This chain is important because no single layer is sufficient on its own. A motion planner can produce a good trajectory in isolation, but the same plan may become unsafe if perception is delayed, prediction is wrong, localisation drifts, or the controller cannot physically track the path. A controller may behave correctly on a clean reference trajectory, but still create unsafe behavior if the planner issues abrupt commands or if the vehicle state changes faster than the controller can respond. For that reason, planning and control must be treated as a system-level function, not only as a set of individual algorithms. ===== The role of each layer ===== ^ Layer ^ Main role ^ Typical input ^ Typical output ^ Main validation question ^ | Decision-making | Chooses the maneuver or behavior | Goals, scene context, traffic rules, mission state | Stop, yield, follow, overtake, lane change, reroute | Is the chosen behavior correct and rule-compliant? | | Motion planning | Converts intent into a path or trajectory | Behavioral decision, map, obstacles, vehicle constraints | Safe and feasible trajectory | Can the vehicle execute this path safely and legally? | | Control | Tracks the planned trajectory | Trajectory, vehicle state, actuator feedback | Steering, braking, throttle, thrust commands | Can the vehicle follow the plan within dynamics and timing limits? | | Monitoring / fallback | Detects unsafe or degraded execution | Residuals, health signals, timing, confidence metrics | Replanning, slowdown, minimal-risk maneuver, safe stop | Does the system recover safely when things go wrong? | This structure is useful because it keeps the chapter focused on the system function rather than on one algorithm family only. In an autonomous vehicle, the interesting question is not merely whether a controller works, but whether the complete decision–planning–control chain behaves safely and predictably in the intended Operational Design Domain (ODD). ===== Why this layer is different from the rest of the stack ===== Compared with perception and localisation, this chapter deals more directly with action selection and vehicle motion. That makes the safety implications more immediate. A perception error may be serious, but a planning or control error can immediately turn into unsafe motion. This is why planning and control usually require tight timing, careful supervision, and explicit fallback behavior. At the same time, this layer is also more tightly coupled to vehicle dynamics than higher-level software. The planner cannot ignore turning radius, braking distance, acceleration limits, road friction, actuator delay, or comfort constraints. A behavior module cannot ignore traffic rules, interaction with other agents, or the fact that some maneuvers are safe only in certain conditions. Planning and control therefore sit at the intersection of: - system intent, - physical feasibility, - real-time execution, - and safety assurance. ===== Domain differences ===== {{ :en:safeav:ctrl:planning_and_control_6.1.jpeg?800 |}} The same functional chain exists in all autonomy domains, but the emphasis changes with the physical environment. ^ Domain ^ Main emphasis ^ Typical planning and control style ^ | Ground systems | Human interaction, road rules, friction-limited dynamics, low-latency reaction | reactive planning, trajectory tracking, stop/yield behavior, comfort-aware control | | Airborne systems | Stability, altitude, airspace rules, weather, safety margins | layered control, outer-loop guidance, strict envelope protection | | Marine systems | Disturbances from waves, currents, wind, sparse infrastructure, long duration | robust control, waypoint navigation, energy-aware mission planning | | Space systems | Communication delays, orbital mechanics, limited actuation, no real-time human intervention | model-based control, mission planning, trajectory optimization under physical constraints | Ground vehicles must handle dense interaction with pedestrians, cyclists, lane markings, signals, and other vehicles. Airborne systems face a three-dimensional environment where stability and safety margins dominate. Marine systems operate more slowly, but disturbances and sparse sensing make robustness essential. Space systems are the most constrained of all: decisions are often conservative, highly validated, and based on first-principles dynamics because real-time intervention is limited or impossible. This is why the chapter cannot treat control and planning as a single universal recipe. The underlying logic is shared, but the validation target changes depending on the domain, the vehicle dynamics, the available sensors, and the consequences of failure. In this chapter, we are able to follow the chain from a high-level behavior down to the executed motion: - Define the maneuver or mission objective. - Determine how the behavior is represented in the autonomy stack. - generate a trajectory or control action that respects constraints; - Execute the motion through the vehicle dynamics; - Supervise the result and trigger replanning or fallback if needed. This chapter, therefore, serves as a link between understanding the environment and demonstrating that the vehicle can operate safely within it. It prepares the reader for the next sections, where the main control strategies, planning architectures, and validation methods are discussed in more detail. /* ---- commented ------ ====== Classical and AI-Based Control Strategies ====== ===== Classical Control Strategies ===== Classical control strategies form the bedrock of modern vehicle control systems. These methods rely on mathematical models of the vehicle dynamics and well-established principles from control theory, primarily developed in the 20th century. Their strength lies in their mathematical rigor, transparency, and well-understood stability properties. ==== Principles and Common Techniques ==== * **Model-Based Approach:** Classical control typically requires a mathematical model describing the vehicle's behavior (e.g., how steering angle affects lateral position, how throttle input affects speed). These models are often linearized around operating points or use simplified representations (like the bicycle model for lateral dynamics). * **Feedback Control:** The core idea is feedback: measure the current state (e.g., actual speed, actual steering angle, lateral position error), compare it to the desired state (setpoint or reference trajectory), compute an error, and generate a control action (e.g., throttle command, steering angle command) to minimize this error. * **Key Techniques:** * **PID (Proportional-Integral-Derivative) Control:** Perhaps the most ubiquitous control algorithm. It calculates the control action based on the proportional error (current difference), integral of past errors (eliminates steady-state error), and derivative of the error (anticipates future error, dampens oscillations). Widely used for speed control, yaw rate control, and simple steering tasks. * **LQR (Linear Quadratic Regulator):** An optimal control technique that finds the control inputs that minimize a cost function, typically balancing tracking error and control effort (or control energy). Requires a linear model of the system and definitions for the cost function weights. Often used for trajectory tracking and stabilization. * **State Estimation:** Techniques like Kalman Filters are essential companions to classical control. They fuse data from multiple sensors (IMU, GPS, wheel speed sensors) to estimate the vehicle's state (position, velocity, orientation, etc.) accurately, which is then fed into the controller. This is crucial for handling sensor noise and providing a reliable state estimate for the controller. * **Sliding Mode Control (SMC):** A robust control technique designed to handle uncertainties and disturbances by forcing the system state to "slide" along a predefined surface, making the system insensitive to certain variations. ==== Safety Aspects of Classical Control ===== * **Predictability and Stability:** Classical control methods offer strong theoretical guarantees regarding stability and performance, provided the system model is accurate and operating conditions remain within the model's assumptions. This predictability is a significant safety advantage. * **Transparency:** The logic of classical controllers (e.g., PID gains, LQR cost function) is often interpretable by engineers. This makes it easier to understand *why* the controller is behaving in a certain way, facilitating verification, validation, and debugging. * **Maturity and Proven Track Record:** These techniques have been extensively used and refined in safety-critical systems (like automotive engine control units, ABS, ESC) for decades, demonstrating their reliability under well-defined conditions. ==== Limitations ==== * **Model Dependency:** Performance heavily relies on the accuracy of the vehicle model. Complex, highly nonlinear dynamics (tire slip, aerodynamic forces, suspension effects) are difficult to model precisely across all operating conditions. * **Handling Uncertainty:** Classical methods can struggle with significant model uncertainties, unmodeled dynamics, and large external disturbances (e.g., sudden wind gusts, icy patches) unless specifically designed for robustness (like SMC). * **Complexity in High Dimensions:** Designing and tuning classical controllers for complex, high-dimensional systems (like full vehicle dynamics with multiple degrees of freedom) can become computationally intensive and require significant expertise. * **Limited Adaptability:** Standard classical controllers are typically designed for specific operating regimes and may not adapt well to drastically changing conditions without re-tuning or redesign. ===== AI-Based Control Strategies ===== AI-based control strategies leverage machine learning and artificial intelligence techniques to learn control policies directly from data or simulations, often bypassing the need for explicit, hand-crafted mathematical models. This data-driven approach offers potential advantages in handling complexity and adaptability. ==== Principles and Common Techniques ==== * **Data-Driven Approach:** AI controllers learn the mapping from sensor inputs (or estimated states) to control outputs by analyzing large datasets or through simulation-based training. They discover complex, non-linear relationships that might be difficult or impossible to capture with traditional modeling. * **Learning from Experience:** Techniques like Reinforcement Learning (RL) allow agents (the AI controller) to learn optimal policies by interacting with an environment (simulator or real vehicle) and receiving rewards or penalties for their actions. The goal is to maximize cumulative reward, which can be defined to align with safety and performance objectives. * **Function Approximation:** Neural networks are a common tool in AI control, acting as flexible function approximators. They can learn the complex mapping from state to control action without requiring a predefined model structure. * **Key Techniques:** * **Reinforcement Learning (RL):** Learns a policy (control strategy) through trial and error. The agent explores actions, observes the resulting state and reward, and updates its policy to favor actions that lead to higher cumulative rewards. Deep RL combines RL with deep neural networks to handle high-dimensional state spaces (like raw sensor data). * **Supervised Learning for Control:** Can be used if expert demonstrations of desired control behavior are available. The AI learns to mimic these demonstrations. * **Model Predictive Control (MPC) with Learned Models:** While MPC itself is a classical optimization-based control technique, AI can be used to learn the prediction model of the vehicle dynamics, potentially capturing complex non-linearities better than hand-crafted models. * **Neural Network Controllers:** Directly using neural networks to output control commands based on the current state estimate. ==== Safety Aspects of AI-Based Control ==== * **Potential for Handling Complexity:** AI can learn to control highly complex, non-linear systems where deriving accurate classical models is intractable. * **Adaptability and Generalization:** AI controllers, especially those trained on diverse data or simulations, may generalize better to unseen situations or adapt to gradual changes in the vehicle or environment. * **Learning Optimal Behaviors:** RL, in particular, can potentially learn control policies that are optimal with respect to a carefully designed reward function, potentially outperforming hand-tuned classical controllers. ==== Challenges and Safety Concerns ==== * **Black-Box Nature:** AI controllers, particularly deep neural networks, can act as "black boxes." It can be difficult to understand *why* they make specific control decisions, which complicates verification, validation, and debugging – critical steps for safety certification. * **Verification and Validation (V&V):** Ensuring the safety and robustness of AI controllers is a major challenge. Standard V&V techniques for classical systems are often not directly applicable. Guaranteeing stability, performance bounds, and safety across all possible operating conditions is difficult. * **Data Dependency and Bias:** Performance heavily depends on the quality and diversity of the training data. Biases in the data can lead to unsafe behaviors in real-world scenarios not represented in the training set. * **Robustness to Adversarial Attacks and Novel Situations:** AI models can be vulnerable to adversarial inputs designed to fool them. Their performance in truly novel situations (out-of-distribution data) is often unpredictable. * **Safety Guarantees:** Providing formal, mathematical proofs of safety (e.g., stability, collision avoidance) for complex AI controllers is an active area of research and remains largely unsolved for production systems. ===== Integration and Hybrid Approaches ===== In practice, a purely classical or purely AI-based control system is rare. Instead, a hybrid approach is often employed, leveraging the strengths of both paradigms: * **AI for High-Level Strategy, Classical for Low-Level Execution:** AI might be used in the planning or decision-making layers to determine the desired trajectory or maneuvers, while classical controllers (like LQR or PID) handle the precise low-level actuation (steering, throttle, braking) based on the AI's output. This keeps the safety-critical low-level control transparent and predictable. * **AI for Model Estimation, Classical for Control:** AI can be used to learn a more accurate or adaptive model of the vehicle dynamics, which is then fed into a classical controller like MPC. * **AI for Exception Handling:** Classical controllers handle normal driving conditions, while an AI component (potentially an RL agent) is trained to handle rare or complex edge cases that the classical controller might struggle with. * **Hybrid Controllers:** Combining elements of both, for example, using a neural network to tune the gains of a PID controller in real-time based on the driving conditions. ===== Safety Considerations and Future Directions ===== The choice between classical and AI-based control strategies, or a hybrid approach, has profound implications for the safety of autonomous vehicles. * **Transparency vs. Performance Trade-off:** There is often a trade-off between the interpretability and verifiability of classical methods and the potential performance and adaptability of AI methods. Safety requires careful consideration of this trade-off. * **Robustness and Reliability:** Both approaches must demonstrate robustness to sensor failures, actuator limitations, environmental disturbances, and unexpected interactions. Classical methods offer more established theoretical frameworks for robustness analysis, while AI methods require ongoing research into robust learning and control. * **Verification and Validation (V&V):** Developing rigorous V&V processes for AI-based components is critical. This includes simulation testing across diverse scenarios, hardware-in-the-loop (HIL) testing, and potentially new techniques like formal verification or safety certificates based on training procedures. * **Certification:** Regulatory bodies require evidence of safety. The black-box nature of AI makes traditional certification pathways challenging, necessitating new standards and methodologies. * **Future Trends:** Research is actively focused on making AI controllers more transparent (e.g., via explainable AI), more robust (e.g., via adversarial training, safe exploration in RL), and better integrated with classical methods. There is also growing interest in "learning-to-control" approaches that combine model learning with control policy learning. Classical control strategies provide a foundation of predictability, stability, and transparency, making them essential for safety-critical low-level vehicle control. AI-based control strategies offer the potential to handle unprecedented complexity and adaptability, learning optimal behaviors from data. Neither approach is a silver bullet; each has distinct strengths and weaknesses regarding safety. The future of safe autonomous vehicle control likely lies in sophisticated hybrid systems that intelligently combine the rigor of classical control with the power of AI, all underpinned by rigorous verification, validation, and a relentless focus on ensuring robust and predictable behavior in the real world. The ongoing development and integration of these strategies are key to achieving the high levels of safety required for widespread deployment of autonomous vehicles. */