Literature
Display
← All papers

Jerk-limited Real-time Trajectory Generation with Arbitrary Target States

Lars Berscheid and Torsten Kröger

· Robotics: Science and Systems (RSS) ↗

Robotics4 min text · CondensedOriginal paper ↗
Contents

At a glance

Ruckig generates synchronized, time-optimal robot trajectories between complete position, velocity, and acceleration states under velocity, acceleration, and jerk limits. It supports nonzero target acceleration and asymmetric velocity/acceleration bounds. The authors report tests on more than one billion random trajectories and a seven-axis robot; the algorithm is available as an open-source C++ library.

I Introduction

Robots need to adjust motion online when targets, limits, or sensor observations change. Limiting jerk prevents acceleration discontinuities, while complete target states allow smoother transitions between motion segments.

JerkAccelerationVelocityPositiont1t_{1}t2t_{2}t3t_{3}t4t_{4}t5t_{5}t6t_{6}t7t_{7}
Fig. 1: A time-optimal profile of a single degree of freedom with initial velocity v0≠0v_{0}\neq 0 and target acceleration af≠0a_{f}\neq 0. The proposed algorithm is able to generate a time-synchronized trajectory for multiple degrees of freedom with given velocity, acceleration and jerk constraints (dashed) in a limited number of operations (real-time capability).

II Related Work

The paper distinguishes time-parameterizing a prescribed path from generating a trajectory online between kinematic states.

Offline Trajectory Generation

Offline methods optimize motion along a chosen path. Ruckig instead solves state-to-state motion without requiring the geometric path in advance.

Related references: [6], [9], [12], [10].

Online Trajectory Generation

Prior online generators restrict target derivatives, optimality, or multidimensional synchronization. Ruckig combines jerk limits, arbitrary feasible target acceleration, directional bounds, and synchronized arrival.

Related references: [11], [3], [5], [8], [7], [1], [2], [4].

Highest-order Non-zero Target Highest-order Constraint
Type II Velocity Acceleration
Type IV Velocity Jerk
Type V Acceleration Jerk

III Problem Definition

For every degree of freedom, choose position over time so its velocity, acceleration, and jerk remain within their bounds and all coordinates reach the specified final state together. The formulation assumes symmetric jerk bounds but permits asymmetric velocity and acceleration limits. Not every requested target state is feasible.

Equations 1
xi=(pi,vi:=∂pi∂t,ai:=∂2pi∂t2,ji:=∂3pi∂t3)\displaystyle x_{i}=\left(p_{i},\,v_{i}:=\frac{\partial p_{i}}{\partial t},\,a_{i}:=\frac{\partial^{2}p_{i}}{\partial t^{2}},\,j_{i}:=\frac{\partial^{3}p_{i}}{\partial t^{3}}\right)
x→∗​(t)=arg​minx→​(t)​Tf,x→​(0)=x→0,x→​(Tf)=x→f\displaystyle\vec{x}^{*}(t)=\text{arg}\min_{\vec{x}(t)}T_{f},\quad\vec{x}(0)=\vec{x}_{0},\quad\vec{x}(T_{f})=\vec{x}_{f}
vi,m​i​n≤\displaystyle v_{i,min}~\leq~ vi​(t)≤vi,m​a​x\displaystyle v_{i}(t)~\leq~v_{i,max}
ai,m​i​n≤\displaystyle a_{i,min}~\leq~ ai​(t)≤ai,m​a​x\displaystyle a_{i}(t)~\leq~a_{i,max}
ji,m​i​n≤\displaystyle j_{i,min}~\leq~ ji​(t)≤ji,m​a​x\displaystyle j_{i}(t)~\leq~j_{i,max}
af≤2​jm​a​x​max⁡(|vm​a​x−vf|,|vm​i​n−vf|),\displaystyle a_{f}\leq\sqrt{2j_{max}\max\left(|v_{max}-v_{f}|,|v_{min}-v_{f}|\right)}, (1)

IV Algorithm

The algorithm first brakes an invalid initial state into bounds. It enumerates extremal profiles, identifies forbidden arrival-time intervals, finds the fastest duration shared by all axes, synchronizes each axis to it, and evaluates the next state. A limiting axis uses a piecewise constant jerk profile with at most seven phases.

IV-A Brake Pre-trajectory

