[robot]Quaternions and Rigid Transformations
2017-05-12 15:28
197 查看
四元数定义
单位四元数
这一性质十分有用。
由于多次的旋转矩阵间相乘会导致误差累积,相乘次数越多误差越大。
如果利用单位四元数表示旋转矩阵,相乘后得到另一个单位四元数,这时对这个四元数进行renormalize就可以提高精度。
群
共轭
先进性
这一表示形式在机器人学,计算机视觉有着广泛应用。
旋转表示方式的总结
rigid-transformation
inverting rigid transformation
SpecialEulerianGroup
exercise
code
function q=quatprod(q1,q2) % All quaternions q, q1 and q2 are represented as 1-by-4 row vectors q=zeros(1,4); u0 = q1(1); u = q1(2:end); v0 = q2(1); v = q2(2:end); q(1)= u0 * v0 - u * v'; temp = u0 * v + v0 * u + cross(u, v); q(2)=temp(1); q(3)=temp(2); q(4)=temp(3); end
visualized rotation
% rand(3,1) generates a random 3 by one column vector. We use this u to plot u=rand(3,1)*2-1; % plot the origin plot3(0,0,0,'.k') % axis setting axis vis3d axis off % generate a random rotation matrix R theta = 2*pi*rand(); w = rand(1,3); w = w / norm(w); k0 = cos(theta/2); k = sin(theta/2) * w; R = (k0^2 - (k*k'))*eye(3) + 2*k0*[0,-k(3),k(2);k(3),0,-k(1);-k(2), k(1),0] + 2 * (k' * k); % plot the x axis plot3([0,1],[0,0],[0,0],'r'); text(1,0,0,'x'); hold on; % plot the y axis plot3([0,0],[1,0],[0,0],'g'); text(0,1,0,'y'); hold on; % plot the z axis plot3([0,0],[0,0],[1,0],'b'); text(0,0,1,'z'); hold on; % plot the original vector u plot3([0,u(1)],[0,u(2)],[0,u(3)],'k--'); % black-dashed-line text(u(1),u(2),u(3),['u','(',num2str(u(1),'%.3f'),',',num2str(u(2),'%.3f'),',',num2str(u(3),'%.3f'),')']); hold on; % apply rotation and calcuate v plot the vector after rotation v v = R * u; % plot the new vector v plot3([0,v(1)],[0,v(2)],[0,v(3)],'k:'); % black-dotted-line text(v(1),v(2),v(3),['v','(',num2str(v(1),'%.3f'),',',num2str(v(2),'%.3f'),',',num2str(v(3),'%.3f'),')']); hold on;
相关文章推荐
- 【CF1073C】Vasya and Robot(二分,构造)
- [Compose] Isomorphisms and round trip data transformations
- CodeForces 321 A - Ciel and Robot
- Reactive Programming with RxJava-Chapter3:Operators and Transformations(2)
- 7.【cocos2d翻译系列】Actions, Transformations and Effects--Composition actions
- 8.【cocos2d翻译系列】Actions, Transformations and Effects--Ease actions
- Badminton-playing robot and energy efficiency software
- CF 322C - Ciel and Robot 计算周期
- 精图规范1.0----7 坐标系, 变换和单位Coordinate Systems, Transformations and Units
- Transformations between ECEF and ENU coordinates
- C. Santa Claus and Robot 思考题
- 流体力学学习笔记1(Two-way of coupling of fluids to rigid and deformable solids and shells)
- Robotuim学习FAQ-问题4:The connection to adb is down, and a severe error has occured(Android模拟器端口被占用
- 转载:The Matrix and Quaternions FAQ
- Color Transformations and the Color Matrix
- SSIS 阻塞,半阻塞和全阻塞 (Non-blocking, semi-blocking and Fully-blocking) transformations清单
- OpenGL学习脚印: 坐标和变换的数学基础(math-coordinates and transformations)
- Reactive Programming with RxJava-Chapter3:Operators and Transformations(1)
- The robot API &&How to add and use sensor.
- Robot Framework and Ride