scieee AI-readable full text Open interactive document viewer

Dynamic global/local multi-layer motion planner architecture for autonomous cognitive surgical robots

Sayols Baixeras, Narcís,Hernansanz Prats, Alberto,Sozzi, Alessio,Piccinelli, Nicola,Falezza, Fabio,Farsoni, Saverio,Casals Gelpí, Alicia,Bonfè, Marcello,Muradore, Riccardo

Abstract

This paper presents a novel dynamic motion planner designed to provide safe motions in the context of the Smart Autonomous Robot Assistant Surgeon (SARAS) surgical platform. SARAS is a multi-robot autonomous platform designed to execute auxiliary tasks in Minimally Invasive Surgeries (MIS) with a high degree of autonomy. The development of robotic systems with a high level of autonomy and reliability requires to perceive the workspace and human actions, to contextualize them with the surgical workflow, and, finally, plan and dynamically control the required motions. The autonomous control relies on a multi-level hierarchical Finite State Machine (hFSM) that decides and supervises all robot actions and their transitions. This approach requires multi-granularity decomposition of the surgical procedure and defines different motion profiles to preserve and safely interacts with the patients’ anatomy. The motion planner is developed under the minimally invasive surgery context since it is an extreme use case where the environment is complex, dynamic and unstructured. Moreover, in the SARAS platform the autonomous robots share workspace as well as collaborate with other human-guided robotic instruments. This creates an even more complex working environment and defines a set of hierarchical relationships in which auxiliary instruments have a lower priority. The presented motion planner acts at two levels: Global and Local. The Global Planner generates an initial spline-based trajectory that, defined by a set of Control Points, follows a certain profile determined by the ongoing surgical action and the interaction with the patient’s anatomy. Then, during the execution of the motion, the Local Planner observes the workspace (anatomy and other tools) and applies different virtual potential fields to the control points to dynamically modify their position to avoid potential collisions or tool blocking while maintaining trajectory coherence. At this level, it reactively modifies the trajectory between the tool position and the next control point applying Dynamical Systems based obstacle avoidance. This approach ensures collision free connections between the spline control points. The proposed motion planner is validated in a realistic surgical scenario. The experimental results are analysed from data collected during various Robotic-Assisted Radical Prostatectomy surgeries on manikins, performed with the SARAS SOLO-SURGERY platform: the main surgeon teleoperates a daVinci Research Kit and two robotic arms autonomously perform different auxiliary surgical tasks.

Full text