A short braking prefix is needed when the initial state already violates a bound or its acceleration makes a later violation unavoidable. At most two phases restore admissible velocity and acceleration before the main trajectory.

a0>amaxa_{0}>a_{\textit{max}} j0=−jmaxj_{0}=-j_{\textit{max}} j1=0j_{1}=0 vat a max<vminv_{\textit{at a max}}<v_{\textit{min}}vat a zero>vmaxv_{\textit{at a zero}}>v_{\textit{max}} t0=tto a maxt_{0}=t_{\textit{to a max}}
t1=min⁡(tto v max,tto v min)t_{1}=\min(t_{\textit{to v max}},t_{\textit{to v min}})
t0=tto a maxt_{0}=t_{\textit{to a max}} tto a max<tto v maxt_{\textit{to a max}}<t_{\textit{to v max}} and tto a max<tto v mint_{\textit{to a max}}<t_{\textit{to v min}} t0=tto a mint_{0}=t_{\textit{to a min}}
t1=min⁡(tto v max,tto v min)t_{1}=\min(t_{\textit{to v max}},t_{\textit{to v min}})
t0=min⁡(tto v max,tto v min)t_{0}=\min(t_{\textit{to v max}},t_{\textit{to v min}}) ✓\checkmark✓\checkmark✓\checkmark
Fig. 2: A part of the decision tree (given a0>am​a​xa_{0}>a_{max}) for calculating an optional brake pre-trajectory. If required, we calculate the time-optimal profile to transfer the system to a safe kinematic state. The pre-trajectory is determined by up to two steps of constant jerk j0j_{0} and j1j_{1} and their respective duration t0t_{0} and t1t_{1}.

IV-B Step 1: Extremal Times

Extremal profiles can touch one velocity and two acceleration limits. Enumerating limit combinations and jerk directions produces candidate phase durations; negative durations and bound violations are rejected. Most profiles have analytic solutions; remaining cases require polynomial root finding with bounded iteration. The shortest valid candidate gives each axis its independent minimum time.

