quat2angle different result
이전 댓글 표시
Hello everybody.
I am using the quat2angle function to analyse the yaw, pitch and roll of my sensor data. For that I did a Testfile, which looks fine, but on the original data there a lot of jumps. You can see it on the plots attached. Does anybody have an idea where jumps the jumps are comming from and any suggestions to get it as smooth as the testfile?
Test Original


It should be almost the same movement... The only difference is, that the testfile was recorded in the lab and the original data on a canoe on water.
PRY = compact(quaternion(w,x,y,z));
figure ('Name','p r y')
[yaw, pitch, roll] = quat2angle(PRY);
subplot(3,1,1);
plot(t, yaw)
title('yaw')
ylabel('Winkel (rad)')
legend('yaw','Location','NorthEastOutside')
subplot(3,1,2);
plot(t, pitch)
title('pitch')
ylabel('Winkel (rad)')
legend('pitch','Location','NorthEastOutside')
subplot(3,1,3);
plot(t, roll)
title('roll')
ylabel('Winkel (rad)')
legend('roll','Location','NorthEastOutside')
axes('pos',[.6 .5 .5 .3])
imshow('Roll_pitch_yaw_gravitation_center_de.png')
댓글 수: 3
James Tursa
2020년 11월 12일
Could be the sign ambiguity of the quaternion or a rollover of angles for the Euler Angles. Can you post a small subset of the data you are using that encompasses one of these jumps?
Sven Dietrich
2020년 11월 13일
James Tursa
2020년 11월 14일
I don't see any sign flipping in the quaternion data you posted.
답변 (1개)
David Goodmanson
2020년 11월 14일
0 개 추천
Hi Sven,
it's pretty clear that both test and original have discontinuities because the function producing the angles, probably atan2, has range -pi to pi. That's clearest in the test roll plot, where the data drops below -pi and reappears at pi (or goes above pi and reappears at -pi). A straightforward way to fix that is to run those angles through the unwrap function.
Since the jumps are +-2*pi, keeping them or removing them makes no difference one you plug them into a trig function.
카테고리
도움말 센터 및 File Exchange에서 Quaternion Math에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!