How to move a drone by a given distance using ardrone_autonomy
I am working on a script for controlling a drone with ardrone_autonomy
package, and I want to create a code for moving it by a given distance. Right now I implemented code base on these tutorials:
However, a problem with the drone is that it is quite unpredictable and it doesn't follow simple patterns in the above examples. I would like to create a more precise system for it. Right now I was thinking about two solutions. First is to use information from the Navdata
subscriber.
Implementing rotating the drone along z-axis shouldn't be that difficult using rotZ
parameter. However, there are no simple parameters for controlling the drone's position. I thought about velocity or acceleration parameters, but I do not know how to use it in order to perform an appropriate movement. Also, I would like to adjust the drone's position if it does some 'unwanted' moves, what happens sometimes.
On the other hand, I was considering using some SLAM algorithm, but it might not be the best way to go, because it seems to be quite an overcomplicated approach to this problem. Also, it might not work really well outside with a big free space around (no points of reference), however, I have to admit that I do not know much about SLAM, so correct me if I am wrong.
What would be the best way to go, and how to implement it? Is any of my suggestions reasonable?
Have you looked into using a PID controller or some variation? This is straightforward and can work quite well.