Download MATLAB Toolbox
Download Robotics toolbox
Example:
%The toolbox also supports symbolic mathematics
>> syms theta
>> R=rot2(theta)
R =
[ cos(theta), -sin(theta)]
[ sin(theta), cos(theta)]
% simplify :Symbolic simplification
>> simplify(R*R)
ans =
[ cos(2*theta), -sin(2*theta)]
[ sin(2*theta), cos(2*theta)]
>> simplify(det(R))
ans =
1
Lie Group and Lie Algebra
引用一下SLAM 十四讲中的这个图,总结了李群与李代数之间的转换关系。
Example:
>> R = rot2(0.3)
R =
0.9553 -0.2955
0.2955 0.9553
>> s = logm(R)
s =
0 -0.3000
0.3000 0
>> vex(s)
ans =
0.3000
% the result is, as expected, our original rotation matrix,
>> expm(s)
ans =
0.9553 -0.2955
0.2955 0.9553
% skew-symmetric matrix
>> syms w
>> skew(w)
ans =
[ 0, -w]
[ w, 0]
In fact the command:
>> R = rot2(0.3)
is equivalent to :
>> R = expm ( skew(0.3) )
R =
0.9553 -0.2955
0.2955 0.9553
Note:
- logm Matrix logarithm.
L = logm(A) is the principal matrix logarithm A, the inverse of expm(A). - vex Convert skew-symmetric matrix to vector.
V = vex(S) is the vector which has the corresponding skew-symmetric
matrix S. In the case that S (2x2) then V is 1x1
S = | 0 -v |
| v 0 |
Formally we can write
R
=
e
[
θ
]
x
∈
S
O
(
2
)
R = e^{[\theta]_x} \in SO(2)
R=e[θ]x∈SO(2)
where
θ
\theta
θ is the rotation angle, and the notation
[
.
]
x
:
R
⟼
R
2
X
2
[.]_x: R \longmapsto R^{2X2}
[.]x:R⟼R2X2 indicates a mapping from a scalar to a skew-symmentric matrix.