atan2 problem with drone
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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.
0 Commenti
Risposte (1)
David Sanchez
il 26 Ago 2013
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.
0 Commenti
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!