Manuscript Offprint
arXiv:2610.29839Spacetime Splines for Adaptive Robot Motions
Boxuan Zhang , Ante Marić , and Sylvain Calinon
Abstract—Movement primitives commonly represent robot motions through basis functions indexed by time or phase. Inspired by spacetime representations employed in physics, we propose a spline-based formulation in which spatial geometry and temporal progression are represented within a common set of continuous variables. The proposed method jointly estimates a shared Bézier curve, while allowing spatial and temporal model complexity to be adapted independently (e.g., demonstration-specific phase modulation). As use case, we consider an alternating optimization process that simultaneously estimates path intervals observed in partial demonstrations. Simulation experiments demonstrate accurate joint recovery, refinement through modifications in model complexity and continuity, and improved robustness to variance in the demonstration set. Finally, we demonstrate online retiming and synchronization capabilities in a patient-turning task assisted by a robot, evaluated with a physical manikin.
Index Terms—Learning from Demonstration, Optimization and Optimal Control.
I. INTRODUCTION
To adapt and coordinate robot motions, we need to consider both spatial and temporal information. For example, human-guided demonstrations may produce recordings of different durations that can speed up or slow down in different parts of the motion. The recorded paths and sampling rates may also differ, and some recordings may contain only part of the overall motion, starting and stopping at different points of the full path.
Spline representations provide compact continuous models of robot motion [1]-[4]. Bézier curves provide one such representation that allows for easy modification of through geometrically-interpretable control points and favorable mathematical properties. For example, De Casteljau's algorithm can be used as a stable method for evaluating and subdividing these curves [5], [6]. Temporal alignment and phase-based methods account for nonlinear timing differences or separate path geometry from timing [7]-[12], while others learn from incomplete or partial demonstrations [13]-[16]. A common thread is that temporal and spatial aspects are encoded and optimized separately.
Inspired by spacetime representations in physics, we propose a continuous dynamic curve representation that homogeneously encodes spatial geometry and motion timing as an augmented state space. Figure 1 shows an example in which different phase modulations produce different spacetime curves preserving a spatial path. We consider in this paper a use case in which we jointly estimate a shared geometric path with a demonstration-specific modulation of the phase

