필터 지우기
필터 지우기

I use dcm2quat function in a function block in simulink but it doesnt work.

조회 수: 4 (최근 30일)
YILMAZ ENER
YILMAZ ENER 2020년 1월 24일
답변: Stacey Gage 2020년 3월 26일
I am working on an object tracking project and I am using MPU9250 with Arduino 2560. I have prepared my system on Simulink. I want to transform my dcm matrix to quartionen with dcmtoquat (function) and simulate with HelpOrientationViewer in a function block by simulink but it doenst work.
could you help me pls?
function dcm = fnc(roll,pitch,yaw)
x =[1 0 0; 0 cos(roll) -sin(roll); 0 sin(roll) cos(roll)];
y =[ cos(pitch) 0 -sin(pitch);0 1 0 ; -sin(pitch) 0 cos(pitch)];
z =[ cos(yaw) -sin(yaw) 0; sin(yaw) cos(yaw) 0 ; 1 0 0];
%zy = bsxfun(@times,z,y);
%dcm = bsxfun(@times,zy,x);
dcm = z*y*x;
Q =dcm2quat(dcm);
viewer = HelpOrientationViewer;
viewer(Q)
pause(.1)

답변 (2개)

Githin John
Githin John 2020년 1월 28일
Since it is not clear from your question as to what the problem is, I am assuming that the issue is that MATLAB can't find the HelperOrientationViewer (note: typo in your code). To use this class, you need the MATLAB Support Package for Arduino Hardware Installed through the Add-Ons explorer.

Stacey Gage
Stacey Gage 2020년 3월 26일
Have you tried using the Direction Cosine Matrix to Quaternions block in Aerospace Blockset?

카테고리

Help CenterFile Exchange에서 Aerospace Applications에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by