필터 지우기
필터 지우기

atan2 problem with drone

조회 수: 1 (최근 30일)
Dhruv
Dhruv 2013년 8월 26일
I am working with a drone which returns information about its orientation in the form of a rotational matrix. Hence, I get the sin and cos of the angle I finally need.
I use atan2 to get around the problem and get the angle in -180 to 180 range. I change to 0 to 360 by adding 360 to any negative values.
However, since I need to be able to give inputs like 570° (+ rotates the drone left and - rotates right)to the drone, I have a problem with the atan2 function. My controller doesnt work in such cases as the output from the drone stays between 0-360 and never reaches the desired value.
Any help is appreciated.

답변 (1개)

David Sanchez
David Sanchez 2013년 8월 26일
If I don't get it wrong, you are trying to make your drone spin around itself, aren't you. The state of you drone is obviously +/- 180º or 0/360º. You have to set a zero crossing counter to let the system know when it has completed a whole turn and keep turning until the desired angle is reached.

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by