Contents lists available at ScienceDirect Robotics and Autonomous Systems journal homepage: www.elsevier.com/locate/robot Dynamic Global/Local multi-layer motion planner architecture for autonomous Cognitive Surgical Robots Narcís Sayols a,d,∗,Albert Hernansanz a,d,Alessio Sozzi b,Nicola Piccinelli c,Fabio Falezza c, Saverio Farsoni b,Alícia Casals a,Marcello Bonfè b,Riccardo Muradore c aDepartment of Automatic Control, Universitat Politècnica de Catalunya, Barcelona, Spain bDepartment of Engineering, University of Ferrara, Italy cDepartment of Engineering for Innovation Medicine Science, University of Verona, Italy dDepartment of Engineering, Universitat Pompeu Fabra, Barcelona, Spain ARTICLE INFO Keywords: Dynamic motion planning Cognitive control Autonomous robots Multi-layer control architecture Collision avoidance RMIS ABSTRACT This paper presents a novel dynamic motion planner designed to provide safe motions in the context of the Smart Autonomous Robot Assistant Surgeon (SARAS) surgical platform. SARAS is a multi-robot autonomous platform designed to execute auxiliary tasks in Minimally Invasive Surgeries (MIS) with a high degree of autonomy. The development of robotic systems with a high level of autonomy and reliability requires to perceive the workspace and human actions, to contextualize them with the surgical workflow, and, finally, plan and dynamically control the required motions. The autonomous control relies on a multi-level hierarchical Finite State Machine (hFSM) that decides and supervises all robot actions and their transitions. This approach requires multi-granularity decomposition of the surgical procedure and defines different motion profiles to preserve and safely interacts with the patients’ anatomy. The motion planner is developed under the minimally invasive surgery context since it is an extreme use case where the environment is complex, dynamic and unstructured. Moreover, in the SARAS platform the autonomous robots share workspace as well as collaborate with other human-guided robotic instruments. This creates an even more complex working environment and defines a set of hierarchical relationships in which auxiliary instruments have a lower priority. The presented motion planner acts at two levels: Global and Local. The Global Planner generates an initial spline-based trajectory that, defined by a set of Control Points, follows a certain profile determined by the ongoing surgical action and the interaction with the patient’s anatomy. Then, during the execution of the motion, the Local Planner observes the workspace (anatomy and other tools) and applies different virtual potential fields to the control points to dynamically modify their position to avoid potential collisions or tool blocking while maintaining trajectory coherence. At this level, it reactively modifies the trajectory between the tool position and the next control point applying Dynamical Systems based obstacle avoidance. This approach ensures collision free connections between the spline control points. The proposed motion planner is validated in a realistic surgical scenario. The experimental results are analysed from data collected during various Robotic- Assisted Radical Prostatectomy surgeries on manikins, performed with the SARAS SOLO-SURGERY platform: the main surgeon teleoperates a daVinci Research Kit and two robotic arms autonomously perform different auxiliary surgical tasks. 1. Introduction The introduction of teleoperated robotic systems for Minimally Invasive Surgery (MIS) is a reality from almost 20 years ago. Teleoperated robotic systems, such as the daVinci®system (Intuitive Surgical, Inc.), have been widely deployed in fields such as urology and gynaecology. The natural evolution in Robotic-Assisted Minimally Invasive Surgery (RMIS) tends to provide these systems with a certain degree of autonomy, [1–5], which implies the development of cognitive control ∗Corresponding author at: Department of Automatic Control, Universitat Politècnica de Catalunya, Barcelona, Spain. E-mail address: [email protected] (N. Sayols). architectures and computation of collision-free motion planning to guarantee safe physical interaction with the environment. In surgery, these operations are much more problematic than in other fields due to the need to manipulate deformable tissues, which have a dynamics complex to predict. Moreover, the unknown/variable viscoelastic properties of human tissues imply that the interaction between tissues and tools are difficult to figure out in advance. https://doi.org/10.1016/j.robot.2024.104758 Received 16 March 2022; Received in revised form 10 July 2024; Accepted 14 July 2024 Robotics and Autonomous Systems 180 (2024 ) 104758 Available online 19 July 2024 0921-8890/© 2024 The Author (s ). Published by Elsevier B.V. This is an open access article under the CC BY-NC license ( http ://creativecommons.org/licenses/bync/4.0/ ). N. Sayols et al. Cognitive surgical robotics is a broad concept that aims to define the level of autonomy provided by a robotic system along a surgery. Following the cognitive concept presented in [6], cognition intervenes in different aspects of the control architecture, data acquisition, situation awareness and human–robot interaction. The result is autonomous actions along the surgical workflow to provide assistance to surgeons. There are different levels of autonomy in Robotic-Assisted surgery, [7]. Following the authors’ classification, RMIS is usually categorized in No Autonomy (Level 0) and occasionally, in Robot Assistance (Level 1). The EU funded Smart Autonomous Robotic Assistant Surgeon (SARAS) project, [8], aims to achieve the Task Autonomy (Level 2), developing a two-arm robotic system that performs auxiliary tasks autonomously. Robot Assisted Radical Prostatectomy (RARP) is used as test case to evaluate the proposed dynamic motion planner in the context of a cognitive robotic system, [9]. Different auxiliary and repetitive tasks have been selected as candidates to be automatized such as push and hold an organ to free and enlarge the surgical field, grasp and mobilize catheters to hold, fix and expose organs, bring the suture needle to the needle grasper guided by the main surgeon, remove the needle from the surgical field, etc. Motion planning is a classic robotics problem that has been addressed by a multitude of works giving place to very different approaches, depending on the needs and the context of application. In surgical robotics, motion planning has a special relevance: the trajectory should be collision free observing the dynamics of the robot and its interaction with the environment, which includes other surgical tools and deformable anatomy. The motion planner should be deterministic and ensure real-time capability of recomputing the path according to changes in the environment. Classical probabilistic roadmap methods usually fail because they are basically oriented to deal with static environments. Some authors have adapted these techniques to dynamic environments in RMIS, using reinforcement learning [10,11], interpolation techniques to generate smooth trajectories, [12], etc. Random sampling methods may not fulfil real-time constraint and do not generate deterministic solutions that ensure the required safety in RMIS. For this reason, several solutions have been proposed in the literature to speed up replanning and online path adaptation, [13]. The Remote Center of Motion (RCM), the insertion point of the instruments in MIS, imposes certain movement constrains that should be observed for motion computation. In [14,15] the authors propose the use of recurrent neural networks with learning by demonstration to optimize the online motion planning considering RMIS constraints. In [16], the authors introduce an online hierarchical optimization framework for controlling the endoscope during a surgery. This framework prioritizes the RCM constrains while visually tracking some elements of interest. Adaptive/reactive motion planning based on potential fields is proposed in [17–20] to dynamically guide the robots along a trajectory with obstacles. The replanned trajectory is the result of applying attractive force fields towards the target and repulsive forces generated from the obstacles. Some works include the approximation speed (relative speed between robot and obstacle) to develop more robust reactive motion planners, [21,22]. Unfortunately, most of these works are oriented to mobile robotics, which present less complexity and deals with simpler obstacle shapes; thus, the proposed solutions are not valid for RMIS environments. In pure reactive strategies, based on the instantaneous computation of the desired motion towards a target or avoiding an obstacle, the trajectory described by the robot is not predictable and, consequently, its use in RMIS may not be convenient. A learning-by-demonstration approach is proposed in [23] to generate an online path planner that introduces variability on the workspace conditions to provide the system with a certain degree of adaptability and robustness. Reinforcement learning techniques are also used in the surgical context for automatic task planning [24]. Solutions based on multirobot platforms automatically select the most suitable robot, at every moment, to execute a task that cannot be performed with a unique robot [25]. In [26], the authors use a hybrid framework Fig. 1. SARAS SOLO-SURGERY experimental setup, including SARAS robots, dVRK robots and anatomical phantom. that combines task-motion planner and Dynamic Behaviour Trees to coordinate multiple tools to execute surgical tasks such as suturing. This research contributes to: •develop a motion control architecture to generate safe trajectories in highly constrained environments (multiple tools and deformable obstacles). •develop a two-level motion planning control architecture: a global dynamic force field trajectory reconfiguration to compute Control Points (𝐂𝐏s) and a local planner that modulates velocities, ensuring obstacle avoidance from a 𝐂𝐏 to the next. •integrate a dynamic motion planner into a cognitive control architecture to design an autonomous surgical system. The paper is organized as follows: Section 2introduces the SARAS robotic platform and the approximation to the surgery workflow decomposition. Then, Section 3describes the planner used by the SARAS system to execute surgical tasks. Section 4analyses the results obtained from several experiments executed with anatomical phantoms. The paper finalizes with the conclusions in Section 5. 2. Cognitive SARAS robotic platform The SARAS project objective was to develop autonomous surgical robots that substitute assistant surgeons in laparoscopic RMIS techniques executing auxiliary surgical tasks by means of a cognitive based approach. In such surgical scenarios, the main surgeon teleoperates the daVinci system (endoscope and two robotic surgical instruments) while the SARAS robots with actuated standard laparoscopic instruments at their end-effector autonomously execute auxiliary tasks. This setup is named SARAS SOLO-SURGERY. The project also observes other surgical setups where the main tools are manually handled by the surgeon and their position is acquired by external sensory methodologies. Autonomy, in the context of this work, implies automatic motion planning inside a dynamic, complex and unstructured anatomical workspace. In addition, the main tools (teleoperated by the main surgeon) share the workspace with the SARAS tools defining a hierarchical relationship: the motions must preserve patients’ anatomy without interfering with the human-guided main tools. The motion planner has to continuously update the SARAS robots motions by observing the trajectory of the main tools, which movements are only predictable in a short-time horizon, the intentions of the surgeons’ surgical actions, the surgery workflow, and the deformable patients’ anatomy. Fig. 1 shows Robotics and Autonomous Systems 180 (2024 ) 104758 2 N. Sayols et al. the robotic system interacting with a pelvic phantom. The experimental setup is composed of two SARAS robots and a daVinci Research Kit (dVRK) operated by the main surgeon. The developed control architecture is based on a multi-granularity top-bottom surgical workflow decomposition. Each level describes the surgical intention, main tool actions, requirements and limitations of SARAS motion tools, patient safety, etc. This approach decomposes the whole surgical procedure into four levels and describes the surgery using hierarchical Finite State Machines (hFSMs): •the Procedure defines a complete surgery, which is composed of a set of surgical phases and the transitions between them. •the Phases define complex surgical actions with a defined intention or objective, and with a clear beginning and end. Each phase is defined as a set of actions and their allowed transitions. •the Actions define simple tool tasks with an objective. Each task is defined by a set of surgemes and their transitions. •the Surgemes are atomic actions within a surgery that cannot be further decomposed. The hFSMs provide a deterministic behaviour of the SARAS robots when executing auxiliary tasks. This highly structured architecture also provides controlled responses to critical situations and changes on required auxiliary tasks to be performed. In addition, this modular approach allows changes on any of the Finite State Machines (FSMs) without altering the rest of the hFSM. 3. Dynamic Motion Planner (DMP) This section describes in detail the Dynamic Motion Planner (DMP) control module, which is composed of two submodules: Global and Local. The DMP is integrated in the SARAS cognitive control architecture: DMP observes several restrictions imposed by the surgical tasks and anatomical workspace such as typology of trajectories, approximation and interaction with delicate tissues, hierarchy of surgical tools, etc. A simplified version of the DMP was introduced in [27]. The preliminary version did not include neither the interactive forces nor the trajectory typology imposed by each surgical action and the interaction between SARAS tools and patients’ anatomy. The DMP can be described, from a temporal point of view, as an initial stage that computes a 3rd-order polynomial trajectory (Trajectory Generator) observing the task specifications and equidistribute 𝐂𝐏s over it. Then, during the motion execution, dynamically adapts the motion according to the workspace status and task evolution (Trajectory Reconfigurator and Trajectory Modulation). DMP can also be described in terms of the scope of planning: global and local. The global planner operates on the position of the 𝐂𝐏 by defining their initial position (Trajectory Generator) and dynamic reconfiguration (Trajectory Reconfigurator) during the motion execution; while the local planner controls the position of the tool between 𝐂𝐏 (Trajectory Modulation). This approach defines two levels of control loop: one acting over the entire trajectory (Trajectory Reconfigurator) and one that is applied locally on the current section between the tool tip and the next 𝐂𝐏 (Trajectory Modulation). This multi-layered approach is required to ensure trajectory consistency and fast response to dynamic environment. Trajectory Reconfiguration requires higher computational load (the algorithm uses high resolution 3D meshes of the obstacles) than Local Motion Planner (LMP) (20 Hz vs. 200 Hz respectively in the presented use case). Fig. 2 illustrates the two-layer control architecture and its integration in the cognitive control module. 3.1. Global Motion Planner (GMP) The Global Motion Planner (GMP) is the responsible to generate the initial trajectory and equidistribute 𝐂𝐏s along it. Then, during execution time, it dynamically reposites the 𝐂𝐏s by means of potential Fig. 2. Block diagram representing the architecture of the motion planning module. fields which are inspired by the Elastic Strips [28] approach. From a design perspective, the GMP is composed of two submodules: the Trajectory Generator and the Trajectory Reconfigurator. The Trajectory Generator computes an initial 3rd-order polynomial trajectory defined by a set of parameters: the current tool tip position as initial point, the destination point, and trajectory shape specifications imposed by the type of surgical action. Then, the Trajectory Generator uniformly places the 𝐂𝐏s over the trajectory. During the motion execution, the Trajectory Reconfigurator is continuously updating the position of the 𝐂𝐏s to avoid collisions and disturbing the tools remotely controlled by the main surgeon by means of applying different force fields to all the 𝐂𝐏s over the remaining part of the trajectory. The description of this module requires the introduction of different concepts such as 𝐂𝐏s and Depth Map (DM). 3.1.1. Control Points (CPs) The 𝐂𝐏s are intermediate trajectory positions used as a mathematical tool to define a smooth collision free motion. Each 𝐂𝐏 is defined as a point mass affected by attractive and repulsive forces generated by the different elements in the workspace. Initially, 𝐂𝐏s are placed along the polynomial curve defined by the Trajectory Generator. During the motion execution, 𝐂𝐏s are affected by the force fields computed by the Trajectory Reconfigurator that vary their position, if required, defining the new tool motion. Therefore, a trajectory is described by a set of points {𝐂𝐏0,𝐂𝐏1,…,𝐂𝐏𝑛}. The number of 𝐂𝐏s is defined by the length of the initial trajectory. At each control cycle the 𝐂𝐏s receive the following forces: •An attractive force towards the RCM to ensure its reachability. •A repulsive force created by the different obstacles in the workspace in the plane perpendicular to the trajectory direction. The force direction is defined by the projection of the minimum distance vector between the tool and the obstacle in the mentioned perpendicular plane. This is due to the need to have the points spaced throughout the trajectory. •An attraction force to the original position of the 𝐂𝐏, to maintain as much as possible the original planned trajectory. •An attraction force between 𝐂𝐏s in order to ensure the coherence between their movements, guaranteeing trajectory smoothness. Once forces are applied to the 𝐂𝐏s and their positions are updated, the associated DMs are recomputed to ensure that their positions are reachable by the tool. Finally, the new trajectory is computed by interpolating a Catmull-Rom spline [29] between 𝐂𝐏s. Robotics and Autonomous Systems 180 (2024 ) 104758 3 N. Sayols et al. Fig. 3. Illustrative example of the DM (left) associated to a laparoscopic tool (right). The right image shows the tool (in blue) and its associated workspace (blue cone) as well as another tool (green) intersecting the workspace. The DM (left) shows the influence (maximum depth) of the green tool over the DM of the blue tool. (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.) 3.1.2. Depth Maps (DMs) Depth Maps (DMs) are designed to ensure that the tool can reach the 𝐂𝐏s without colliding with any other element of the workspace. DMs have been developed as a fast computational method to accelerate the recomputation of the tool motion. Each 𝐂𝐏𝐢has an associated 𝐷𝑀𝑖. Each 𝐷𝑀𝑖estimates the maximum reachable tool collision free depth of a subspace defined around the 𝐂𝐏𝐢at the time that the tool will reach it. 𝐷𝑀s benefits of two factors in laparoscopic surgeries: first, the tools geometry is defined by a long straight rod with a clamp or utensil at the tip. Second, each tool has a fixed 𝐑𝐂𝐌 that constrains its movements, generating a conic workspace with vertex in the 𝐑𝐂𝐌. In consequence, free collision points are those that can be connected to the 𝐑𝐂𝐌 by straight line without any intersection. Thus, using the geometry of the tool and representing the workspace in spherical coordinates (𝑟, 𝜃, 𝜑) with origin in its 𝐑𝐂𝐌, it is possible to represent, for each tool direction (𝜃, 𝜑), its maximum collision free achievable depth. Then, a matrix 𝐷𝑀 can represent all the reachable space in the workspace. Each element 𝑑𝑖𝑗 of the matrix 𝐷𝑀 is the maximum reachable point in the direction (𝜃𝑖, 𝜑𝑗)where {𝜃𝑖, 𝜑𝑗}is a discretization of the angular space. Fig. 3 shows an example of a depth map computation in a workspace with a laparoscopic tool as an obstacle. The estimation of the workspace status is computed, for each 𝐂𝐏 as: first, obtaining the remaining time until the tool will reach the 𝐂𝐏. Then, estimating the position of all the elements of the workspace (including tools and the anatomy) by applying a linear extrapolation to them based on the motions observed during the last control loop. When the time to reach the 𝐂𝐏s is long and the dynamics of the main tools are abrupt, the validity of the estimation is limited. When the tool approaches the 𝐂𝐏, the reliability increases and the methodology is valid as demonstrated by the experimental phases. 3.1.3. Trajectory typologies: Initial motion plan During the initial motion planning phase, the Trajectory Generator calculates a trajectory between the current position of the tool tip and the target point using 1third order polynomial with certain constraints on its profile, defining different predefined typologies. These restrictions are based on safety and tissue preservation parameters for actions such as those involving direct or indirect interaction with tissues. The hFSM invokes the Trajectory Generator providing position parameters and trajectory typology. The three defined trajectory typologies are: •Linear trajectory: Linear trajectory between the initial and the goal positions. This type of trajectory is usually required in tasks were the tools are in contact with human tissues, like pushing and pulling tissues, performing small movements to grasp or cut objects (like tissues or suture threads). Fig. 4. Illustrative example of the three types of trajectories applied over an organ. Blue: Gradient initial. Red: Linear. Green: Gradient end. (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.) •Gradient end trajectory: Trajectory oriented to reach a goal position over tissues or organs. The final part of the trajectory follows the gradient defined by the normal to the surface where the target is located. •Gradient initial trajectory: Inverse of the Gradient end, this trajectory is applied when the tool tip is over the surface of tissues or organs. Its initial part is defined by the gradient defined by the normal to the surface at the current tool tip position. Once the initial trajectory is determined, the Trajectory Generator computes 𝑛+ 1 equally spaced 𝐂𝐏s. The amount of 𝐂𝐏s is application dependent since it is related to the task dynamics. For the experimental phase presented in this paper, the distance between 𝐂𝐏s is set to 1 cm, which represents a good balance between trajectory control and computational load. Fig. 4 illustrates the three described trajectory typologies. 3.1.4. Force-based adaptive motion plan Autonomous navigation in dynamic workspace requires a continuous update process of the trajectory. The Trajectory Reconfigurator control module updates the 𝐂𝐏s positions at each control cycle by treating them as punctual masses affected by attractive and repulsive forces generated by: (a) the tools with higher priority, (b) the anatomy, (c) the initial 𝐂𝐏s positions, and (d) adjacent 𝐂𝐏s. All the applied forces are defined in their general form as 𝐅=𝑘ℎ  𝐯(1) where 𝑘is the maximum force module applicable, ℎis a continuous function or product of continuous functions that modulates the force with codomain in [0,1]. Each force has a different independent variable (e.g. distance, velocity, etc.).  𝐯is a versor defining the force direction. Finally, it is worth noting that the position of all the elements in the workspace is linearly estimated to relocate the 𝐂𝐏s at the moment the tool reaches them. Consequently, 𝐂𝐏s are affected by different forces that, acting together, allow the tool to reach the destination point with safe motions that avoid damaging tissues and blocking other tools with higher priority in the multi-tool hierarchical workspace configuration. These are the forces we consider in our algorithm: DM repulsive forces. This repulsive force typology is aimed at driving 𝐂𝐏 out of positions that are not reachable by the tool. The force is activated when the 𝐷𝑀 indicates that the associated 𝐂𝐏 is not reachable. The force is applied following the direction between the 𝐂𝐏 and the 𝐑𝐂𝐌. The DM based force is computed as 𝐅DM =𝑘DMℎDM(𝑑) 𝐯DM (2) Robotics and Autonomous Systems 180 (2024 ) 104758 4 N. Sayols et al. where 𝑘𝐷𝑀 is the maximum modulus of this force, 𝑑is the distance between the 𝐂𝐏 and the 𝐑𝐂𝐌, 𝐯DM is the versor from the 𝐂𝐏 to the 𝐑𝐂𝐌, and ℎDM(𝑑) = ⎧ ⎪ ⎨ ⎪ ⎩ 0,if 𝑑≤𝑑𝑚CP 1,if 𝑑≥𝑑𝑚CP +𝑑DM (𝑑−𝑑𝑚CP)∕𝑑DM,otherwise (3) where 𝑑DM is a threshold that defines at which distance the force reaches its maximum, and 𝑑𝑚CP is the value of the DM in the 𝐂𝐏 polar direction. Obstacles repulsive forces. Repulsive forces generated by the different obstacles present in the workspace (other tools and environment) to avoid collisions with anatomy or blocking tools. These forces are computed by 𝐅Obs =𝑘ObsℎObs(𝑑)𝑔Obs( 𝑑) 𝐯Obs (4) where 𝑘Obs is the maximum modulus of this force, 𝑑is the minimum distance between an obstacle and the tool,  𝑑is the derivative of this distance and  𝐯Obs is the minimum distance versor from the obstacle to the tool. The function ℎObs defines the contribution that depends on the distance and is given by ℎObs(𝑑) = {(𝑑Obs −𝑑)∕𝑑Obs,if 0≤𝑑 < 𝑑Obs 0,otherwise (5) where 𝑑Obs is a threshold that defines the maximum distance at which the obstacle applies a force to the tool. The function: 𝑔Obs( 𝑑) = ⎧ ⎪ ⎨ ⎪ ⎩ 1,if − 𝑑≥𝛿 | 𝑑|∕𝛿, if 0≤− 𝑑 < 𝛿 0,if  𝑑 > 0 (6) is the contribution of the derivative of the distance. In this definition 𝛿is a threshold for the maximum derivative. This function implies that the tool receives a force from the obstacle only if the obstacle is approaching the tool. Original trajectory attractive forces. Attractive force to the original position of the 𝐂𝐏s to maintain as much as possible the initial planned trajectory. This force is computed as 𝐅ICP =𝑘ICPℎICP(𝑑) 𝐯ICP (7) where 𝑘ICP is the maximum modulus of this force, 𝑑is the distance between the current position of the 𝐂𝐏 and its original position,  𝐯ICP is the versor defined by these two points, and ℎICP(𝑑) = {𝑑∕𝑑ICP,if 0≤𝑑 < 𝑑ICP 1,otherwise (8) where 𝑑ICP is a threshold that defines the distance at which the force is maximum. Trajectory coherence forces. The contribution of the different forces may generate non smooth trajectories or excessive dehomogenisation of the position of the 𝐂𝐏s along the trajectory. To prevent this undesirable effect, the trajectory coherence force is applied. This force is an attractive force towards the farthest 𝐂𝐏 between the two direct neighbour 𝐂𝐏s. The result is a more cohesive particle behaviour. This force is computed as follows 𝐅Ngh =𝑘NghℎNgh(𝑑𝑖−1, 𝑑𝑖+1) 𝐯Ngh (9) where 𝑘Ngh is the maximum modulus of this force, 𝑑𝑖−1 is the distance to the previous 𝐂𝐏,𝑑𝑖+1 is the distance to the next 𝐂𝐏, 𝐯Ngh is the versor to the farthest of the two 𝐂𝐏s and ℎNgh(𝑑𝑖−1, 𝑑𝑖+1) = {(𝑑𝑖+1 −𝑑𝑖−1)∕2,if 𝑑𝑖+1 ≥𝑑𝑖−1 (𝑑𝑖−1 −𝑑𝑖+1)∕2,otherwise. (10) Fig. 5. 𝐂𝐏s (red spheres) and Neighbourhood Forces (green arrows) guiding the auxiliary tool (blue). Top: Neighbourhood forces are generating attraction forces between 𝐂𝐏s to maintain the trajectory coherence when avoiding collision with the bladder. Bottom: the main tool (human-guided) imposes abrupt collision avoidance. It is observed that the neighbourhood forces, applied to the 𝐂𝐏s immediately after the collision avoidance, exert a strong influence to prevent breaking the trajectory coherence. (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.) Finally, the new position of the 𝑖th 𝐂𝐏 is defined as 𝐂𝐏𝑘+1 𝑖=𝐂𝐏𝑘 𝑖+𝐅𝑘 DM,𝑖 +Π(𝐅𝑘 Obs,𝑖,𝐅𝑘 ICP,𝑖,𝐅𝑘 Ngh,𝑖)(11) where the superindex 𝑘is the control cycle and the function Πis the projection of the sum of forces to the plane perpendicular to the gradient of the current trajectory at each 𝐂𝐏. The attractive force 𝐅𝑘 DM,𝑖 is not restricted to the perpendicular plane, imposed in Π, to ensure that the 𝐂𝐏 reaches a position outside any obstacle. Fig. 5 (top) shows the neighbourhood attractive forces maintaining the coherence of central trajectory 𝐂𝐏s. These 𝐂𝐏s are receiving repulsion forces to move away from the bladder. Fig. 5 (bottom) shows the same forces maintaining coherence when the 𝐂𝐏s are affected by a repulsion force to avoid the main tool (trajectory tightens to avoid collision). Fig. 6 (top) shows the direction of the resultant force that each 𝐂𝐏 receives including the force due to the DMs at the start of a trajectory. Fig. 6 (bottom) shows the forces generated to avoid a collision with the main tool. 3.1.5. Spline trajectory The output of the GMP is a spline-based trajectory to be tracked by the SARAS robot. This trajectory is defined by the required 𝐂𝐏s and the coefficients that determine the spline passing through them. The splines are computed in a 4 dimensional space where the first 3 correspond to the Cartesian coordinates of the tool tip and the fourth one to the rotation around the axis of the tool (𝑥, 𝑦, 𝑧, 𝑧𝑅𝑜𝑡). Let {𝐂𝐏0,𝐂𝐏1,…,𝐂𝐏𝑛}be the control points at the current time 𝑡 and let 𝐬(𝑡)=(𝐩(𝑡), 𝑟(𝑡)) (12) be the interpolation spline, where 𝐩(𝑡)is the interpolation of the spatial coordinates and 𝑟(𝑡)is the interpolation of the rotation angle. The rotation is a linear interpolation between the current rotation 𝑟0and Robotics and Autonomous Systems 180 (2024 ) 104758 5 N. Sayols et al. Fig. 6. 𝐂𝐏s (red spheres) and resultant forces (purple arrows) guiding the auxiliary tool (blue). Top: Resultant forces are generating a repulsion field that pushes the 𝐂𝐏s out of the bladder to ensure a collision free trajectory. Bottom: Resultant forces are generating repulsion field to avoid collision between tools. In this second case, it is also possible to observe neighbourhood forces keeping 𝐂𝐏s coherence. (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.) the goal rotation 𝑟𝑛, i.e., 𝑟(𝑡) = 𝑟0+ (𝑟𝑛−𝑟0)𝑡 𝑡𝑛 , where 𝑡𝑛is the time to reach the last 𝐂𝐏. The spatial interpolation 𝐩(𝑡)is a Catmull-Rom Spline defined as 𝐩(𝑡) = 𝑛 ∑ 𝑖=1 𝐩𝑖(𝑡)𝟏[𝑡𝑖−1,𝑡𝑖](𝑡)(13) where 𝟏[𝑡𝑖−1,𝑡𝑖](𝑡) = {[1,1,1] if 𝑡∈ [𝑡𝑖−1, 𝑡𝑖] [0,0,0] if 𝑡∉ [𝑡𝑖−1, 𝑡𝑖](14) and 𝐩𝑖(𝑡)satisfies the following conditions 𝐩𝑖(𝑡𝑖) = 𝐂𝐏𝑖, for 𝑖= 1 … 𝑛(15) 𝐩𝑖(𝑡𝑖−1) = 𝐂𝐏𝑖−1, for 𝑖= 1 … 𝑛(16)  𝐩𝑖(𝑡𝑖) = 𝜈 𝐯𝐂𝐏𝑖, for 𝑖= 1 … 𝑛− 1 (17)  𝐩𝑖+1(𝑡𝑖) = 𝜈 𝐯𝐂𝐏𝑖, for 𝑖= 1 … 𝑛− 1 (18)  𝐩1(𝑡0) = 𝐠0(19)  𝐩𝑛(𝑡𝑛) = 𝐠𝑛(20) where 𝐠0and 𝐠𝑛are the gradient of the trajectory at the current position of the tool and the desired gradient at the goal point, respectively, 𝜈is a parameter that defines the module of the velocity of the trajectory, and  𝐯𝐂𝐏𝑖is the versor from 𝐂𝐏𝑖−1 to 𝐂𝐏𝑖+1. Each 𝐩𝑖(𝑡)is a third order polynomial that, using the indicator function 𝟏[𝑡𝑖−1,𝑡𝑖](𝑡), generates non zero values in the interval between 𝐂𝐏𝑖−1 and 𝐂𝐏𝑖. The other conditions are simply imposed to get a smooth continuity at the edge of the intervals. Eqs. (15) and (16) forces the trajectory to pass through all the 𝐂𝐏s, while Eqs. (17) and (18) imply that the gradient of the spline is continuous and with a controlled velocity in the 𝐂𝐏s. Moreover, we impose that the gradient at that 𝐂𝐏 is in the direction defined by the previous and next 𝐂𝐏s to ensure that the trajectory is as smooth as possible. Finally, Eqs. (19) and (20) ensure that the trajectory has the desired gradient at the start and end of the trajectory. To guarantee patient safety, the change in the module of the velocity of the robot tooltip is constrained to a maximum acceleration. For that reason, the parameter 𝜈is updated at each control step by increasing or decreasing the velocity to a desired value taking into account this maximum acceleration. In consequence, several control cycles could be required to achieve the desired velocity value while respecting the maximum acceleration. 3.2. Local Motion Planner (LMP) The introduction of a second planning layer, implemented by means of the LMP, aims at reducing the risk of collision while the robot is moving between two consecutive 𝐂𝐏s generated by the GMP. Such a multi-layer approach increases the level of autonomy for the single robot, that has to perform auxiliary tasks interacting with tissues while avoiding collisions with forbidden critical anatomical regions or agents with unpredictable motions, such as main tool teleoperated by the surgeon. The LMP implements the reactive motion planning algorithm formerly adopted in [30] and based on the method described in [18], that involves the modulation of the robot desired velocity such that the resulting commanded motion is collision-free. In the considered scenario, where the robot has to avoid 𝐾moving obstacles, the reference velocity  𝐩𝑟at time 𝑡to be modulated is computed as  𝐩𝑟(𝑡) =  𝐩𝑐(𝑡) −  𝐩𝑜(𝑡)(21) where  𝐩𝑐is the desired velocity of the point of the robot that is closer to the closest obstacle and  𝐩𝑜is the weighted sum of the velocities of the obstacle points that are closest to the robot. More concretely,  𝐩𝑐(𝑡) can be retrieved from the desired robot end-effector velocity  𝐩(i.e. the time derivative of the spline 𝐩generated by the GMP) by means of the following equations, in which the time dependence of the variables is omitted for the sake of clarity ⎧ ⎪ ⎪ ⎨ ⎪ ⎪ ⎩ 𝐦=𝐩−𝐩𝑡  𝐩∥= (  𝐩⋅𝐦)𝐦 ‖𝐦‖  𝐩⟂= 𝐩− 𝐩∥  𝐩𝑐=‖𝐩𝑐−𝐩‖ ‖𝐦‖ 𝐩⟂+ 𝐩∥ (22) where 𝐦is the vector connecting the trocar position 𝐩𝑡to the endeffector position 𝐩, while  𝐩∥and  𝐩⟂are the components of  𝐩that are respectively parallel and perpendicular to 𝐦. Therefore,  𝐩𝑜can be computed as  𝐩𝑜= 𝐾 ∑ 𝑘=1 𝑤𝑘 𝐩𝑜,𝑘 (23) where  𝐩𝑜,𝑘 is the velocity of the point belonging to the 𝑘th obstacle that is currently closer to the robot and the weights 𝑤𝑘are functions of the obstacle geometry as 𝑤𝑘= 𝐾 ∏ 𝑖=1,𝑖≠𝑘 𝛤𝑖− 1 (𝛤𝑘− 1)+(𝛤𝑖− 1)(24) in which 𝛤𝑖is the value assumed in 𝐩𝑐by a smooth function that depends on the analytical expression of the surface of the 𝑖th obstacle. For multi-dimensional ellipsoids, the expression of 𝛤𝑖is described in [18]. In the considered scenario, instead, all the 𝐾obstacles, as well as the robot tool, have been modelled as capsules, i.e. cylinders with hemispheres placed on their bases. In this case, each 𝛤𝑖function takes the form 𝛤𝑖=‖𝑖𝐩𝑎−𝑖𝐩𝑐‖2 𝑖𝑅2(25) where 𝑖𝐩𝑎is the point on the axis of the 𝑖th capsule-shaped obstacle closest to the tool, 𝑖𝐩𝑐is the point of the capsule-shaped tool closest to Robotics and Autonomous Systems 180 (2024 ) 104758 6 N. Sayols et al. the 𝑖th obstacle and 𝑖𝑅is the radius of the 𝑖th capsule. The value of 𝛤𝑖 increases monotonically with the distance between the robot tool and the obstacle, while 𝛤𝑘≤1implies a collision. Then, the algorithm described in [18] can be applied to create a modulation matrix 𝐌that reshapes the direction and the amplitude of the current reference velocity vector to avoid the obstacle. Such a matrix is computed according to the robot and obstacle current poses and to their geometry, by means of the same 𝛤𝑖functions described above. For the detailed expression of 𝐌, the reader is referred to [18]. The modulated velocity of the robot point closest to the obstacles for ensuring collision avoidance becomes  𝐩⋆ 𝑐=𝐌 𝐩𝑟(26) Finally,  𝐩⋆ 𝑐can be transformed back into the end-effector frame, so that the desired motion can be directly commanded to the robot, by inverting expressions (21) and (22). 4. Experimental results This section reviews the results obtained in the experimental phase, which has been designed to test the motion planner and its integration into the cognitive control architecture. The experiments are collected on the SARAS SOLO-SURGERY platform executing different surgical actions of the simplified RARP procedure (sRARP), [31,32]. These actions involve interaction between main tools and organs. The analysis is divided into several experiments covering different illustrative caustics of sRARP and the contribution of each motion planning module. The first one analyses the contribution of the LMP to avoid collisions between the current tool position and the next 𝐂𝐏. Then, an experiment using static environment analyses the contribution of the computed forces based on the DMs. Finally, the last three experiments are performed on a dynamic environment where the main tools are interacting with the workspace. These experiments demonstrate the re-planning capability of the motion planner to avoid collisions with all the workspace elements while reaching the destination point. 4.1. Experimental setup: SARAS SOLO-SURGERY The experiments have been conducted using the SARAS robotic setup in the SOLO-SURGERY platform using the da Vinci system with three teleoperated arms (two surgical instruments and an endoscope) and two SARAS robots (two collaborative 7degrees of freedom Franka Emika robots equipped with motorized standard surgical instruments). The workspace is composed of a reproduction of the anatomical structures with a high realism in terms of geometry, dynamic behaviour and visual properties. Current laparoscopic technology still does not allow the generation of point clouds valid for the purposes of the presented experiments. To solve this issue, a 3D RGB-D vision system, attached to the laparoscope’s stem, is used to generate point clouds. This licence has been allowed as it is an aspect of technological development and is not in the research focus of the paper. The analysis of the motion is shown using the simulation platform to facilitate their understanding, and includes the reproduction of the workspace represented as a point cloud, the representation of the 𝐂𝐏s (red spheres) and the convex hull of the tools involved in each experiment. Fig. 7 shows the experimental setup with all robotic tools interacting with the anatomical phantom. 4.2. Local modulation planner experiment This experiment shows how the LMP dynamically modifies the trajectory between consecutive 𝐂𝐏s to avoid moving obstacles. To highlight the contribution of the LMP the 𝐂𝐏s remain static and its number is reduced to increase the distance between them. The results of the experiment are depicted in the 3D graphs of Fig. 8. The actual trajectory (black line) initially overlaps the GMP Fig. 7. Detail of the experimental setup showing daVinci and SARAS tools interacting inside the anatomical phantom. (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.) planned linear trajectory (red line), then after overstepping the third 𝐂𝐏 deviates from the planned path because of the effects of the velocity modulation generated by the LMP to avoid colliding with the main tool. Finally, once the collision risk disappears, the ongoing trajectory recovers the planned trajectory and the goal pose is reached. 4.3. Static environment experiments This experiment assesses the ability of the motion planner to evade collisions with pseudo-static obstacles (e.g. organs and anatomical structures). The experiments are executed in a static environment to avoid other force contributions of organs and main tools. The human anatomy is represented as a high resolution point cloud obtained from the real phantom. The tool tip describes four linear trajectories between bladder corners (𝑝1, 𝑝2, 𝑝3, 𝑝4, 𝑝5) as shown in Fig. 9 (central). This figure also shows the evolution of the 𝐂𝐏s over the workspace point cloud. The blue straight line shows the initial planned trajectory and the subsequent grey lines show the evolution of the trajectory until it reaches the black line that is the path taken by the robot. This figure shows how the final trajectory is adapted to the organs shape. In these four examples, the principal reason of the movement of the 𝐂𝐏 is that some of them are inside the bladder at the initial trajectory and, in consequence, they change their positions in accordance with the depth maps until these points are outside the bladder. Meanwhile, all the other points that are not inside the bladder receive the neighbourhood force to maintain the coherence of the trajectory. At the end, all the 𝐂𝐏s maintain their position by the balance of the repulsive force received from the obstacle, and the attractive force towards the initial trajectory. Fig. 10 shows the evolution of the neighbour forces applied to 𝐂𝐏3..6 during the initial part of 𝑝1→𝑝2trajectory. 𝐂𝐏6starts inside the bladder and, therefore, it receives an attractive force towards the RCM. In consequence, to maintain the coherence of the trajectory all the near points start receiving neighbourhood forces. 𝐂𝐏5receives bigger forces than 𝐂𝐏3and 𝐂𝐏4because is the first point outside the bladder. 𝐂𝐏6receives the neighbourhood force since 𝐂𝐏7is deeper inside the bladder. 4.4. Dynamic environment experiments The dynamic environment experiments are designed to test the capability of the motion planner to execute trajectories avoiding collisions with both patients anatomy and human-guided surgical instruments. The convex hull of the instrument shaft and tip are used to increase the safety margin and to generate smooth repulsion forces. The main tools are teleoperated by humans and emulate the movements required Robotics and Autonomous Systems 180 (2024 ) 104758 7 N. Sayols et al. Fig. 8. Example of LMP contribution to avoid dynamic obstacles. Two trajectories, with fixed 𝐂𝐏s, illustrate the collision avoidance strategy. In red, the initial planned trajectory and, in black, the path described by the robot. (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.) Fig. 9. Example of 4trajectories (lateral images) to illustrate the capability of GMP to avoid anatomical structures. The central image shows the trajectories in the workspace. In blue, initial linear trajectories; in black, trajectory described by the SARAS robot; dotted lines show the evolution of the 𝐂𝐏s. (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.) Fig. 10. Example of neighbour forces applied to different 𝐂𝐏s at the start of the 𝑝1→𝑝2 trajectory. to reach and interact with the bladder. Three examples of SARAS tool trajectories are studied: Figs. 11,12 and 13. These figures show the evolution of the 𝐂𝐏s jointly with a snapshot of the simulator showing the position of the main and SARAS tools as well as the 𝐂𝐏s. It is necessary to point out that these experiments omit the initial 𝐂𝐏s movements (from initial linear trajectory to their position avoiding collision with the organs). 4.4.1. Dynamic environment experiment 1 This experiment shows the evolution of the SARAS tool trajectory over the bladder to reach the prostatic region. The trajectory should avoid contact with organs as well as collision with the main tool. Fig. 11.a shows the initial 𝐂𝐏s configuration avoiding the bladder. It also reflects the initial effect of the main tool intersecting with the trajectory described by the 𝐂𝐏s. Fig. 11.b shows how the new trajectory smoothly avoids colliding with the main tool. All the 𝐂𝐏s still not reached have changed their positions. The SARAS tool avoids the main tool describing a trajectory in which the 𝐂𝐏s move upward to leave the tool underneath. Fig. 11.c shows how the 𝐂𝐏s recover their initial position (bladder collision avoidance) once the main tool does not represent an obstacle. Fig. 11.d shows the last part of the trajectory. As the main tool approximates again the 𝐂𝐏s, a new repulsion force appears. The SARAS tool reaches the destination point and, consequently, these forces do not significantly deform the trajectory. 4.4.2. Dynamic environment experiment 2 This experiment shows the evolution of the SARAS tool trajectory over the bladder from the prostatic region to the upper part of the bladder. The trajectory should avoid contact with organs as well as collision with the main tool. Fig. 12.a shows the 𝐂𝐏s configuration (blue line) that avoids the bladder. When the main tool approaches the bladder, the shaft blocks the planned trajectory. Repulsion forces modify the affected 𝐂𝐏s, avoiding a potential collision. Fig. 12.b shows (in black) the trajectory followed by the SARAS tool to avoid a collision. Fig. 12.c shows the final part of the SARAS trajectory avoiding collision with the remotely controlled tool. Lateral movements of the remotely controlled tool generate new repulsion forces to avoid potential collisions (Light blue dots show the evolution of the most affected 𝐂𝐏). Fig. 12.d illustrates the trajectory followed by the SARAS tool tip. The effects of the automatic collision avoidance are reflected as two trajectory peaks (middle part of the trajectory) generated by repulsion forces. The combined contribution of repulsion and attraction forces have contributed to ensure that the described collision free trajectory follows, as much as possible, the initially planned trajectory. 4.4.3. Dynamic environment experiment 3 This experiment shows the evolution of the SARAS tool trajectory over the bladder from its upper part to the prostatic region. The Robotics and Autonomous Systems 180 (2024 ) 104758 8 N. Sayols et al. Fig. 11. Dynamic environment experiment 1: Evolution of 𝐂𝐏s during a trajectory over bladder surface where the SARAS tool avoids collisions with anatomy and the daVinci tool. Top row shows the evolution of the trajectory described by the SARAS tool. Bottom row shows different snapshots of the workspace (SARAS tool in blue, daVinci tool in grey and 𝐂𝐏s represented as red spheres). (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.) Fig. 12. Dynamic environment experiment 2: Evolution of 𝐂𝐏s during a trajectory over bladder surface where the SARAS tool avoids collisions with anatomy and the daVinci tool. Top row shows the evolution of the trajectory described by the SARAS tool. Bottom row shows different snapshots of the workspace (SARAS tool in blue, daVinci tool in grey and 𝐂𝐏s represented as red spheres). (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.) trajectory should avoid contact with organs as well as the two main tools, represented in light grey (lMT) and dark grey (dMT). Fig. 13.a shows the 𝐂𝐏s configuration (blue line) that avoids the bladder. When dMT approaches the bladder, its shaft blocks the trajectory. Repulsion forces modify the 𝐂𝐏s, avoiding a potential collision. The lMT does not represent a collision risk to the trajectory and, in consequence, the last 𝐂𝐏s do not change their position. In Fig. 13.b, the dMT changes its position and does not represents an obstacle. In consequence, the 𝐂𝐏s are recovering their initial configuration. The lMT is under the 𝐂𝐏s following a linear movement over its main axis not interfering with the main tools (lMT is not generating repulsion forces). In Fig. 13.c, dMT is over the bladder surface but does not represent a collision risk (SARAS tool has already passed the region occupied by the main tool). Instead, the lMT is moving towards the SARAS trajectory. In consequence, the affected 𝐂𝐏s receive repulsion forces to avoid a collision. Fig. 13.d shows the final trajectory described by the SARAS tool tip. The lMT has been removed from the potential collision area and therefore does no longer poses a risk. The last 𝐂𝐏s recover their positions. 4.4.4. Force analysis in a dynamic environment The last experiment focusses on the contribution of the forces applied to the 𝐂𝐏s in a dynamic environment. The trajectory of the first dynamic experiment in Fig. 11 is used for this purpose. The described trajectory can be divided into four phases: Initial Anatomy Avoidance (IAA) and three Main Tool Avoidance (MTA). Fig. 14 shows the module of the force applied to different 𝐂𝐏s (𝐂𝐏5,𝐂𝐏11,𝐂𝐏16,𝐂𝐏18) along the studied trajectory. During MTAs phases, the main tool approximates and blocks the SARAS tool trajectory, and then, generates movements along the 𝐂𝐏s and, finally, moves away from 𝐂𝐏s positions. During IAA phase, it is necessary to generate repulsive forces to 𝐂𝐏11 and 𝐂𝐏16, which are inside the bladder. Attractive neighbourhood forces are applied to 𝐂𝐏5and 𝐂𝐏18 to maintain trajectory coherence. In MTA 1, repulsion forces are applied to, first, 𝐂𝐏16 (main tool approximation) and then, to 𝐂𝐏11 (lateral movement). The movement of 𝐂𝐏16 obliges to generate forces over 𝐂𝐏18 to maintain trajectory coherence. When 𝐂𝐏5is reached, no more forces are applied to it. The same situation, but with inverse order on the affected 𝐂𝐏, occurs in MTA 2. Finally, in MTA 3, repulsion forces are applied to 𝐂𝐏16 and 𝐂𝐏18.𝐂𝐏11 is already reached and, consequently, it is not affected by forces. 5. Conclusions This paper describes and evaluates a dynamic motion planner specially designed for robotic assisted minimally invasive surgery. The motion planner is integrated into the SARAS cognitive control architecture. The SARAS platform was developed to provide the main surgeon with a dual robot system to assist in auxiliary surgical tasks with a high degree of autonomy. The motion planner complies with the requirements imposed by the task to be performed and the working environment: high degree of autonomy, smooth trajectories that preserve the patient’s safety and avoid collisions with other tools in a dynamic and deformable environment. The motion planner consists of a two-layer architecture: Robotics and Autonomous Systems 180 (2024 ) 104758 9