Fig. 1. The spacetime spline representation can be used to preserve a shared spatial path geometry while modulating the motion timing by adapting the phase component of the augmented state space. Left: uniform (standard) in space and phase adaptation to provide a minimum-jerk motion. Right: Same movements in the spatial plane, showing that the path geometry is preserved under phase adaptation.
function that describes progress along that path. We utilize and alternating optimization process that adapts path geometry by modifying spatial coordinates of the control points, and motion timing through the temporal coordinates of the control points. This allows us to estimate path intervals in partial demonstrations of a longer motion.
The main contributions of this work are:
• Spacetime dynamic curve representation: a modular continuous spline encoding that homogeneously couples path geometry and phase, while allowing independent spatial and temporal adaptation.
• Coverage estimation in partial demonstrations: joint inference of path intervals observed in partial demonstrations.
• Spatial and temporal adaptation: adaptive refinement of shared Bézier geometry and demonstration-specific phase for online retiming and synchronization of robot motions.
We evaluate joint recovery, structural preservation, and adaptive optimization in a set of simulation experiments. Finally, we demonstrate collaborative synchronization under changing
Technical University of Munich (TUM), Munich, Germany.
Idiap Research Institute, Martigny, Switzerland.
human timing and temporary interruptions in a patient-turning task assisted by a robot, evaluated with a physical manikin.
A. Spline-Based Motion Representation and Adaptive Fitting
Spline representations provide compact continuous models of robot motion [3], [4], with Bézier and B-spline models offering smoothness, explicit control-point structure, and analytical derivatives [5], [6].
B-spline Movement Primitives (BMPs) [3] combine B-spline representations with movement-primitive parameterizations, while concatenated Bézier splines have been used as continuous motion encoding for distance-field and dynamical-system construction [4]. Spline parameters have also been adopted as structured action representations for policy learning [17], [18]. In parallel, free-knot and adaptive spline methods optimize or refine knot placement according to the data, allowing representation capacity to be allocated nonuniformly [19]–[23].
Our work builds on these ideas but addresses an additional structural ambiguity: reconstruction error may originate from insufficient complexity of the spatial and temporal models representing the robot motion. Including both position and velocity information in an augmented state space enables additional dynamic information to be encoded in the curve. However, this approach has limitations, discussed in [24], which can be addressed through the use of a phase variable. We propose to adapt geometry and phase components of the joint spacetime curve in an alternating optimization scheme and evaluate candidate refinements under a common regularized objective.
B. Temporal Alignment and Geometry–Phase Modeling
Temporal variations are common when learning motion from multiple demonstrations. Dynamic time warping (DTW) [7] and related registration methods [8] are commonly used to align demonstrations with nonlinear timing differences. This warping process is typically used as a pre-processing step to align trajectories and requires the discretization of the curve and the tuning of hyperparameters to define the allowed distortion, which typically depends on the chosen resolution of the curve (number of discretization points) and which often only considers local warping. Our approach instead relies on a continuous time adaptation function that does not require discretization.
In functional data analysis, temporal misalignment is often treated as phase variation and separated from spatial variation. Curve registration methods estimate nonlinear transformations of the independent variable in order to align salient structures across observations [25]. Raket et al. [9] showed that excessive alignment can absorb genuine spatial variability into the estimated warping functions. This motivates joint formulations in which the complexity of the temporal transformation and the spatial representation must be balanced rather than treating alignment as an independent preprocessing step.
Recent robotics methods further separate path geometry from timing. Braglia et al. [10] proposed arc-length-based alignment using a time-independent path parameterization. Their subsequent phase-independent Dynamic Movement Primitive (DMP) formulation further decouples the demonstrated geometric path from its timing law, allowing execution phase to be redesigned independently for applications including human–robot co-manipulation and time-optimal motion generation [11]. TimewarpVAE [12] similarly incorporates differentiable temporal warping into representation learning.
We jointly estimate a shared geometric spline and demonstration-specific monotone phase functions, with the recovered phase remaining an explicit component of the motion representation and allowing for subsequent constraints or modifications. Each demonstration is additionally associated with an explicit coverage interval on the shared path, allowing the encoding of temporal progression and spatial coverage.
C. Learning from Partial Demonstrations
Some work addresses incomplete supervision, such as missing action labels or partially observed state–action information [13]. Other methods consider demonstrations that cover only part of a task. Pervez et al. [14] combined temporal synchronization with movement learning from incomplete teleoperation demonstrations. Silvério et al. [15] combined movement models learned from partial subtasks through uncertainty-aware controller fusion. Partial demonstrations have also been used to guide policy learning without requiring exact trajectory reproduction [16].
Our setting differs in that a partial demonstration is modeled as an observation of an unknown contiguous interval of a common continuous motion. Its coverage is estimated jointly with the shared geometry and demonstration-specific phase. Complete and partial demonstrations therefore contribute to a shared representation, while spatial coverage remains separate from temporal progression.
III. METHODOLOGY
A. Spacetime Motion Encoding
Given samples , , let be partitioned into complete and partial demonstration sets and . Using normalized recording time , we encode motion homogeneously in augmented spacetime as
where is the shared spatial map and describes progression along it. The monotone profile controls this progression over the coverage interval . The reconstructed trajectory is the spatial projection
Complete demonstrations have , while partial coverage is estimated jointly with the spatial and temporal coordinate parameters. One complete anchor
fixes the common monotone reparameterization ambiguity.
B. Coordinate-Specific Spline Parameterization
We use the cubic Bernstein basis vector
with scalar basis functions
The shared spatial map uses cubic Bézier segments over knots , with . For parameter value , the spatial map is expressed as
where represents a matrix of control points . For demonstration , represents the local segment parameter and phase progression is parametrized as .
Adjacent segments share a control point , ensuring continuity. At selected junctions, we further impose
(7)
where is a unit tangent direction at and are handle lengths. This aligns tangent directions while allowing different magnitudes.
Analogously to the above, non-anchor temporal coordinates use a piecewise-cubic profile over segments
with control points , spline parameter and local segment parameter . In the above, represents the -th knot of demonstration . Monotonicity is enforced by
together with , , and shared endpoints between adjacent segments. These constraints prevent temporal reversal while allowing pause-like progression and ensuring continuity. Further continuity constraints can be imposed by matching derivatives at internal knots.
C. Alternating Spacetime Optimization
For partial demonstrations, coverage is parameterized by . With and minimum coverage length ,
ensuring .
Let and collect the spatial and temporal profile parameters, respectively. For each non-anchor demonstration, we define
\theta_{i}=\begin{cases}\theta_{u,i},&i\in\mathcal{I}_{full},\\[\theta_{u,i}^{\top},\alpha_{i},\beta_{i}]^{\top},&i\in\mathcal{I}_{part},\end{cases} \tag{11}and the full parameter vector , where stacks blocks vertically. Using the mean squared reconstruction error
for a fixed spline structure, we minimize
Curvature and coverage intervals are regularized using
with second derivatives evaluated segmentwise.
Block-coordinate optimization first fixes the spatial block and updates non-anchor temporal blocks in parallel as
Here, enforces monotonicity, endpoints, coverage, and the selected continuity constraints. Fixing these temporal blocks, we then update
using regularized linear least squares for all- junctions and constrained nonlinear least squares with junctions. Updates alternate until the relative change of falls below a threshold.
D. Adaptive Coordinate Refinement
Starting from few segments per coordinate block, we accumulate reconstruction errors over the optimized spatial and temporal partitions. Subsequently, we use De Casteljau subdivision to initialize candidate splits on segments with the largest mean errors while retaining encoded curves.
Spatial junctions are additionally tested for continuity. Namely, for junction with nonzero handles and , we define
For thresholds and , junctions satisfying and are reoptimized under the spatial parameterization and retained if the increase in (13) remains within a threshold.
TABLE I
RECOVERY ON COMPLETE AND PARTIAL DEMONSTRATIONS (MEAN STANDARD DEVIATION OVER 30 RUNS). LOWER IS BETTER. DMP AND PROMP ARE EVALUATED ON COMPLETE DEMONSTRATIONS ONLY BECAUSE THEIR STANDARD FORMULATIONS DO NOT INFER UNKNOWN COVERAGE INTERVALS.
| Setting | Method | Traj. RMSE | Geom. RMSE | Phase RMSE | Cov. MAE |
|---|---|---|---|---|---|
| Complete | Ours | - | |||
| DTW+spline | - | ||||
| Linear phase | - | ||||
| DMP | - | - | |||
| ProMP | - | - | |||
| Partial | Ours | ||||
| DTW+spline | |||||
| Linear phase |
For a coordinate-specific structure , where specifies the or continuity class at each spatial junction, subdivision candidates are compared using
where penalize spatial and temporal segments, and alternating optimization approximates the inner minimum. A candidate structure is accepted only if , where is the minimum required score reduction. If both split candidates are admissible, the one with the larger score reduction is selected. Refinement stops when neither split is accepted or the target reconstruction error is reached.
After optimization, the spatial projection is evaluated using a monotone temporal coordinate :
The velocity relation holds wherever is differentiable. Linear profiles spanning or give nominal or partial traversal, respectively, and nonlinear profiles permit retiming and pause-like progression. As a use case example, we demonstrate online adaptation of in an assistive task experiment in Sec. IV-B.
IV. EXPERIMENTS
A. Simulation Experiments
We evaluate three aspects of the proposed formulation. Q1: joint recovery of geometry, phase, and partial coverage; Q2: preservation of geometric structure; and Q3: the role of alternating optimization and adaptive model complexity.
Joint recovery and robustness (Q1). We evaluate whether the proposed formulation can jointly recover a shared geometric path, demonstration-specific phase evolution, and partial coverage. We use six representative shapes from the LASA handwriting dataset [26]: Angle, CShape, Sine, Line, JShape, and Trapezoid as latent paths . For each shape, seven demonstrations are generated with nonlinear timing and observation noise, while partial trials additionally expose only a sub-interval of the latent path. Five trials are performed per shape, resulting in 30 runs for each evaluation setting.

