<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Reactive Temporal Logic-based Planning and Control for Interactive Robotic Tasks</title></titleStmt>
			<publicationStmt>
				<publisher>IEEE</publisher>
				<date>10/14/2024</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10569846</idno>
					<idno type="doi">10.1109/IROS58592.2024.10802335</idno>
					
					<author>Farhad Nawaz</author><author>Shaoting Peng</author><author>Lars Lindemann</author><author>Nadia Figueroa</author><author>Nikolai Matni</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[Robots interacting with humans must be safe, reactive and adapt online to unforeseen environmental and task changes. Achieving these requirements concurrently is a challenge as interactive planners lack formal safety guarantees, while safe motion planners lack flexibility to adapt. To tackle this, we propose a modular control architecture that generates both safe and reactive motion plans for human-robot interaction by integrating temporal logic-based discrete task level plans with continuous Dynamical System (DS)-based motion plans. We formulate a reactive temporal logic formula that enables users to define task specifications through structured language, and propose a planning algorithm at the task level that generates a sequence of desired robot behaviors while being adaptive to environmental changes. At the motion level, we incorporate control Lyapunov functions and control barrier functions to compute stable and safe continuous motion plans for two types of robot behaviors: (i) complex, possibly periodic motions given by autonomous DS and (ii) time-critical tasks specified by Signal Temporal Logic (STL). Our methodology is demonstrated on the Franka robot arm performing wiping tasks on a whiteboard and a mannequin that is compliant to human interactions and adaptive to environmental changes.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>I. INTRODUCTION</head><p>There is a growing presence of robot assistants in households, workplaces, and industrial plants. In such applications, robots should adapt to environmental changes and safely interact with humans while performing a diverse range of tasks that conform to sequential and time-critical behaviors. Existing end-to-end frameworks <ref type="bibr">[1]</ref>- <ref type="bibr">[3]</ref> have demonstrated robots performing diverse tasks, while model-based methods <ref type="bibr">[4]</ref>, <ref type="bibr">[5]</ref> focus on predefined motions that are stable and safe. However, they do not address the following challenges jointly: (i) formal guarantees on safety and satisfying task specifications, and (ii) reactivity to online environmental events and unforeseen disturbances -which are critical for deploying robots in human-centric environments.</p><p>Consider the scenario in Fig. <ref type="figure">1</ref>, where the robot is wiping a whiteboard. We want the robot to switch between periodic wiping motions on the left and right side of the board as commanded by the user. If the camera detects a blue stain, then the robot should wipe that off quickly. If there is an external perturbation where the robot drops the eraser, then it should pick it up and continue the wiping motion. This involves switching between different motions (left and right wiping), reacting to environmental events (stain), time-critical tasks (wiping stain), and human interactions (eraser dropped).</p><p>The key challenge for robots in such interactive scenarios is maintaining safety and compliance while reacting to online environmental events and switching between tasks. To alleviate this, we develop a computationally efficient online planning strategy that generates safe and reactive motions for human-robot interaction, by integrating a 200 Hz discrete planner based on temporal logic and a 1 KHz continuous Dynamical System (DS)-based planner.</p><p>Task specifications: At the task level, one way to describe desired robot behaviors is via temporal logic specifications <ref type="bibr">[6]</ref>, previously used in a variety of tasks such as cooking <ref type="bibr">[7]</ref>, mobile manipulation <ref type="bibr">[8]</ref>, search and rescue missions <ref type="bibr">[9]</ref>. Such specifications allow robots to understand and interpret commands involving temporal relationships using structured language. For example, a high-level specification for the scenario in Fig. <ref type="figure">1</ref> can be given as (left &#8594; wipe left) and (right &#8594; wipe right) and</p><p>(blue stain &#8594; wipe stain in 5 seconds) and</p><p>(no eraser &#8594; pick up eraser) .</p><p>Specifications like <ref type="bibr">(1)</ref> are typically satisfied by integrating high-level discrete actions and low-level continuous motions via formal methods for control <ref type="bibr">[10]</ref>- <ref type="bibr">[12]</ref>. Such methods compute a control signal for predefined scenarios but lack reactivity to online events and disturbances. Here, we focus on reactive planning, i.e., the robot should adapt its behaviors depending on the changing environmental observations online. Prior work using Signal Temporal Logic (STL) <ref type="bibr">[13]</ref> relies on computationally intensive mixed-integer linear programs <ref type="bibr">[14]</ref>, <ref type="bibr">[15]</ref> for online adaptation, while methods based on Linear Temporal Logic (LTL) <ref type="bibr">[9]</ref>, <ref type="bibr">[16]</ref>- <ref type="bibr">[18]</ref> require computationally taxing planners on discrete transition systems.</p><p>To tackle such computational burdens and inflexibility, we instead translate STL specifications into constraints on the continuous motion level enforced via efficient Quadratic Programs (QPs) for real-time planning as in <ref type="bibr">[19]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Discrete task plan:</head><p>We adapt ideas from <ref type="bibr">[20]</ref>, and formally define controllable and uncontrollable propositions in Section III-A to integrate high level reactive temporal logic specifications with continuous low level motions. Intuitively, controllable propositions, highlighted in blue in <ref type="bibr">(1)</ref>, represent robot behaviors that can always be controlled by appropriate choice of motion planners. Uncontrollable propositions, highlighted in red in <ref type="bibr">(1)</ref>, are discrete environmental events that cannot always be controlled by the robot. We define a reactive temporal logic formula in Section III-B that builds upon controllable and uncontrollable propositions. We then construct a B&#252;chi automaton <ref type="bibr">[21]</ref> using existing tools <ref type="bibr">[22]</ref>  and employ it within a discrete task planner that decides the sequence of desired behaviors the robot should follow to always satisfy the task specification, despite environmental changes such as the blue stain and perturbation in Fig <ref type="figure">1</ref>.</p><p>Continuous motion plan: We integrate our discrete task planner with a continuous DS-based motion planner that executes each desired robot behavior. While our method is agnostic to the underlying DS motion policy, we focus on two types that encapsulate diverse tasks: (i) nominal motions given by an autonomous DS, and (ii) time-critical tasks specified by STL. Nominal motions could either be provided as a library of autonomous DS, or learned from demonstrations <ref type="bibr">[7]</ref>, <ref type="bibr">[23]</ref>. We utilize our prior work <ref type="bibr">[24]</ref> that uses Neural ODEs and tools from Lyapunov theory to learn nominal (possibly periodic) motions from only 3-4 demonstrations while also guaranteeing safety and stability. We model time-critical tasks as STL specifications and timevarying Control Barrier Functions (CBFs) <ref type="bibr">[19]</ref>. Since our prior work <ref type="bibr">[24]</ref> also uses CBFs for safety and Control Lyapunov Functions (CLFs) for stability, we endow robots the capability to follow both time-critical behaviors and complex nominal motions in a single framework by solving an efficient QP online. Thus enabling the robot to react to environmental events and follow the desired behavior, guaranteeing task satisfaction even in the face of disturbances.</p><p>Contributions: First, we adapt the notion of controllable propositions from <ref type="bibr">[20]</ref> to model more general continuous time robot behaviors such as nominal DS-based motions and time-critical STL tasks. We use such propositions as the basic building blocks of a reactive temporal logic formula to represent task specifications in structured language. Second, we propose a discrete task planning algorithm running online at 200 Hz that decides the sequence of robot behaviors to execute to satisfy the task specification despite environmental changes online. Third, we integrate our task planner with a continuous DS-based motion planner that uses CLFs and CBFs to follow nominal motion plans and satisfy timecritical STL tasks in the presence of unforeseen disturbances, by solving a QP online at 1 KHz. Finally, we validate our approach on the Franka robot arm that performs reactive wiping tasks on a whiteboard and human mannequin using environmental observations from a RealSense camera, while also being compliant to human interactions.</p><p>II. PRELIMINARIES We introduce the background to define our reactive temporal logic specification, and tools from control theory to satisfy time-critical tasks and guarantee disturbance rejection. Let x &#8593; X &#8595; R d and u &#8593; U &#8595; R m be the state and control input for the nonlinear control affine dynamical system</p><p>where, f : R d &#8594; R d and g : R d &#8594; R d&#8594;m .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Linear Temporal Logic and B&#252;chi Automaton</head><p>We use LTL to specify in structured language the desired reaction of the robot to discrete environmental events. Consider a finite set of atomic propositions AP , where each p &#8593; AP can either be true or false. An LTL formula &#969; is constructed using the following syntax.</p><p>&#969;</p><p>The symbol ::= means that &#969; in (3) is assigned to be one of the expressions from the right hand side separated by vertical bars |. The different symbols mean the following:</p><p>&#172; is negation, &#8596; is conjunction and U is the until operator that expresses that &#969; 1 should be true until &#969; 2 becomes true, where &#969; 1 , &#969; 2 are well-defined LTL formulas. The set of discrete environmental observations and robot behaviors that dictate the LTL formula &#969; is given by AP . The specification &#969; is a combination of Boolean and temporal operations between the elements of AP . For example, consider a task where the robot should add oil to a pan once the pan is hot. The set AP = {hot, oil} which corresponds to whether the pan is hot (hot = 1) and oil is poured on the pan (oil = 1). The LTL formula is &#969; := G (hot &#8599; F oil), where G denote always and F denote eventually <ref type="bibr">[11]</ref>.</p><p>An input signal is defined as &#949; : Z + &#8594; {0, 1} |AP | , which is a discrete time signal that represents the boolean values of the propositions AP . We are interested in signals that satisfy a task specification &#969;. The symbol (&#949;, k) &#8621; &#969; indicates that the signal &#949; satisfies a formula &#969; at time step k. We refer the reader to <ref type="bibr">[19]</ref> for details on LTL semantics. B &#252;chi automaton: A B&#252;chi automaton <ref type="bibr">[12]</ref> is a tool that gives a formal way of deciding whether signals satisfy LTL specifications. Given &#969;, we can construct a nondeterministic B&#252;chi automaton B &#969; = (S, s 0 , AP, !, F), where S is a finite set of states, s 0 &#8593; S is the initial state, AP is the finite set of atomic propositions, ! &#8600; S &#8771;{0, 1} |AP | &#8594; S is a transition relation such that (s &#8593; , d, s &#8593;&#8593; ) &#8593; ! indicates a transition from s &#8593; to s &#8593;&#8593; when the input label is d &#8593; {0, 1} |AP | , and F &#8600; S is a set of accepting states. Given an input signal &#949; :</p><p>, a run of the B&#252;chi automaton B &#969; is an infinite state sequence s := {s 0 , s 1 , s 2 , . . .} that satisfies the transition relation (s i , &#949;(i), s i+1 ) &#8593; ! for each i &#8593; Z + . An accepting run on B &#969; is a sequence s for which inf(s)&#8656;F &#8658; = &#8657;, where inf(s) is the set of states that appear infinitely often in s. If the sequence s is an accepting run on B &#969; , then the input signal &#949; satisfies &#969; <ref type="bibr">[12]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Signal Temporal Logic and Control Barrier Functions</head><p>We use STL to specify time-critical tasks, time-varying CBFs to satisfy STL tasks and CLFs to enforce stability.</p><p>Instead of atomic propositions in LTL, predicates &#181; describe truth values in STL using a predicate function h(x) : &#181; = true &#8659; h(x) &#8660; 0 and &#181; = false otherwise, where x &#8593; R d is the robot state. The syntax and semantics of STL closely resemble those of LTL, but can encode explicit quantitative time constraints. We direct the reader to <ref type="bibr">[19]</ref> for details on STL syntax and semantics.</p><p>Control Barrier Functions: We use time-varying CBFs <ref type="bibr">[19]</ref> to satisfy STL specifications. Satisfying a timecritical task specification is defined as the forward invariance of time-varying safety set C(t) &#8600; X &#8598; t &#8660; 0 for the system (2). The set C(t) is defined as the super-level set of a continuously differentiable function</p><p>Our objective is to find a control input u such that the states x that evolve according to the dynamics (2) always stay inside the set C(t). Such an objective is formalized using forward invariance of the set C(t). The safe set C(t) is forward invariant for a given control law u if for every initial point x(0) &#8593; C(0), the future states</p><p>The set of all control inputs that satisfy the condition in (4) for each</p><p>The formal result on forward invariance using timevarying CBFs follows from <ref type="bibr">[19]</ref>.</p><p>Theorem 1: Let u(x, t) &#8593; K(x, t) be a feedback control law that is Lipschitz in x and piecewise continuous in t. Then, the set C(t) is forward invariant for the control law u(x, t) if B(x, t) is a time-varying control barrier function.</p><p>STL specifications can be enforced via time-varying CBFs following the construction from <ref type="bibr">[19]</ref>. For example, consider the STL formula &#1009; ::= F [0,5] &#8733;x &#8601; x &#8771; &#8733; &#8242; &#962; which specifies that eventually (F ), the robot x should be &#962;-close to a target point x &#8771; within the time interval [0, 5]. Similar to <ref type="bibr">[19]</ref>, we can define a CBF B(x, t) = &#977;(t) &#8601; &#8733;x(t) &#8601; x &#8771; &#8733;, where &#977;(t) defines the rate at which the robot reaches x &#8771; such that &#977;(5) = &#962;, &#977;(0) &#8660; &#8733;x(0) &#8601; x &#8771; &#8733;. We use time-independent CBFs and CLFs to guarantee safety and stability of nominal motion plans given by autonomous DS models, which is detailed in prior work <ref type="bibr">[24]</ref>, <ref type="bibr">[25]</ref>. The difference between a time-independent CBF defined in <ref type="bibr">[25]</ref> and the time-varying CBF is the presence of the term &#949;B(x,t) &#949;t in (4), which makes constraint satisfaction more difficult if &#949;B(x,t) &#949;t</p><p>and the time-independent safe set C = {0}, where Theorem 1 guarantees asymptotic stability: see <ref type="bibr">[25]</ref> for more details.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>III. PROBLEM FORMULATION</head><p>We first define a reactive temporal logic formula to describe the task specification using structured language, and formally write the problem statement.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Controllable Propositions</head><p>We introduce a general notion of controllable propositions that is adapted from <ref type="bibr">[20]</ref> to model discrete events in our task specification that depend only on the state signal x(t). Prior work <ref type="bibr">[20]</ref> model only STL tasks, but we also focus on autonomous DS-based motions and describe how observations from the continuous time state signal x translate to a discrete time signal &#949; of LTL in Section II-A.</p><p>We define a generalized version of the predicates &#181; described in II-B as controllable propositions.</p><p>Definition 1: The truth value of a controllable proposition p c (t) at time t is defined below using a tuple (L, M, Q), where L :</p><p>Intuitively, the operator L describes the current behavior of the robot relevant to p c (t) at time t, M describes the desired behavior relevant to p c (t), and Q is the space of signals that is applicable for the controllable proposition p c . For the example in Fig. <ref type="figure">1</ref>, we represent all motions in 3D (d = 3) and wiping motions as autonomous DS &#7819;(t) = f (x(t)) so that q = d, L(x, t) = &#7819; for all t &#8660; 0 and M(x, t) = {y | y : R &#8595;0 &#8594; R 3 s.t. y(t) = f (x(t))}.</p><p>We can model STL tasks using controllable propositions. First, for the predicates &#181; defined in Section II-B,</p><p>We denote the propositions p c in Definition 1 as controllable because their truth value entirely depends on the state signal x which can be controlled by u in (2), but we do not state any formal equivalence to controllability <ref type="bibr">[26]</ref>. While the notion of controllable propositions is in general abstract, we focus on nominal DS-based motions and STL tasks.</p><p>Continuous to discrete time: We consider a finite set of controllable propositions A c , where each p c (t) &#8593; A c can either be true or false as defined by ( <ref type="formula">5</ref>). An LTL formula can be defined with appropriate syntax and semantics as given in Section II-A with AP = A c . However, the signal &#949; in Section II-A that dictate the boolean values of AP is a discrete time signal, but controllable propositions depend on the continuous time state signal x. In practice, we fully observe the state x(t) at each continuous time t &#8660; 0, but update the boolean values of the controllable propositions only at discrete times t k , where k &#8593; Z + . We connect the different time scales by denoting {t 0 , t 1 , . . . , } to be a possibly irregular sampling of the continuous time interval [0, &#8715;) with t 0 = 0, where each t k corresponds to the discrete time step k. We define a controllable signal &#949; c : Z + &#8594; {0, 1} |Ac| such that for all k &#8593; Z + , &#949; c (k) depends on the state signal x at time t k . Now we can use a B&#252;chi automaton as described in II-A for any signal &#949; c : Z + &#8594; {0, 1} |Ac| to verify satisfiability of LTL formulae over A c .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Reactive temporal logic</head><p>We define the syntax of a Reactive Temporal Logic (RTL) formula that the robot should satisfy, using LTL formulae over controllable and uncontrollable propositions. Such a formula describes how the robot should react to environmental events by following different desired behaviors. In addition to A c described in III-A, we define uncontrollable propositions A u that represent discrete environmental observations which cannot always be controlled by the robot, such as left, right, blue stain, no eraser described in Section I. The truth values of A u are determined by both the state signal x and an observed uncontrollable signal &#949; u :</p><p>where, &#966; is an LTL formula defined in (3) with AP = A c , &#969; is an LTL formula with AP = A u , and G indicates the always operator <ref type="bibr">[11]</ref>. Our work always focus on reacting to environmental observations represented by A u by following a desired behavior dictated by A c . The semantics of " follow that of LTL in Section II-A with AP = A c &#9651; A u and A c &#8656; A u = &#8657;. We can construct B&#252;chi Automaton B ! to verify if an input signal &#949; :</p><p>indicates that the controllable signal &#949; c and uncontrollable signal &#949; u satisfies a formula " at time step k &#8593; Z + . For example, consider a simple reactive cooking task where the robot should keep stirring a pan if it is hot. Otherwise, the robot should increase the temperature of the stove by pressing a button. The RTL specification would be " := G(hot &#8599; stir) &#8596; G(&#172;hot &#8599; F (press button)), where</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Task and Motion Plan</head><p>Given a set of nominal autonomous DS and an RTL specification ", we aim to develop a reactive planning strategy to satisfy " while being adaptive to environmental events and stable with respect to disturbances. We use a DSbased motion plan for a robotic manipulator defined as &#7819; = fn(t) (x) + u(x, t),</p><p>where, fn(t) (x) encodes a nominal motion n(t) &#8593; {1, 2, . . . , N} at time t, while u(x, t) is an auxiliary control signal used to satisfy the task specification and enforce disturbance rejection properties. We assume that the N autonomous dynamical systems D = { fi } N i=1 that govern the nominal motions are given to us; these may, for example, be learned from demonstrations <ref type="bibr">[24]</ref>. We choose u(x, t) and n(t) for the robot to follow at each time step based on the discrete controllable signal &#949; c that satisfy ", which further depends on the uncontrollable signal &#949; u . We model the controllable signal as following low level continuous motions and assume that the robot can follow at-most one motion at a given time, since we allow switching online between different motions.</p><p>We are given an RTL specification " and a set of nominal autonomous dynamical systems D specifying a DS-based family of motion plans <ref type="bibr">(7)</ref>. Our task is formalized in the following problem statement: Develop a reactive control strategy such that at each discrete time t k , and for any uncontrollable signal &#949; u the solution x(t) to <ref type="bibr">(7)</ref> </p><p>The above problem statement requires the robot to react online to uncontrollable environmental changes given by &#949; u while also adapt to unforeseen external disturbances via the auxiliary input u(x, t).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>IV. PROPOSED METHODOLOGY</head><p>We present our modular control architecture that integrates a discrete task planner to satisfy the specification " and a continuous DS-based motion planner to reject external disturbances while adapting to dynamic environmental changes. Unlike prior approaches <ref type="bibr">[3]</ref>- <ref type="bibr">[5]</ref> that do not jointly show reactivity to online environmental events and stable task execution, we propose a single framework that demonstrates reactive robot tasks with formal stability guarantees for physical robot interaction. We will use CLFs and CBFs described in Section II-B for our parameterization <ref type="bibr">(7)</ref>, which is a control-affine dynamical system (2) for the time period when n(t) is constant with f (x) := fn(t) (x) and g(x) := I.</p><p>A schematic of the proposed control flow is presented in Fig. <ref type="figure">2</ref>. The blue blocks represent the offline components and the green blocks are the online planning modules. The autonomous DS models fi (x) could either be given by a library of motion primitives <ref type="bibr">[27]</ref>, or can be learned from demonstrations <ref type="bibr">[23]</ref>, <ref type="bibr">[24]</ref>. The user specifies a reactive temporal specification " that the robot should satisfy and we construct the corresponding B&#252;chi automaton B ! using automated tools <ref type="bibr">[22]</ref>. At deployment, given an observation of the external environmental events, our task planner decides the type of robot behavior p m &#8593; A c to follow at each time step using B ! so that " is satisfied. The details of the task planner on how to decide p m are given in Section IV-A. Then, the motion planner computes the reference velocity &#7819;ref to follow p m based on (7) using the virtual control input u(x, t), which enforces disturbance rejection properties and satisfies STL specifications included in ". We denote the reference velocity for the low level controller as &#7819;ref , which in general may be different from the real velocity &#7819; of the robot. The reference velocity &#7819;ref is given as input to an impedance controller <ref type="bibr">[28]</ref> that computes the low level control input &#8636; (joint torques) for the physical robotic system. We emphasize that the virtual control input u(x, t) is different from the low-level control inputs &#8636; given in Fig. <ref type="figure">2</ref>, and <ref type="figure">u(x</ref>, <ref type="figure">t</ref>) is a component of the motion planning DS <ref type="bibr">(7)</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Task Planner</head><p>We propose Algorithm 1 that outputs the behavior p m the robot should follow at each time step to satisfy ", even when the environmental events are dynamically changing.</p><p>Description of Algorithm 1: Given a task specification ", we construct the B&#252;chi automaton B ! = (S, s 0 , AP, !, F) using Spot 2.0 <ref type="bibr">[22]</ref>. We denote s and s &#8593; to be the current and previous state of the automaton, respectively, and k is the current discrete time step. Lines 2-15 are implemented online at 200 Hz in the task planner block of Fig. <ref type="figure">2</ref>. In line 6, we form a directed graph G(S, E) from B ! , which is implemented only at k = 0 or if there is a change in the values of the uncontrollable propositions &#949; u (k). The nodes of G is S, while the edges E reflect valid transitions on the automaton that comply with the current value of uncontrollable propositions &#949; u (k), i.e., for all s 1 , s 2 &#8593; S, (s 1 , s 2 ) &#8593; E if and only if there exists a p &#8593; {0, 1} |Ac| such Algorithm 1: Task Planner that (s 1 , [p, &#949; u (k)], s 2 ) &#8593; !. In line 6, we plan a shortest path on G(S, E) using breadth-first search <ref type="bibr">[29]</ref> that reaches an accepting state in F and stays there infinitely often. Such a path always satisfies " as described in Section II-A. If there is no change in the values of uncontrollable propositions, we implement lines 9-11 so that the robot moves along the path, where index j represents the progress along the path to satisfy ". Finally, in line 13, we decide the type of motion plan p m to be implemented.</p><p>Decide motion plan p m : Let the shortest path obtained in line 6 be w = {s 0 , s 1 , s 2 , . . .}, where s 0 = s, (s j , [p j c , &#949; u (k)], s j+1 ) &#8593; ! for all j &#8593; Z + , and p j c &#8593; {0, 1} |Ac| is the value of controllable propositions when transitioning from s j to s j+1 . Although there could be multiple such p j c , we observed from our experience that the transitions on the shortest path will have exactly one p j c for each unique &#949; u (k). In line 13, we denote p c (k) &#8593; A c to be the controllable proposition that is true in p j c , where p j c is the label of the transition along the path that satisfies ". We thus choose the type of motion plan p m to be the current controllable proposition p c (k) that has to be true to move along the shortest path. For example, the automaton B ! is given in Fig. <ref type="figure">3</ref> for the specification " := G(h &#8599; s) &#8596; G(&#172;h &#8599; F (p)) described in Section III-B, where h := hot, s := stir, p := press button. If the initialization is such that s 0 = 0; h = 1, s = 1, p = 0, then the shortest path is just the self-transition 0 &#8594; 0. Then, from the label of the transition 0 &#8594; 0 and &#949; u (k) = {h, &#172;p}, the motion plan to be implemented is p m = s so that the robot follows the behavior stir. If h = 0 while the robot is stirring (s = 1), then the system transitions to state 1. Now, the shortest path is computed again and the path is 1 &#8594; 0 &#8594; 0. From the label of the transitions 1 &#8594; 0 &#8594; 0 and h = 0, the motion plan to be implemented is p m = p so that the robot follows the behavior press button. In the next section, we describe how the desired behavior p m is achieved by implementing a DS-based motion plan.</p><p>Remark: In this work, we assume that for each uncontrollable signal &#949; u , there exists a possibly different controllable signal &#949; c that satisfies the given RTL specification ". Furthermore, we assume that at each discrete time step k, if</p><p>This assumption asserts the existence of a possibly different controllable signal that satisfies ", even if the uncontrollable propositions change online. Without this assumption, there might not exist a controllable signal that satisfies " if the environmental observations represented as uncontrollable propositions change at task execution. Such scenarios are known as deadlock modes <ref type="bibr">[30]</ref>, where a supervisory signal <ref type="bibr">[31]</ref> is required to recover the system, which we reserve for future work.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Motion Planner</head><p>Given the output p m of the discrete task planner at each time step k, we solve a QP online at 1 KHz that (i) guarantees satisfaction of STL specifications, and (ii) enforces safety and stability properties while following nominal motions given by autonomous DS. We also propose a simple yet efficient switching strategy so that robots switch between different behaviors when reacting to environmental observations, unlike previous approaches <ref type="bibr">[14]</ref>, <ref type="bibr">[15]</ref> that solve expensive optimization problems to re-plan.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>1) Nominal motion plans:</head><p>We compute safe and stable motions that converge to a nominal target trajectory which is generated from an autonomous dynamical system. Although one could assume that the set of nominal dynamical systems D are given to the user from an existing library of motion primitives <ref type="bibr">[27]</ref>, we use the CLF-CBF-NODE from our prior work <ref type="bibr">[24]</ref> that learns from demonstrations DS models fi for each behavior i &#8593; {1, 2, . . . , N} that includes complex, possibly periodic motions. For example, the stir behavior mentioned in the previous section can be represented by a periodic trajectory x &#8771; 1 (t) using a DS model &#7819; = f1 (x) that is learned from demonstrations.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>CLF-CBF-QP:</head><p>We abuse notation and use x &#8771; (t) and f (t) to denote the target trajectory and the autonomous DS for a single nominal motion, but the method is the same for any other nominal motion. Let the error be e(t) = x(t) &#8601; x &#8771; (t), and for ease of notation, we drop the explicit dependence on time t, and write e, x, and x &#8771; for the current error, state, and target point at time t, respectively. The control-affine error dynamics is &#279; = f (x) &#8601; &#7819;&#8771; + u(x) from <ref type="bibr">(7)</ref>. The explicit dependence of u(x) and f (x) on time is removed since we focus only on time-independent CBFs to model safety sets, and CLFs for the time period when n(t) is constant. In the next section, we describe how we switch between different behaviors. Then, by Theorem 1, if there exists a CLF V for the dynamics &#279;, then, any feedback control law u(x) &#8593; K(x) will drive the error asymptotically to zero. Similarly, if there exists a time-independent CBF B corresponding to a safety set C &#8600; X for the dynamics <ref type="bibr">(7)</ref>, then, any feedback control law u(x) &#8593; K(x) will render the system safe. We combine both the properties of safety and stability and solve the below QP to compute u(x), where we prioritize safety over stability.</p><p>Given the current state of the robot x and the target point x &#8771; , the QP that guarantees a safe motion plan is</p><p>where &#8641; is a class K function, &#8640; is a relaxation variable to ensure feasibility of ( <ref type="formula">8</ref>) and is penalized by &#8637; &gt; 0. We use Algorithm 1 from our prior work <ref type="bibr">[24]</ref> to choose x &#8771; and &#7819;&#8771; = f (x &#8771; ) that ensures tracking of complex periodic trajectories in-spite of external disturbances. If the safety specifications do not disturb the nominal motion, then &#8640; = 0 in (8), which guarantees stability.</p><p>2) STL tasks: We use time-varying control barrier functions to satisfy time-critical tasks specified by STL <ref type="bibr">[19]</ref>. For example, consider the STL task &#1009; ::= F &#8601;&#8733;x&#8601;x &#8771; &#8733; 2 +&#977;(t), where &#977;(&#8226;) controls the rate at which the robot reaches x &#8771; such that &#977;(b) = 0, B(x, a) &#8660; 0. For example, we can use &#977;(t) = max{0, &#8656;x(a)&#8658;x &#8594; &#8656; 2 a&#8658;b (t &#8601; b)} so that B(x, a) = &#962; 2 . If there exists a control law u(x, t) so that the solution of (7) satisfies B(x(t), t) &#8660; 0 for all t &#8593; [a, b], then &#1009; is satisfied. Since &#977;(t) is monotonically decreasing until t = b, the size of the set C(t) defined in Section II-B will decrease until t = b and the control law u(x, t) &#8593; K(x, t) will drive the state x &#962;-close to x &#8771; . We can formulate a QP similar to <ref type="bibr">[19]</ref> and compute u(x, t) that renders the set C(t) forward invariant for the dynamical system <ref type="bibr">(7)</ref> with the CBF B(x, t):</p><p>The above problem is always feasible if B(x, t) is a valid CBF and <ref type="bibr">[19]</ref> presents a closed-form expression under the additional assumption that B(x, t) is either non-decreasing or non-increasing in t. Both problems <ref type="bibr">(8)</ref> and <ref type="bibr">(9)</ref> are QPs that we solve efficiently in real-time using OSQP solver <ref type="bibr">[32]</ref>.</p><p>3) Switching between behaviors: The RTL specification requires the robot to switch between different behaviors depending on the changing environmental observations. Consider a scenario from our running example in Fig. <ref type="figure">3</ref>, where the pan is hot (h = 1) at all time t &#8242; t 1 , but is not hot enough (h = 0) at time t 2 &gt; t 1 . Then, the robot would be performing the stirring motion at time t &#8242; t 1 which involves commanding the virtual control u(x) computed from <ref type="bibr">(8)</ref> with f := fn(t) modeling the stirring motion. Now, at time t 2 , since h = 0, the robot should follow the press button behavior to satisfy ", which could be satisfied by commanding u(x, t) from ( <ref type="formula">9</ref>). This scenario involves switching between two types of motion planning strategies that correspond to p m = s and p m = p.</p><p>Mixing strategy: We propose a mixing strategy that connects two successive motion planners when the robot has to switch between behaviors so that there is a smooth transition. Let the robot follow a behavior a &#8593; A c during the time t &#8242; t 1 and that it has to switch to behavior b &#8593; A c when time t &gt; t 1 . Let the nominal vector field be fa (x) for behavior a and fb (x) for behavior b. Let the virtual control input be u a (x, t) for behavior a and u b (x, t) for behavior b. Then, the commanded reference velocity at time t 1 is &#7819;ref (t 1 ) = fa (x) + u a (x, t 1 ). We define the mixing strategy when the robot switches from behavior a &#8594; b at time t 1 as</p><p>where !t is the during for which the mixing strategy is implemented. The mixing factor &#946;(t) linearly increases from 0 to 1 over the time interval t &#8593; [t 1 , t 1 + !t] so that the commanded reference velocity smoothly varies from &#7819;ref (t 1 ) (behavior a) to &#7819;ref (t 1 + !t) (behavior b). If we increase !t, the robot will take longer to switch between behaviors and vice-versa.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>V. EXPERIMENTAL RESULTS</head><p>We demonstrate our method on a Franka robot arm performing two experiments: (i) wiping a whiteboard and (ii) wiping a mannequin, both while adapting to environmental changes and being compliant to human interactions.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Wiping a whiteboard</head><p>The task execution by the robot using our method is given in Fig. <ref type="figure">4</ref>, for the same scenario that was introduced in Fig. <ref type="figure">1</ref>. On a high level, the robot should switch between two different nominal wiping motions, react to the environment by wiping off any stain on the board, and adapt to external disturbances such as the eraser being dropped off from the end effector. The uncontrollable propositions are (i) eraser = 1 &#8659; the end-effector is holding an eraser, (ii) stain = 1 &#8659; there is a stain on the whiteboard, (iii) lef t = 1 &#8659; nominal wiping motion on the left side of the board and (iv) right = 1 &#8659; a different wiping motion on the right side of the board. The boolean values for left and right are controlled by the user using a GUI, the stain is detected by an Intel Realsense camera that returns the bounding box of the stain, and we assume the eraser is dropped if the gripper of the end-effector is open. The controllable propositions that model different desired behaviors are given in Table <ref type="table">I</ref>. The RTL specification that the robot should satisfy is " ::= G ((eraser and lef t and &#172;stain) &#8599; w left ) and G ((eraser and right and &#172;stain) &#8599; w right )) and ((eraser and stain) &#8599; s p ) and (&#172;eraser &#8599; e p ) and G ((eraser and stain) &#8599; (s p U w stain )) .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Wiping a human mannequin</head><p>We present the experimental details of another wiping task, this time on a human mannequin, where the robot motions are given in Fig. <ref type="figure">5</ref>. The robot should switch between two different nominal motions on the legs and the hands, wipe the back if the human gestures in that region, and wet the towel at regular intervals where a human squeezes the towel after wiping. The uncontrollable propositions are: (i) leg = 1 &#8659; wipe the legs, (ii) hand = 1 &#8659; wipe the hands, (iii) back = 1 &#8659; human gesturing on the back, (iv) wet = 1 &#8659; towel is wet, and (v) human = 1 &#8659; human is inside the workspace to squeeze the towel. The boolean values for leg and hand are controlled by the user using a GUI, the human gesture on the back is detected by an Intel Realsense camera, and the human being inside the robot workspace is detected by Optitrack markers on the human hand. We assume that the towel becomes dry, i.e., wet = 0, every 30 secs. The controllable propositions are given in Table <ref type="table">II</ref>, and RTL specification is Implementation details: For both the experiments, we use Spot 2.0 <ref type="bibr">[22]</ref> to construct the automaton B ! that has 43 states, 269 transitions for the whiteboard task; and 64 states, 510 transitions for the mannequin task. The nominal DS fa in Table <ref type="table">I</ref> and II are learned from 3 demonstrations for each motion using Neural ODEs <ref type="bibr">[24]</ref> that efficiently capture periodic motions. For wiping off the stain (w stain ), we generate a nominal trajectory online modeled as fstain that covers the bounding box of the detected stain, and the TABLE I: Controllable propositions (Whiteboard) Nominal Motions Stain Detection Stain Wiping Human Perturbation Eraser Pick-up Symbol Boolean condition Description wa wa = 1 &#8657; &#7819;(t) = fa(x(t)) Wiping motion on a &#8599; {leg, hand, back} given by a nominal autonomous DS fa dp dp = 1 &#8657; F[0,t d ] &#8656;x(t) &#8658; xd&#8656; &#8659; &#982; The end-effector should eventually (F ) be &#982;-close to the dip position xd within the time interval [0, td]. bp bp = 1 &#8657; F[0,t b ] &#8656;x(t) &#8658; xb&#8656; &#8659; &#982; The end-effector should eventually be &#982;-close to the bowl position xb within [0, tb].</p><p>TABLE II: Controllable propositions (mannequin) Nominal Motions Human Gesture Wiping the Back Squeezing Towel Dipping in Water Continuing Wiping trajectory is tracked using CLFs. We compute the time within which the robot should satisfy STL tasks as t &#8771; = &#8656;x(0)&#8658;x &#8594; &#8656; vu , where (t &#8771; , x &#8771; ) &#8593; {(t s , x s ), (t e , x e ), (t d , x d ), (t b , x b )}, v u is analogous to a uniform velocity for the robot and x(0) is the state when the robot starts to follow the relevant behavior. We satisfy the STL tasks using timevarying CBFs as described in Section IV-B.2 with &#977;(t) = max 0, &#8656;x(0)&#8658;x &#8594; &#8656; 2 2 e &#8593;t &#8658;e &#8593;t &#8594; 1&#8658;e &#8593;t &#8594; and &#962; = 5 cm. Such an exponential &#977; function generates a motion plan that is faster at the beginning with smoother convergence to the target point x &#8771; , when compared to a linear &#977; function which is typically used in prior work <ref type="bibr">[19]</ref>, <ref type="bibr">[20]</ref>. We use !t = 0.67 secs for the mixing strategy that generates smooth switching behaviors while also reacting quickly to environmental changes. Additional experiment videos and code-base is available at <ref type="url">https://sites.google.com/view/</ref> rtl-plan-control-hri.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>VI. CONCLUSION &amp; FUTURE WORK</head><p>We propose a modular reactive planner which integrates discrete temporal logic based plans and continuous DS-based motion plans that guarantees task satisfaction and stability while adapting to unforeseen disturbances and external observations. We demonstrate our method on the Franka robot arm for reactive wiping tasks involving safe human interactions.</p><p>One limitation of our work is not incorporating deadlock scenarios <ref type="bibr">[30]</ref> when robots cannot make task progress. Our future work aims to address such issues by integrating Large Language Models <ref type="bibr">[33]</ref> into LTL specifications that can act at a high level as a supervisory control <ref type="bibr">[31]</ref>. Future work will also investigate planning strategies to satisfy task specifications on SO(3) and SE(3) manifolds.</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0"><p>Farhad Nawaz, Shaoting Peng, Nadia Figueroa and Nikolai Matni are with the GRASP Lab, University of Pennsylvania, PA 19104, USA.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="2" xml:id="foot_1"><p>LarsLindemann is with the University of Southern California, CA 90007, USA.&#8594; Corresponding author: farhadn@seas.upenn.edu</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_2"><p>Authorized licensed use limited to: University of Pennsylvania. Downloaded on February 03,2025 at 14:40:02 UTC from IEEE Xplore. Restrictions apply.</p></note>
		</body>
		</text>
</TEI>