TABLE I: Steps of Constant Jerk of an Extremal Profile
Step kk Jerk Sign sks_{k} Limit
t1t_{1} ↑\uparrow or ↓\downarrow -
t2t_{2} 0 ACC0
t3t_{3} ↑\uparrow or ↓\downarrow -
t4t_{4} 0 VEL
t5t_{5} ↑\uparrow or ↓\downarrow -
t6t_{6} 0 ACC1
t7t_{7} ↑\uparrow or ↓\downarrow -
TABLE II: Time-Optimal Profile Types for the UP Direction.
Step Jerk Profile Limits Condition I Condition II Condition III Condition IV
Step 1 + 2 ↑↓↓↑\uparrow\downarrow\downarrow\uparrow ACC0 VEL ACC1 a1=am​a​xa_{1}=a_{max} v3=vm​a​xv_{3}=v_{max} a5=am​i​na_{5}=a_{min} a3=0a_{3}=0
ACC0 VEL a1=am​a​xa_{1}=a_{max} v3=vm​a​xv_{3}=v_{max} t6=0t_{6}=0 a3=0a_{3}=0
VEL ACC1 t2=0t_{2}=0 v3=vm​a​xv_{3}=v_{max} a5=am​i​na_{5}=a_{min} a3=0a_{3}=0
VEL t2=0t_{2}=0 v3=vm​a​xv_{3}=v_{max} t6=0t_{6}=0 a3=0a_{3}=0
ACC0 ACC1 a1=am​a​xa_{1}=a_{max} t4=0t_{4}=0 a5=am​i​na_{5}=a_{min} t5=0t_{5}=0
ACC0 a1=am​a​xa_{1}=a_{max} t4=0t_{4}=0 t6=0t_{6}=0 t5=0t_{5}=0
ACC1 t2=0t_{2}=0 t4=0t_{4}=0 a5=am​i​na_{5}=a_{min} t5=0t_{5}=0
NONE t2=0t_{2}=0 t4=0t_{4}=0 t6=0t_{6}=0 t5=0t_{5}=0
↑↓↑↓\uparrow\downarrow\uparrow\downarrow ACC0 ACC1 a1=am​a​xa_{1}=a_{max} t4=0t_{4}=0 a5=am​a​xa_{5}=a_{max} t7=0t_{7}=0
ACC0 a1=am​a​xa_{1}=a_{max} t4=0t_{4}=0 t6=0t_{6}=0 t7=0t_{7}=0
ACC1 t2=0t_{2}=0 t4=0t_{4}=0 a5=am​a​xa_{5}=a_{max} t7=0t_{7}=0
NONE t2=0t_{2}=0 t4=0t_{4}=0 t6=0t_{6}=0 t7=0t_{7}=0
Step 2 ↑↓↑↓\uparrow\downarrow\uparrow\downarrow ACC0 VEL ACC1 a1=am​a​xa_{1}=a_{max} v3=vm​a​xv_{3}=v_{max} a5=am​a​xa_{5}=a_{max} t7=0t_{7}=0
ACC0 VEL a1=am​a​xa_{1}=a_{max} v3=vm​a​xv_{3}=v_{max} t6=0t_{6}=0 t7=0t_{7}=0
VEL ACC1 t2=0t_{2}=0 v3=vm​a​xv_{3}=v_{max} a5=am​a​xa_{5}=a_{max} t7=0t_{7}=0
VEL t2=0t_{2}=0 v3=vm​a​xv_{3}=v_{max} t6=0t_{6}=0 t7=0t_{7}=0
Equations 2–5
𝒮​1:(p0,pf,v0,vf,a0,af,vm​a​x,am​a​x,am​i​n,jm​a​x)\displaystyle\mathcal{S}1:(p_{0},p_{f},v_{0},v_{f},a_{0},a_{f},v_{max},a_{max},a_{min},j_{max})
↦(t1,t2,t3,t4,t5,t6,t7)\displaystyle\quad\mapsto(t_{1},t_{2},t_{3},t_{4},t_{5},t_{6},t_{7})
tk\displaystyle t_{k}~ ≥0.\displaystyle\geq~0.
ak+1\displaystyle a_{k+1} =ak+sk​jk​tk,\displaystyle=a_{k}+s_{k}j_{k}t_{k}, (2)
vk+1\displaystyle v_{k+1} =vk+ak​tk+sk​jk2​tk2,\displaystyle=v_{k}+a_{k}t_{k}+\frac{s_{k}j_{k}}{2}t_{k}^{2}, (3)
pk+1\displaystyle p_{k+1} =pk+vk​tk+ak2​tk2+sk​jk6​tk3\displaystyle=p_{k}+v_{k}t_{k}+\frac{a_{k}}{2}t_{k}^{2}+\frac{s_{k}j_{k}}{6}t_{k}^{3} (4)
am​i​n<{a1,a3,a5}\displaystyle a_{min}<\{\,a_{1},a_{3},a_{5}\,\} <am​a​x\displaystyle<a_{max}
vm​i​n<vk−ak22​sk​jk\displaystyle v_{min}<v_{k}-\frac{a_{k}^{2}}{2s_{k}j_{k}} <vm​a​xifak⋅ak+1≤0,\displaystyle<v_{max}\quad\text{if}\quad a_{k}\cdot a_{k+1}\leq 0,
vm​i​n<vk\displaystyle v_{min}<v_{k} <vm​a​xifak=0.\displaystyle<v_{max}\quad\text{if}\quad a_{k}=0.
T=∑k=17tk.\displaystyle T=\sum_{k=1}^{7}t_{k}. (5)

IV-C Blocked Duration Intervals

A feasible axis cannot necessarily reach its target at every duration above its minimum. Nonzero target derivatives can create up to two blocked intervals. Their boundaries come from neighboring extremal profiles, making those profiles sufficient to characterize synchronization feasibility.

Related references: [8].

000.50.5111.51.5222.52.5−1-10011Time t⁡[s]t\,[s]Position pp, Velocity vv, Acceleration aa [a.u.]AccelerationVelocityPosition
Fig. 3: Example of a single blocked interval: Given p0=−0.75p_{0}=-0.75, pf=0.75p_{f}=0.75, and v0=vf=1.0v_{0}=v_{f}=1.0. No trajectory is physically possible with a duration below tm​i​n=1.35t_{min}=1.35 and between t∈(2.0,2.6)t\in(2.0,2.6).
Velocity Acceleration Max. Number of Blocked Intervals
vf=0v_{f}=0 af=0a_{f}=0 0
vf≠0v_{f}\neq 0 af=0a_{f}=0 1
- af≠0a_{f}\neq 0 2