Fig. 2. Geometry recovery under increasing independent spatial perturbations across demonstrations. The horizontal axis shows the perturbation amplitude in units of . Without a privileged clean reference, our method degrades more slowly than DTW+spline as the perturbation amplitude increases.
One complete demonstration is fixed as the canonical anchor. Partial coverage is constrained to a minimum span of 0.12, and alternating optimization is run for at most 30 iterations with a convergence tolerance of .
We compare our method with DTW+spline and a fixed linear-phase model. Dynamic Movement Primitives (DMPs) [27] and Probabilistic Movement Primitives (ProMPs) [28] are additionally included for complete demonstrations. For DTW+spline, demonstrations are aligned to a selected reference before spline fitting; for partial demonstrations, the aligned endpoints determine the estimated coverage interval. We report trajectory and geometry root-mean-square error (RMSE), phase RMSE where applicable, and coverage endpoint mean absolute error (MAE) for partial demonstrations.
Table I evaluates the clean-reference regime, which deliberately favors reference-based alignment. DTW+spline performs best in this setting, as expected from its access to a reliable reference trajectory.
We next remove this privileged reference by independently perturbing every demonstration with a smooth spatial deviation scaled by amplitude ,
where denotes Gaussian observation noise and is generated independently for each demonstration and centered

(a)

