# Robot Operating System 2 (ROS2)-Based Frameworks for Increasing Robot Autonomy: A Survey
## 3 General Architecture for Enhancing Cobot Autonomy
### Design and Requirements  
A system to increase the autonomous capabilities of robots must necessarily be modular, as it must handle heterogeneous systems. Modules can be associated with the single, basic tasks that the robot must perform in order to increase its autonomy. Complex tasks require a high degree of interdependence between these modules. Like most autonomous systems, the main tasks to be performed by a fixed-base cobot with increased autonomy are shown in Figure 2 and described below:  
1. Perception: The overall architecture needs to use sensors (being exteroceptive or proprioceptive) to gather the necessary information to become aware of the state both of the cobot and of the surrounding environment. This task is then responsible for acquiring and pre-processing these data. The robot state is usually available without the need for additional sensors in all commercialized cobots, which provide access to variables such as joint positions, speeds, and torques or the pose of the TCP. With reference to the latter instead, the often limited environment perception could be easily enhanced by resorting to vision, distance, and/or proximity sensors, such as depth cameras, LIDAR, and sonar. Moreover, this task can be performed by either using a single sensor or by the handling of several, even heterogeneous, sensors, whose data are integrated by means of sensor fusion algorithms to get a better single model of the surrounding environment. 2. Recognition: This task goes beyond mere perception, involving higher-level processing and interpretation of the raw data acquired by sensors. As an example, this is a task dealing with scene understanding, environmental reconstruction, and real-time object recognition/classification. 3. Behavior planning: This is a task responsible for identifying the type of behavior and/or the sequence of actions to be performed. It is potentially a highly advanced task that, however, can be approached at different levels depending on the desired level of autonomy. At a lower level, there is a fairly standard sequence of actions required to perform a specific and predefined task with minimal variations to handle unexpected situations such as obstacles. At the highest level, this allows the robot to autonomously understand the task to be executed based on the surrounding. 4. Trajectory planning: Another essential part of the robotic system is the path-planning algorithm that, based on the desired behavior of the cobot, generates a 3D path of the entire kinematic chain to move the end-effector from the initial pose to the desired final pose. The planned trajectory must be feasible, satisfying the physical constraints of the robot, as well as the constraints imposed by the environment due to  
Figure 1: Examples of sensors integrated into commercial cobots. the presence of static obstacles (i.e., fixed and already present in the environment at the time of planning). 5. Trajectory re-planning: This represents a further fundamental planning module to increase the robot's autonomy in case of dynamic obstacles (i.e., moving obstacles that can appear within the scene at any time). It has two subtasks responsible for detecting collisions with dynamic obstacles and for avoiding them. Specifically, the first performs continuous collision checking between the cobot and the surrounding environment along the path, while the second re-plans a new path to avoid the detected collisions. This latter can be managed both with a global planner that plans a new path from the current state to the goal taking into account the updated environment and, more efficiently, with a local planner that updates the plan only around the potential detected collision. 6. Motion control: This is the low-level task responsible for executing the trajectory planned by the high-level tasks on the real cobot, controlling the robot's actuators to follow the planned trajectory. Alternatively, it can also handle the execution of this plan in simulation. 7.