Trajectory Planning in Cartesian Space: Robotics 1
Trajectory Planning in Cartesian Space: Robotics 1
Trajectory planning
in Cartesian space
Prof. Alessandro De Luca
Robotics 1 1
Trajectories in Cartesian space
n in general, the trajectory planning methods proposed in the
joint space can be applied also in the Cartesian space
n consider independently each component of the task vector (i.e., a
position or an angle of a minimal representation of orientation)
n however, when planning a trajectory for the three
orientation angles, the resulting global motion cannot be
intuitively visualized in advance
n if possible, we still prefer to plan Cartesian trajectories
separately for position and orientation
n the number of knots to be interpolated in the Cartesian
space is typically low (e.g., 2 knots for a PTP motion, 3 if a
“via point” is added) ⇒ use simple interpolating paths, such
as straight lines, arc of circles, …
Robotics 1 2
Planning a linear Cartesian path
(position only)
GIVEN
𝑝# 𝐿 𝑝# , 𝑝$ ∈ ℝ'; 𝑣# , 𝑣$ ∈ ℝ (typically = 0);
bounds 𝑣)*+ , 𝑎)*+ ∈ ℝ-
𝑝$
𝐿 = 𝑝$ − 𝑝#
path parameterization 𝑝$ − 𝑝#
= unit vector of directional
𝑝(𝑠) = 𝑝# + 𝑠(𝑝$ − 𝑝# ) 𝑝$ − 𝑝# cosines of the line
𝑑𝑝 𝑑>𝑝 > 𝑑𝑝
𝑝̇ 𝑠 = 𝑠̇ = 𝑝$ − 𝑝# 𝑠̇ 𝑝̈ 𝑠 = > 𝑠̇ + 𝑠̈ = 𝑝$ − 𝑝# 𝑠̈
𝑑𝑠 𝑑𝑠 𝑑𝑠
𝑝$ − 𝑝# 𝑝$ − 𝑝#
= 𝜎̇ = 𝜎̈
𝐿 𝐿
Robotics 1 3
Timing law with trapezoidal speed -1
bang-coast-bang
𝜎(𝑡)
̈ 𝑎)*+ given*: 𝐿, 𝑣)*+ , 𝑎)*+
find: 𝑇B , 𝑇
𝑡
= area of the
𝜎(𝑡)
̇ 𝑣)*+ (𝑇 − 𝑇B ) = 𝐿 speed profile
𝑣)*+
𝑡 𝑣)*+
𝑇B =
𝑎)*+
𝜎(𝑡) 𝐿 >
𝐿𝑎)*+ + 𝑣)*+
𝑇=
𝑡 𝑎)*+ 𝑣)*+
𝑇B 𝑇 − 𝑇B 𝑇
. > /𝑎
a “coast” phase exists iff 𝐿 > 𝑣)*+ )*+
𝜎(𝑡)
̈ *DEF G H
𝑎)*+ , 𝑡 ∈ [0, 𝑇B ]
>
𝑡 H
IDEF
𝑣)*+ 𝑡 − > * , 𝑡 ∈ [𝑇B , 𝑇 − 𝑇B ]
𝜎(𝑡)
̇ 𝜎 𝑡 = DEF
𝑣)*+
H H
*DEF GJK IDEF
𝑡 − + 𝑣)*+ 𝑇 −* ,
> DEF
𝑡 ∈ [𝑇 − 𝑇B , 𝑇]
𝜎(𝑡) 𝐿
discontinuous acceleration profile!
𝑡 if needed, use for instance a
𝑇B 𝑇 − 𝑇B 𝑇 a rest-to-rest quintic polynomial timing
.
can be used also in the joint space!
Robotics 1 5
Concatenation of linear paths
𝑧 𝐵 =“via point” no need to pass
(and stop!)
𝐵−𝐴
𝐶′ there
= 𝐾VW
𝐵−𝐴 unit vectors of
𝐴′ over-fly 𝐶 directional cosines
𝐶−𝐵
= 𝐾WX
𝐴 𝑦 𝐶−𝐵
𝑥(𝑡)
𝑝 𝑡 = 𝑦(𝑡) 𝑡 ∈ [0, ∆𝑇] (transition starts at 𝑡 = 0)
𝑧(𝑡)
note: during over-fly, the path remains always in the plane specified
by the two lines intersecting at 𝐵 (in essence, it is a planar problem)
Robotics 1 6
Time profiles on components
𝑥(𝑡)
̈ 𝑥(𝑡)
̇
𝑣>𝐾WX,+
𝑣P𝐾VW,+
D𝑇 𝑡 𝑡
𝑦(𝑡)
̈ 𝑦(𝑡)
̇
𝑣>𝐾WX,Z
𝑣P𝐾VW,Z 𝑡
𝑡
𝑧(𝑡)
̈ 𝑧(𝑡)
̇
𝑣P𝐾VW,Y
𝑣>𝐾WX,Y
𝑡
D𝑇 𝑡
Robotics 1 7
Timing law during transition
𝑧 𝐵 𝐵−𝐴
𝐶′ = 𝐾VW
𝐵−𝐴 unit vectors of
𝐴′ over-fly 𝐶 directional cosines
𝐶−𝐵
= 𝐾WX
𝐴 𝑦 𝐶−𝐵
𝑥(𝑡)
𝑥 𝑝 𝑡 = 𝑦(𝑡) 𝑡 ∈ [0, ∆𝑇] (transition starts at 𝑡 = 0)
𝑧(𝑡)
𝑝(𝑡)
̈ = (𝑣>𝐾WX − 𝑣P𝐾VW )/D𝑇 ó
õ
𝑝̇ 𝑡 = 𝑣P𝐾VW + 𝑣>𝐾WX − 𝑣P𝐾VW 𝑡/D𝑇
ó
õ thus, we obtain a
parabolic blending
𝑝 𝑡 = 𝐴[ + 𝑣P𝐾VW 𝑡 + 𝑣>𝐾WX − 𝑣P𝐾VW 𝑡 >/(2D𝑇) (see textbook
for this same approach
in the joint space)
Robotics 1 8
Solution
(various options)
𝐵 𝑑2 𝐵 − 𝐴′ = 𝑑1𝐾𝐴𝐵
𝑑1 1
𝐶′ 𝐶′ − 𝐵 = 𝑑2𝐾𝐵𝐶
𝐶
𝐴′
𝑝 𝑡 = 𝐴[ + 𝑣P𝐾VW 𝑡 + 𝑣>𝐾WX − 𝑣P𝐾VW 𝑡 >/(2D𝑇)
𝐴
𝑝(∆𝑇) = 𝐴′ + (D𝑇/2)(𝑣1 𝐾𝐴𝐵 + 𝑣2𝐾𝐵𝐶 ) = 𝐶′
by choosing, e.g., 𝑑P
D𝑇 = 2𝑑1/𝑣1 𝑑2 = 𝑑1𝑣2/𝑣1
(namely 𝐴′)
Robotics 1 9
A numerical example
n transition: 𝐴 = (3,3) to 𝐶 = (8,9) via 𝐵 = (1,9), with speed from 𝑣P = 1 to 𝑣> = 2
n exploiting two options for solution (resulting in different paths!)
n assign transition time: ∆𝑇 = 4 (we re-center it here for 𝑡 ∈ [−∆𝑇/2, ∆𝑇/2])
n assign distance from 𝐵 for departing: 𝑑P = 3 (assign 𝑑> for landing is handled similarly)
𝐵 𝐶 𝐵 𝐶
𝐴′
𝐴 𝐴
∆𝑇 = 4 𝑑P = 3
Robotics 1 10
A numerical example (cont’d)
first option: ∆𝑇 = 4 (resulting in 𝑑P = 2, 𝑑> = 4) ⇒ 𝑝̈ = 0.39 m/s2
0.5791
-0.2372
0.3860
-0.1581
𝐵
𝐶’ 𝑝(𝑡)
̈ = (𝑣> 𝐾WX − 𝑣P 𝐾VW )/D𝑇
𝐴’ 𝐶
Robotics 1 12
Application example
plan a Cartesian trajectory from 𝐴 to 𝐶 (rest-to-rest)
that avoids the obstacle 𝑂, with 𝑎 ≤ 𝑎)*+ and 𝑣 ≤ 𝑣)*+
add a via point 𝐵
𝐵 “sufficiently far” from 𝑂
𝐶′′
𝐴′′ 𝐶′
𝐴′ 𝐶
𝑂
>
n acceleration 𝑝̈ = 𝑑 𝑝 ⁄𝑑𝑠
> 𝑑𝑠 ⁄𝑑𝑡 > + 𝑑𝑝 ⁄𝑑𝑠 𝑑 > 𝑠 ⁄𝑑𝑡 > = 𝑝 [[ 𝑠̇ > + 𝑝 [ 𝑠̈
Robotics 1 14
Definition of Frenet frame
n for a smooth and non-degenerate curve 𝑝(𝑠) ∈ ℝ' , parameterized by 𝑠
(not necessarily its arc length), one can define a reference frame as shown
𝑝 [ = 𝑑𝑝/𝑑𝑠 𝑝 [[ = 𝑑 > 𝑝/𝑑𝑠 >
derivatives w.r.t. the parameter 𝑠
𝑏(𝑠) unit tangent vector
𝑡(𝑠) = 𝑝[ (𝑠)⁄ 𝑝[ (𝑠)
𝑛(𝑠) 𝑡(𝑠) unit normal vector (∈ osculating plane)
𝑛(𝑠) = 𝑡 [ (𝑠)⁄ 𝑡 [ (𝑠)
= 𝑝[ (𝑠)× 𝑝[[ (𝑠)×𝑝[ (𝑠) / 𝑝[ (𝑠) k 𝑝[[ (𝑠)×𝑝[ (𝑠)
unit binormal vector
𝑠 𝑏(𝑠) = 𝑡(𝑠) × 𝑛(𝑠)
= 𝑝[ (𝑠)×𝑝[[ (𝑠)/ 𝑝 [ (𝑠)×𝑝 [[ (𝑠)
n general expressions of path curvature and torsion (at a path point 𝑝(𝑠))
𝜅(𝑠) = 𝑝[ 𝑠 × 𝑝[[ (𝑠) ⁄ 𝑝[ (𝑠) '
𝜏(𝑠) = 𝑝[ 𝑠 k 𝑝[[ 𝑠 × 𝑝[[[ (𝑠) ⁄ 𝑝[ 𝑠 × 𝑝[[ (𝑠)) >
Robotics 1 15
Examples of paths with Frenet frame
Viviani curve
= intersection of a sphere with a tangent cylinder
𝑥 = 𝑟 cos > 𝑠
𝑦 = 𝑟 cos 𝑠 sin 𝑠
𝑧 = 𝑟 sin 𝑠
𝑠 ∈ −𝜋/2, 𝜋/2
𝑥 = 𝑟 cos > 𝑠
𝑦 = −𝑟 cos 𝑠 sin 𝑠
𝑧 = −𝑟 sin 𝑠
By Ag2gaeh - https://commons.wikimedia.org/w/index.php?curid=81698760 By Gonfer https://commons.wikimedia.org/w/index.php?curid=18558097
𝑥 = 𝑟 cos 𝑠 𝑟
𝜅=
𝑦 = 𝑟 sin 𝑠 𝑟 > + ℎ>
𝑧=ℎ𝑠 ℎ
𝜏=
𝑠 ∈ 0,2𝜋 𝑟 > + ℎ>
By Goldencako - https://commons.wikimedia.org/w/index.php?curid=7519084
Exercise
6𝑠 + 2 a) define the Frenet frame 𝑡(𝑠), 𝑛(𝑠), 𝑏(𝑠)
given the path 𝑝 𝑠 = 5𝑠 > , 𝑠 ∈ 0,1
b) compute the curvature 𝜅(𝑠) and the torsion 𝜏(𝑠)
−8𝑠
Robotics 1 16
Optimal trajectories
n for Cartesian robots (e.g., PPP joints)
1. the straight line joining two position points in the Cartesian space is one path
that can be executed in minimum time under velocity/acceleration constraints
(but other such paths exist, if (joint) motion is not coordinated)
2. the optimal timing law is of the bang-coast-bang type in acceleration (in this
special case, also in terms of motor torques)
n for articulated robots (with at least one R joint)
n 1. e 2. are no longer true in general in the Cartesian space, but time-optimality
still holds in the joint space when assuming bounds on joint velocity/acceleration
n straight line paths in the joint space do not correspond to straight line paths
Robotics 1 17
Planning orientation trajectories
𝑧V 𝑧W
𝑥V
𝐴 𝐵
𝑥W
𝑦V 𝑦W
𝑇
§ initial end-effector position 𝑝 0 = 0.540 0 1.515
𝑦(0)
§ initial orientation
0 0 1
𝑅 0 = 0 −1 0 𝑧w
1 0 0
𝜔̇ = 𝑟𝜃̈ → 𝜔̇ = 𝜃̈ triangular
speed profile 𝑠(𝑡)
̇
with minimum
time 𝑇 = 5.52 s
𝑝 𝑠 = 𝑝ƒ„ƒ‡ + 𝑠 𝑝‚ƒ„…† − 𝑝ƒ„ƒ‡ (imposed by the bounds
on linear motion)
= 0.540 0 1.515 K + 𝑠 −0.540 0.540 0 K, 𝑠 ∈ 0,1
0 0 1 0 −1 0 𝒔 = 𝒔 𝒕 , 𝒕 ∈ [𝟎, 𝑻]
K
K
𝑅ƒ„ƒ‡ = 0 −1 0 = 𝑅ƒ„ƒ‡ 𝑅ƒ„ƒ‡ 𝑅‚ƒ„…†
= 0 0 −1
1 0 0 1 0 0 𝑅 𝑠 = 𝑅ƒ„ƒ‡ 𝑅𝑜𝑡(𝑟, 𝜃 𝑠 )
= 𝑅𝑜𝑡 𝑟, 𝜃#•
1 0 0
𝑅‚ƒ„…† = 0 0 1 1 1 2𝜋 𝜃 𝑠 = 𝑠𝜃ƒ• , 𝑠 ∈ 0,1
𝑟= −1 , 𝜃ƒ• = rad (= 120°)
0 −1 0 3 1 3
Robotics 1 20
Axis-angle orientation trajectory
𝑥=
𝑦=
𝑧=
triangular
planned profile for
motion of linear speed
Cartesian 𝑇 = 5.52 s
position
and velocity
𝑇 = 5.52 𝑇 = 5.52
𝑇
§ initial end-effector position 𝑝 0 = 0.115 0 1.720
§ initial orientation 𝑥(0)
0
𝑅 0 = 0
0
−1
1
0
.
𝑧(𝑇) 𝑝(𝑇)
. 𝑝(0)
1 0 0 𝑥(𝑇) 𝑧(0)
K
§ initial Euler ZYZ 𝛼, 𝛽, 𝛾 angles 𝜙—˜— 0 = 0 𝜋/2 𝜋
Robotics 1 22
Comparison of orientation trajectories
Euler angles vs. axis-angle method
0 0 1
𝑅ƒ„ƒ‡ = 0 −1 0
1 0 0 K
𝑅ƒ„ƒ‡ 𝑅‚ƒ„…†
0 −1 0 0
⟹ 𝜙—˜—,ƒ„ƒ‡ = 𝜋/2 = 0 1 0
𝜋 0 0 −1
0 0 1 0
𝑅‚ƒ„…† =− 0 1 0 ⟹ 𝑟 = −1 ,
1 0 0 0
𝜃=𝜋
−𝜋
⟹ 𝜙—˜—,‚ƒ„…† = 𝜋/2 zw
0
yw xw
(singularity at
𝛽 = 0 avoided!)
video video
using ZYZ Euler angles using axis-angle method
Robotics 1 23
Comparison of orientation trajectories
Euler angles vs. axis-angle method
𝑥=
𝑦=
𝑧=
linear motion
only along the
x-direction
planned
Cartesian
components 𝑇 ≈ 7.2 s 𝑇≈6s
of position
and velocity
faster motion
time with the
axis-angle method
(imposed by the
previous bounds
on angular motion)
𝜶= 𝜷 = 0 (singularity of
𝜷= the ZYZ representation)
𝜸=
by post-
orientation processing
in terms of ZYZ of planned
Euler angles pre-planned axis-angle
offline motion
𝑇 ≈ 7.2 s 𝑇≈6s
actual
joint
motion only three
joints move
(#2,#3,#5)
𝑝0
𝑠 = 𝑠(𝑡) non-zero
(symmetric)
acceleration
𝑇=1
Robotics 1 27
Numerical example -2
𝑘𝑎𝑐𝑐
𝑘𝑣𝑒𝑙
= joint 1 = joint 2
Robotics 1 28
Numerical example -3
n scaled trajectory with 𝑇B“*¥¤§ = 2.898 [s]
n speed [acceleration] on path and joint velocities [accelerations] scale linearly [quadratically]
scaled by 1/𝑘 = 1/2.898 scaled by
P P
H = = 0.1191
« >.¬-¬ H