How SFRotation Works in 3D World Editor?

7 Ansichten (letzte 30 Tage)
Andrew Poissant
Andrew Poissant am 4 Apr. 2019
Bearbeitet: Muhammet Dabak am 29 Sep. 2021
I am trying to hook up my UAV Simulink model to VR Sink by sending translation and rotation values from my model to VR Sink. I am able to successfully input translation values but I am confused on how I can send my model's Euler angles. I have the following rotation angles that I am trying to send to VR Sink: roll (reference frame is x-axis counter-clockwise), pitch (reference frame is y-axis counter-clockwise), and yaw (reference frame is z-axis counter-clockwise). How do I convert these Euler angles with their respective reference frames to a 4 element vector that is required in VR Sink?

Antworten (1)

Muhammet Dabak
Muhammet Dabak am 14 Okt. 2020
Bearbeitet: Muhammet Dabak am 29 Sep. 2021
function vector=Rotator(yaw,pitch,roll)
rRoll=[cosd(roll),-sind(roll),0;sind(roll),cosd(roll),0;0,0,1];
rYaw=[cosd(yaw), 0, sind(yaw); 0,1,0; -sind(yaw) ,0, cosd(yaw)]
rPitch=[1, 0, 0; cosd(pitch), -sind(pitch), 0 ;0 ,sind(pitch) ,cosd(pitch)]
Rotation = rYaw*rPitch*rRoll;
vector=vrrotmat2vec(Rotation);
end
Roll,yaw,pitch angles' order can change due to your coordinate system, you can arrange it.
For any question, I will be glad to answer related to V-Realm Builder & 3D World Editor

Kategorien

Mehr zu Simulink finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by