IV-D Minimum Duration

Candidate synchronized durations are the axes’ minimum times and right endpoints of blocked intervals, including braking prefixes. The first candidate admissible for every axis is the overall minimum duration.

DoF 1DoF 2DoF 3T3​m​i​nT_{3min}T1​m​i​nT_{1min}T2​m​i​nT_{2min}T1​αT_{1\alpha}T3​αT_{3\alpha}T1​βT_{1\beta}
Fig. 4: Example of finding the minimum non-blocked duration of multiple degrees of freedom. Shown are the blocked intervals (gray), possible minimum duration (red), possible braking pre-trajectories (blue), and the final minimum duration (black).
Equation
Tf∈\displaystyle T_{f}~\in~ {∀i∈{0,…,N}:\displaystyle\{~\forall i\in\{0,\dots,N\}:
Ti​b+Ti,m​i​n,\displaystyle\quad T_{ib}+T_{i,min},
Ti​b+Ti​α if α exists ,\displaystyle\quad T_{ib}+T_{i\alpha}\quad\text{ if $\alpha$ exists },
Ti​b+Ti​β if β exists }\displaystyle\quad T_{ib}+T_{i\beta}\quad\text{ if $\beta$ exists }\}

IV-E Step 2: Time Synchronization

The limiting axis retains its extremal profile. Other axes adjust velocity plateaus or reduce jerk until they reach their targets at the same duration. The implementation checks the possible synchronized profiles and accepts the first valid one.

Equation
𝒮​2:(Tp,p0,pf,v0,vf,a0,af,vm​a​x,am​a​x,am​i​n,jm​a​x)\displaystyle\mathcal{S}2:(T_{p},p_{0},p_{f},v_{0},v_{f},a_{0},a_{f},v_{max},a_{max},a_{min},j_{max})
↦(t1,t2,t3,t4,t5,t6,t7,jf)\displaystyle\quad\mapsto(t_{1},t_{2},t_{3},t_{4},t_{5},t_{6},t_{7},j_{f})

IV-F New State

Integrate each constant-jerk phase to obtain position, velocity, and acceleration. During normal control cycles only state evaluation repeats; changing the input state, target, or limits triggers trajectory recomputation.

Equation
∑i=1sti≤t\displaystyle\sum_{i=1}^{s}t_{i}\leq t

V Experimental Results

The reported implementation uses dependency-free C++17, prederived symbolic equations, a polynomial solver, and a Python wrapper. Experiments focus on its complete position-control interface.

V-A Robustness

More than one billion randomized trajectories with up to seven degrees of freedom meet the reported tolerances in the tested range: position and velocity error below 10⁻⁸, acceleration error below 10⁻¹². Long durations amplify floating-point error, so the result depends on numerical scale and admissible test conditions. With zero target acceleration, trajectory durations agree with Reflexxes Type IV within 10⁻⁶.

Equations
p0,pf\displaystyle p_{0},\,p_{f} ∼𝒩⁡(σ=4.0)\displaystyle\sim\mathcal{N}(\sigma=4.0)
v0,vf,a0,af\displaystyle v_{0},\,v_{f},\,a_{0},\,a_{f} ∼𝒩⁡(σ=0.8)\displaystyle\sim\mathcal{N}(\sigma=0.8)
vm​a​x,am​a​x,jm​a​x\displaystyle v_{max},\,a_{max},\,j_{max} ∼𝒢⁡(2.0,2.0)+0.05\displaystyle\sim\mathcal{G}(2.0,2.0)+$0.05$
|Δp|<10−8,|Δv|<10−8,|Δa|<10−12\displaystyle|\Delta_{p}|<10^{-8},\quad|\Delta_{v}|<10^{-8},\quad|\Delta_{a}|<10^{-12}
T\displaystyle T =ΔpΔa≈1×10−82×10−16=7.1×103\displaystyle=\sqrt{\frac{\Delta_{p}}{\Delta_{a}}}\approx\sqrt{\frac{$1\text{\times}{10}^{-8}$}{$2\text{\times}{10}^{-16}$}}=$7.1\text{\times}{10}^{3}$

