坐标变换:欧拉角与RPY角
机器人学(一)
一、前乘法与后乘法:
A
T
B
:
\space^A T_B:
ATB:表示同一点在B系中变换到A系中——
A
P
=
A
T
B
B
P
\space^A P=\space^A T_B \space^B P
AP= ATB BP。
\space \space \space \space \space \space \space \space \space \space \space
表示坐标系B相对于A的位姿。
注:前乘法对世界系运动,后乘对变换后坐标系运动;
机器人使用后乘法;
复合运动:
矩阵求逆:
绕任意轴旋转(如下绕k轴旋转):
注:C(下图指
T
C
C
\space ^TC_C
TCC )变换后为系C,C的 X,Y,Z 轴即为 i ,j ,k.。
注:T即为世界系(图中x ,y ,z轴),X为C系下的系T姿态。
注:T绕K旋转即为将C下的T(C下T为X)绕Z旋转:
二、欧拉角和RPY角:
一、欧拉角:
逐次换系进行变换:
E
u
l
e
r
(
ϕ
,
θ
,
ψ
)
=
R
z
(
ϕ
)
R
y
(
θ
)
R
z
(
ψ
)
(
R
o
l
l
,
P
i
t
c
h
,
Y
a
w
)
Euler(\phi,\theta,\psi)=R_z(\phi)R_y(\theta)R_z(\psi)(Roll,Pitch,Yaw)
Euler(ϕ,θ,ψ)=Rz(ϕ)Ry(θ)Rz(ψ)(Roll,Pitch,Yaw)
步骤: 1、绕z轴旋转 ϕ \phi ϕ; 2、绕y轴旋转 θ \theta θ; 3、绕z轴旋转 ψ \psi ψ.
欧拉角有12种形式,这里以z-y-z为例(用tan)解方程:
1、如果 θ = 0 , a x = a y = 0 , ϕ , θ \theta =0,a_x=a_y=0,\phi ,\theta θ=0,ax=ay=0,ϕ,θ 绕着同一个轴旋转,可自行决定二者值;
2、如果 θ ≠ 0 , ϕ = t h a n − 1 [ a y a x ] \theta \neq0,\phi=than^{-1}[\frac{a_y}{a_x}] θ=0,ϕ=than−1[axay]或者 t h a n − 1 [ a y a x ] + 180 ° than^{-1}[\frac{a_y}{a_x}]+180\degree than−1[axay]+180°;由此得到 ϕ \phi ϕ;
再解 θ \theta θ:若 c o s θ = a z , s i n θ = c o s ϕ a x + s i n ϕ a y , θ = t h a n − 1 [ s i n θ c o s θ ] cos\theta=a_z,sin\theta=cos\phi a_x+sin\phi a_y,\theta=than^{-1}[\frac{sin\theta}{cos\theta}] cosθ=az,sinθ=cosϕax+sinϕay,θ=than−1[cosθsinθ];
最后解 ψ \psi ψ: s i n ψ = − s i n ϕ n x + c o s ϕ n y , c o s ψ = − s i n ψ o x + c o s ϕ o y sin\psi=-sin\phi n_x+cos\phi n_y,cos\psi=-sin\psi o_x+cos \phi o_y sinψ=−sinϕnx+cosϕny,cosψ=−sinψox+cosϕoy,同理:
ψ = t h a n − 1 [ s i n ψ c o s ψ ] \psi=than^{-1}[\frac{sin\psi}{cos\psi}] ψ=than−1[cosψsinψ]
二、RPY角:
均对世界系变换:
R
P
Y
(
ϕ
,
θ
,
ψ
)
=
R
z
(
ϕ
)
R
y
(
θ
)
R
x
(
ψ
)
RPY(\phi,\theta,\psi)=R_z(\phi)R_y(\theta)R_x(\psi)
RPY(ϕ,θ,ψ)=Rz(ϕ)Ry(θ)Rx(ψ)
步骤:1、绕x轴旋转 ψ \psi ψ; 2、绕y轴旋转 θ \theta θ; 3、绕z轴旋转 ϕ \phi ϕ;
R P Y ( ϕ , θ , ψ ) RPY(\phi,\theta,\psi) RPY(ϕ,θ,ψ)的奇异点出现在 ± 90 ° \pm90\degree ±90°,讨论与上述类似。
二种过程不一样,结果一样。