(b)
Fig. 3. (a) Structural ablation. Position and tangent RMSEs are normalized by the corresponding medians of the all- variant. , , and denote our method, all- , and all- , respectively. (b) Adaptive geometry complexity. A denotes the adaptive model, which selects segments (mean standard deviation); the other labels indicate fixed segment counts. Mean runtimes for 2, A, 4, 6, and 8 are 0.58, 21.0, 18.7, 121, and 689 s, respectively.
across the ensemble, such that remains the latent shared path. Thus, no individual demonstration provides an unperturbed spatial reference.
As shown in Fig. 2, DTW+spline is more accurate at low perturbation levels, whereas our method degrades more slowly as inter-demonstration spatial variation increases. This shows that reference-based alignment is effective when a reliable template is available, while joint estimation is more robust when the shared geometry must be inferred from mutually inconsistent demonstrations.
Structural preservation and adaptive continuity (Q2). We evaluate continuity selection on paths containing both smooth, continuous transitions and discontinuities. Over 30 runs, each trial contains five demonstrations of 50 samples with Gaussian observation noise ( ). For experiments involving temporal-profile estimation, we use continuity. Here, ground-truth phase is supplied to all variants in order to evaluate geometric continuity in isolation.
Figure 3a shows that the adaptive formulation achieves the lowest error in both metrics. This indicates that selecting continuity locally avoids the loss of tangent consistency of All- while preventing the over-smoothing introduced by globally enforced continuity.
Alternating optimization and adaptive complexity (Q3). Table II shows that removing alternating updates or fixing coverage or phase substantially degrades joint recovery, confirming the importance of optimizing geometry, phase, and coverage together. Fig. 3(b) compares the automatically selected adaptive complexity with fixed-complexity alternatives, illustrating the corresponding accuracy–runtime trade-off.
TABLE II ABLATION OF THE JOINT OPTIMIZATION (MEAN ± STANDARD DEVIATION OVER 15 RUNS). LOWER IS BETTER.
| Method | Geom. RMSE | Phase RMSE | Cov. MAE |
|---|---|---|---|
| Ours | 0.0210 ± 0.0017 | 0.0282 ± 0.0027 | 0.0347 ± 0.0049 |
| One-shot | 0.0541 ± 0.0019 | 0.0687 ± 0.0017 | 0.0813 ± 0.0083 |
| Fixed coverage | 0.0571 ± 0.0075 | 0.1036 ± 0.0013 | 0.2070 ± 0.0000 |
| Linear phase | 0.0945 ± 0.0100 | 0.1431 ± 0.0042 | 0.1359 ± 0.0076 |

