欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Representin Position and Orientation

程序员文章站 2022-05-31 08:36:25
...

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 十四讲中的这个图,总结了李群与李代数之间的转换关系。
Representin Position and Orientation

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:

  1. logm Matrix logarithm.
    L = logm(A) is the principal matrix logarithm A, the inverse of expm(A).
  2. 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[θ]xSO(2) R = e^{[\theta]_x} \in SO(2)
where θ\theta is the rotation angle, and the notation [.]x:RR2X2[.]_x: R \longmapsto R^{2X2} indicates a mapping from a scalar to a skew-symmentric matrix.