V-B Calculation Duration

For seven degrees of freedom on the reported single-threaded i7-8700K setup, mean calculation time is 19.8 μs and the measured worst case is 123 μs. Mean cost scales approximately linearly with axis count. These timings characterize the tested hardware and input distribution.

TABLE III: Calculation Performance for 7 degrees of freedom
Mean [μ​s\mu\mathrm{s}] Worst [μ​s\mu\mathrm{s}]
Ruckig (ours) (af≠0)(a_{f}\neq 0) 19.8±±0.219.8\pm\pm 0.2 123±±13123\pm\pm 13
Reflexxes Type IV (af=0)(a_{f}=0) 38.4±±0.438.4\pm\pm 0.4 155±±35155\pm\pm 35
opt_\_control (af≠0)(a_{f}\neq 0) 727±±7727\pm\pm 7 3203±±5043203\pm\pm 504
2244668810101212141400100100200200Degrees of freedom (DoFs) NNCalculation duration [μ​s\mu\mathrm{s}]MeanWorst
Fig. 5: Calculation performance depending on the number of degrees of freedom (DoFs).
000.10.10.20.20.30.30.40.40.50.50.60.6000.10.10.20.20.30.30.40.40.50.50.60.60.70.7×\timesA×\timesB×\timesC×\timesDxx [m]yy [m]Trajectory - Top View000.20.20.40.40.60.60.80.8111.21.21.41.41.61.6−1.5-1.5−1-1−0.5-0.5000.50.5111.51.5degree of freedom xx [a.u.]AccelerationVelocityPosition000.20.20.40.40.60.60.80.8111.21.21.41.41.61.6−1.5-1.5−1-1−0.5-0.5000.50.5111.51.5Time tt [s]degree of freedom yy [a.u.]
Fig. 6: An example application in the field of human robot collaboration (HRC): The robot pick-and-places an object from (A) to (B). However, a worker accidentally enters the range of the robot (dashed) and triggers a safety violation at (C). Ruckig calculates a time-optimal trajectory within one control cycle to a pre-defined state (D) within a safe zone (gray). Notably, the velocity limits towards the human are near zero (due to the safety) and much larger in the opposed direction (limited by the robot dynamics). This results in the desired behavior that the robot first brakes the velocity as fast as possible and then moves to the safe zone.

V-C Real-world Experiments

Integration with the Franka Emika Panda runs at a 1 ms control period. The method supports joint-space and Cartesian parameterizations, including an elbow coordinate.

V-C 1 Online Reaction to Sensor Input

The demonstration reacts to a person entering the workspace by limiting motion toward them while allowing faster motion away. Direction-dependent bounds make this behavior expressible through the trajectory interface.

V-C 2 Offline Trajectory Planning

Nonzero waypoint acceleration allows a jerk-limited robot to contact an object smoothly at high acceleration, accelerate it, and then decelerate. The original waypoint table and trajectory plot specify this example.

Position [m][m] Velocity [m/s][m/s] Acceleration [m/s2][m/s^{2}]
0 00 00 00
1 00 00 1.21.2
2 0.680.68 1.01.0 00
3 00 00 00
0011223344556677−2-2−1.5-1.5−1-1−0.5-0.5000.50.5111.51.522Kinematic state [a.u.]JerkAccelerationVelocityPositionT1T_{1}TvT_{v}T2T_{2}T3T_{3}
Fig. 7: An example for offline planning of the following task: An object placed at p=0p=0 should be accelerated to a target velocity (without jerk constraints) in the shortest time possible by a robot (with jerk constraint). The robot starts from rest (T0T_{0}). As no impact should occur (otherwise leading to an acceleration violation), the contact between object and robot (gray) should happen at zero velocity but with maximum acceleration (T1T_{1}). After the object reaches its velocity (TvT_{v}), the robot brakes and reaches its maximum velocity (T2T_{2}). Then, the robot moves back to its origin (T3T_{3}) with reduced velocity.

VI Discussion and Outlook

Enumerating profiles before selecting them simplifies synchronization compared with a large decision tree. The contribution concerns kinematic state-to-state timing under the specified bounds; richer path-following through intermediate waypoints is future work.

Related references: [7], [8], [2], [3], [5], [1], [13], [11].

Concept demonstration

Open image ↗