Fig. 4. Patient-turning robot assistance experiment. From top to bottom: demonstration collection through guidance; nominal execution under continuous hand tracking; and online adaptation during temporary tracking loss. Figures on the right show camera observations used for phase estimation. During tracking loss, the current phase is retained until visual observation is recovered.
The implementation also benefits substantially from analytic phase derivatives and different demonstrations can be processed in parallel. All timing measurements were obtained on an Intel Core i9 CPU. For 32 demonstrations, median fitting time decreases from 88.5 s with serial finite differences to 5.81 s with analytic gradients and 3.04 s with parallel demonstration updates. A per-demonstration update requires 16.9 ms median computation time and 29.8 ms at the 95th percentile.
B. Robot Experiments
REFERENCES
As a downstream application of the proposed spacetime encoding and optimization approach, we demonstrate that the recovered phase can serve as an online execution coordinate in a collaborative patient-turning task using a 7-DoF Franka robot and a manikin. The demonstrated assistive task requires two people: one to move the upper body and one to guide the lower body. During demonstration collection, the second person kinesthetically guides the robot to dmeosntrate the synchronized assistive behavior. The resulting demonstration establishes the correspondence between human motion progress and robot motion. An RGB camera tracks the human hand at approximately 15 Hz.
At runtime, each valid hand observation is locally matched to the demonstrated hand trajectory to estimate the human phase . Before execution, the human hand trajectory is aligned with the demonstration using a predefined shoulder pose. The estimated phase is constrained to remain monotone, preventing temporal regression under visual noise or ambiguous local correspondences. The human phase provides the reference for the robot phase , and the desired joint-space commands are
with commands updated at approximately 100 Hz. Robot progression is then determined by the observed human motion.
Fig. 4 shows nominal execution and online adaptation using the same learned spacetime representation. Under continuous tracking, the robot progresses synchronously with the human partner. In the adaptation trial, the hand observation is temporarily removed during execution, causing the phase to be held and the robot to maintain its current configuration. Execution is finally resumed once hand tracking is recovered, demonstrating adaptation capabilities in a real world scenario (see also accompanying video).
V. CONCLUSION
We presented a spacetime spline encoding strategy for learning robot motions from complete and partial demonstrations. The formulation jointly estimates a shared geometric path, demonstration-specific temporal profiles, and coverage intervals within a single augmented state space, while allowing for coordinate-specific continuity constraints. Simulated experiments demonstrate that the spacetime representation allows robust recovery under variations in the demonstration set, and adaptation to varying continuity in demonstrated paths. As an example use case, we considered an assistive robotics experiment requiring online retiming, as an illustration of adaptation capability in human-robot collaborative tasks requiring robustness to visual tracking loss. We plan in future work to further leverage the modularity and interpretability of the spacetime spline representation in various collaborative tasks involving multiple users and robots (incl. dual-arm and multi-finger tasks).
[1] H. Miyamoto, S. Schaal, F. Gandolfo, H. Gomi, Y. Koike, R. Osu, E. Nakano, Y. Wada, and M. Kawato, “A Kendama Learning Robot Based on Bi-directional Theory,” Neural Networks, vol. 9, no. 8, pp. 1281–1302, 1996.
[2] A. Ude, A. Gams, T. Asfour, and J. Morimoto, “Task-Specific Generalization of Discrete and Periodic Dynamic Movement Primitives,” IEEE Transactions on Robotics, vol. 26, no. 5, pp. 800–815, 2010.
[3] W. Liao, G. Li, H. Zhou, R. Lioutikov, and G. Neumann, “BMP: Bridging the Gap between B-Spline and Movement Primitives,” 2024.
[4] Y. Li and S. Calinon, “From Movement Primitives to Distance Fields to Dynamical Systems,” IEEE Robotics and Automation Letters, vol. 10, no. 9, pp. 9550–9556, 2025.
[5] G. Farin, Curves and Surfaces for CAGD: A Practical Guide. Morgan Kaufmann, 2002.
[6] P. Woźny and F. Chudy, “Linear-time geometric algorithm for evaluating Bézier curves,” Computer-Aided Design, vol. 118, 2020.
[7] H. Sakoe and S. Chiba, “Dynamic Programming Algorithm Optimization for Spoken Word Recognition,” IEEE Transactions on Acoustics, Speech, and Signal Processing, vol. 26, no. 1, pp. 43–49, 1978.
[8] N. Vuković, M. Mitić, and Z. Miljković, “Trajectory learning and reproduction for differential drive mobile robots based on GMM/HMM and dynamic time warping using learning from demonstration framework,” Engineering Applications of Artificial Intelligence, vol. 45, pp. 388–404, 2015.
[9] L. L. Raket, B. Grimme, G. Schöner, C. Igel, and B. Markussen, “Separating Timing, Movement Conditions and Individual Differences in the Analysis of Human Movement,” PLOS Computational Biology, vol. 12, p. e1005092, 2016.
[10] G. Braglia, D. Tebaldi, A. E. Lazzaretti, and L. Biagiotti, “Arc-Length-Based Warping for Robot Skill Synthesis from Multiple Demonstrations,” in 2025 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2025, pp. 8111–8118.
[11] G. Braglia, D. Tebaldi, and L. Biagiotti, “Phase-independent Dynamic Movement Primitives with applications to human-robot co-manipulation and time optimal planning,” Robotics Auton. Syst., vol. 194, 2025.
[12] T. Rhodes and D. D. Lee, “TimewarpVAE: Simultaneous Time-Warping and Representation Learning of Trajectories,” arXiv preprint, 2023.
[13] M. Sun and X. Ma, “Adversarial Imitation Learning from Incomplete Demonstrations,” in Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, 2019, pp. 3513–3519.
[14] A. Pervez, A. Ali, J. H. Ryu, and D. Lee, “Novel Learning From Demonstration Approach for Repetitive Teleoperation Tasks,” in 2017 IEEE World Haptics Conference, 2017, pp. 60–65.
[15] J. Silvério, Y. Huang, F. J. Abu-Dakka, L. Rozo, and D. G. Caldwell, “Uncertainty-Aware Imitation Learning using Kernelized Movement Primitives,” in 2019 IEEE/RSJ International Conference on Intelligent Robots and Systems, 2019, pp. 90–97.
[16] C. Li, M. Vlastelica, S. Blaes, J. Frey, F. Grimminger, and G. Martius, "Learning Agile Skills via Adversarial Imitation of Rough Partial Demonstrations," in Proceedings of The 6th Conference on Robot Learning, vol. 205, 2023, pp. 342–352.
[17] M. Tian, Y. Li, S. Liu, A. Ijspeert, and S. Calinon, “Spline Policy: A Structured Representation for Robot Policies,” 2026.
[18] X. Han, H. Xiong, H. Chen, C. Liu, A. Torralba, Y. Zhu, and Y. Du, “B-spline Policy: Accelerating Manipulation Policies via B-spline Action Representations,” arXiv preprint arXiv:2607.09648, 2026.
[19] D. L. B. Jupp, “Approximation to Data by Splines with Free Knots,” SIAM Journal on Numerical Analysis, vol. 15, no. 2, 1978.
[20] S. Miyata and X. Shen, “Adaptive Free-Knot Splines,” Journal of Computational and Graphical Statistics, vol. 12, no. 1, pp. 197–213, 2003.
[21] W. Li, S. Xu, G. Zhao, and L. P. Goh, “Adaptive knot placement in B-spline curve approximation,” Computer-Aided Design, vol. 37, no. 8, pp. 791–797, 2005.
[22] H. Park and J.-H. Lee, “B-spline curve fitting based on adaptive curve refinement using dominant points,” Computer-Aided Design, vol. 39, no. 6, pp. 439–451, 2007.
[23] X. Zhao, C. Zhang, B. Yang, and P. Li, “Adaptive knot placement using a GMM-based continuous optimization algorithm in B-spline curve approximation,” Computer-Aided Design, vol. 43, no. 6, pp. 598–604, 2011.
[24] A. Tekden, D. Kanoulas, A. Billard, and Y. Bekiroglu, “Reactive motion generation via phase-varying neural potential functions,” IEEE Robotics and Automation Letters, vol. 11, no. 7, pp. 8292–8299, 2026.
[25] J. O. Ramsay, “Curve registration,” in The Oxford Handbook of Functional Data Analysis, 2018, pp. 235–258.
[26] S. M. Khansari-Zadeh and A. Billard, “Learning Stable Non-Linear Dynamical Systems with Gaussian Mixture Models,” IEEE Transactions on Robotics, vol. 27, no. 5, pp. 943–957, 2011.
[27] A. J. Ijspeert, J. Nakanishi, H. Hoffmann, P. Pastor, and S. Schaal, "Dynamical Movement Primitives: Learning Attractor Models for Motor Behaviors," Neural Computation, vol. 25, no. 2, pp. 328–373, 2013.
[28] A. Paraschos, C. Daniel, J. R. Peters, and G. Neumann, “Probabilistic Movement Primitives,” in Advances in Neural Information Processing Systems, vol. 26, 2013.