✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
⛄ 内容介绍
该项目旨在控制无人机在现实世界中的运动,以平稳快速地遵循特定轨迹。在本报告中,我们将讨论如何设计控制器和轨迹生成器以达到此目的。
⛄ 部分代码
function R = RPYtoRot_ZXY(phi,theta,psi)
%RPYtoRot_ZXY Converts roll, pitch, yaw to a body-to-world Rotation matrix
% The rotation matrix in this function is world to body [bRw] you will
% need to transpose this matrix to get the body to world [wRb] such that
% [wP] = [wRb] * [bP], where [bP] is a point in the body frame and [wP]
% is a point in the world frame
% written by Daniel Mellinger
%
R = [cos(psi)*cos(theta) - sin(phi)*sin(psi)*sin(theta), ...
cos(theta)*sin(psi) + cos(psi)*sin(phi)*sin(theta), ...
-cos(phi)*sin(theta); ...
-cos(phi)*sin(psi),...
cos(phi)*cos(psi), ...
sin(phi);...
cos(psi)*sin(theta) + cos(theta)*sin(phi)*sin(psi),...
sin(psi)*sin(theta) - cos(psi)*cos(theta)*sin(phi),...
cos(phi)*cos(theta)];
end