六面体靶球工装安装在三个螺旋角度尺上,测得了当前的姿态如何调整到想要的姿态?数学解析方法与matlab程序

数学等式 :  R_measure*Rz*Ry*Rx=R_desire

R_measure为当前测量的姿态矩阵 ; Rz表示绕z旋转矩阵 ; Ry绕y旋转矩阵 ; Rx绕x旋转矩阵 ;R_desire期望的姿态矩阵;绕动坐标旋转所以右乘。

clc;
clear;

syms  nx ny nz ox oy oz ax ay az   
syms  r11   r12  r13  r21   r22  r23   r31   r32  r33 
syms  alfaz  betay gamax

R_measure=[nx ox  ax;
          ny  oy  ay;
          nz oz   az]
      
R_desire=[r11   r12  r13;
         r21   r22  r23;
         r31   r32  r33]


     
% R_measure=[1.732/2  0  -0.5;
%           0        1  0;
%           0.5      0   1.732/2]     
% R_desire=[1 0  0;
%           0  1  0;
%           0 0   1] 
 
% R_measure*R
Rz=RatoryZ(alfaz)
Ry=RatoryY(betay)
Rx=RatoryX(gamax)
% R_measure*Rz*Ry*Rx=R_desire  表达式
left=Rz*Ry*Rx
right=R_measure'*R_desire

right2=inv(R_measure)*R_desire

alfaz=atan2(right2(2,1),right2(1,1))
betay=atan2(-right2(3,1),sqrt(right2(1,1)^2+right2(2,1)^2))
gamax=atan2(right2(3,2),right2(3,3))


function [R]=RatoryZ(theta)
    R=[cos(theta),     -sin(theta),   0;
       sin(theta),      cos(theta),   0; 
             0 ,              0,      1];
   end
   %%
   
   function [R]=RatoryY(theta)
    R=[cos(theta),     0,   sin(theta);
              0,      1,   0; 
            -sin(theta) , 0, cos(theta)];
   end
   
      function [R]=RatoryX(theta)
    R=[      1,             0,               0;
                0,     cos(theta),   -sin(theta); 
             0 ,    sin(theta),  cos(theta)];
   end

  • 11
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值