                           Geometric Contact Flows: Contactomorphisms for Dynamics and Control

task demonstrations, is loaded by a control node operating            By substituting Equation (39) into (40), we obtain,
at a frequency of 10 Hz. This node receives state measure-                                      RT 1 ⊤
                                                                            q̇⊤ q̇ − ṡ = H0 e− 0 ( 2 q̇ q̇−β(q)−ṡ)/s dt .
                                                                                       
ments from the robot, normalizes the data, and computes                                                                             (41)
the Lagrangian action before calling the model to predict dy-         Differentiating this equation with respect to time, we derive,
namics for the subsequent 2 seconds. At each timestep, the
GCF node checks whether the GCF learning model is avail-                             ⊤
                                                                        e− 0 ( 2 q̇ q̇−β(q)−ṡ)/s dt (ρ(s, ṡ, q̇, q̈) − s̈) = 0, (42a)
                                                                            RT   1

able for computation. If the model is not already engaged,
it processes the latest robot state. The node then updates                                   1
                                                                                                 q̇⊤ q̇ − β(q) − ṡ ⊤
                                                                        ρ(s, ṡ, q̇, q̈) = 2                        q̇ q̇ − ṡ + 2q̇⊤ q̈,
                                                                                                                              
the Impedance Controller with a new frame of the predicted                                               s
dynamics. Whenever a new trajectory becomes available,                                                                             (42b)
the previously executed trajectory is replaced and updated            which implies:
accordingly. The control node used for the state-of-the-art
benchmarks shares the same features.
                                                                                 1
                                                                                  q̇⊤ q̇ − β(q) − ṡ ⊤
                                                                           s̈ = 2                     q̇ q̇ − ṡ + 2q̇⊤ q̈.
                                                                                                                
                                                                                                                                (43)
                                                                                          s
D.3. Conversion to Canonical Coordinates                              This differential equation can be integrated forward to obtain
                                                                      the full time series of Lagrangian actions s, given the initial
In classical mechanics, the state of physical systems is typi-
                                                                      conditions,
cally described using positions and velocities {q, q̇}, rather
than the canonical coordinates {q, p, s}, required in the con-                           s̈0 = 0,     ṡ0 = q˙0 ⊤ q˙0 ,   s0 .      (44)
tact Hamiltonian formulation. Therefore, prior to inferring           Through this process, we obtain a description of the dynam-
the network, it is necessary to perform a conversion and              ics in canonical coordinates {q, p, s}.
estimate the action Lagrangian value s, which is not directly
observable in many applications.                                      Robotic Tasks. The dynamical system under consider-
                                                                      ation consists of the Franka-Emika Panda robot and its
Spring Mesh System and Handwriting Datasets. The                      workspace and manipulated objects, represented by the rope.
spring mesh dataset, along with the LASA and DigiLeTs                 We have access to the end-effector position and velocity, de-
handwriting datasets, represent the system dynamics using             noted as {q, q̇}. To transform these variables into canonical
the state variables q, q̇. To transform these data into canon-        coordinates in real time, we first use the dynamical model
ical coordinates, we assume that the dynamical system is              of the robot to compute the workspace inertia matrix Λ. As-
characterized by a unitary mass, implying q̇ = p, and gov-            suming a Hamiltonian in mechanical form, the canonical
erned by a contact Hamiltonian in mechanical form, defined            momentum is obtained as p = Λq̇. The total energy of the
as,                                                                   system at a given time t can be modeled as the sum of the
                     1                                                robot kinetic energy, the dissipation term, and the energy
               H = p⊤ p + β(q) + γ(q)s,                   (38)
                     2                                                stored in the environment, which is represented by the dis-
                                                                      placement of the rope as a result of the work performed by
where β(q) is the potential energy, and γ(q) denotes the
                                                                      the robot. The total energy is therefore expressed as,
damping coefficient. Depending on its sign, γ(q) can ac-
                                                                                                          Z t
count for either energy dissipation (γ > 0) or energy genera-                              1 ⊤
                                                                                  H(t) = q̇ Λq̇ + s −         fe⊤ δq dτ,       (45)
tion (γ < 0). In this context, the dynamics are characterized                              2                0
by an attraction point, and we model the potential function
                                                                      where fe represents the external force applied at the end-
during demonstrations as linearly decreasing toward zero.
                                                                      effector and δq
                                                                                   R t denotes an infinitesimal robot motion. The
In order to compute the Lagrangian action s, the potential
                                                                      integral term 0 fe⊤ δq dτ is negative during a pulling action
energy is parametrized as β(q) = T −t, where T represents
                                                                      and includes both the conservative and non-conservative
the final time of the trajectory.
                                                                      components of the robot interaction with the environment.
According to the Maupertuis’ principle of least action, the
                                                                      The evolution of the Lagrangian action s is governed by
variation of s is,
                                                                      the Maupertuis’ principle of least action according to the
                      1 ⊤                                             equation,
               ṡ =     q̇ q̇ − β(q) − γ(q)s.            (39)                                         Z t
                      2                                                                1 ⊤
                                                                                  ṡ = q̇ Λq̇ − s +       fe⊤ δq dτ.        (46)
                                                                                       2                0
In addition, as derived from Noether (1918), the variation
of the contact Hamiltonian function (38) is regulated by,             This differential equation shows how s can be updated at
                                                                      every time instant according to the measured values of q̇
                             
        1 ⊤                           RT                              and fe . Through this process, we obtain a description of the
          q̇ q̇ + β(q) + γ(q)s = H0 e− 0 γ(q)dt .        (40)         dynamics in canonical coordinates {q, p, s}.
        2

                                                                 20
