# roll, pitch, yaw using tags

Hi all, I am trying to get an ardrone to fly by getting directions from tags. I am having problems correcting my roll, pitch and yaw, To be honest my code is based off of someone else, and I am not sure I understand it properly, but basically when I detect a tag (using ar_track_alvar) I then run the command:

 roll, pitch, yaw = euler_from_quaternion([data.pose.orientation.x, data.pose.orientation.y,    data.pose.orientation.z, data.pose.orientation.w])


I was hoping this would give me the roll, pitch and yaw with respect to the tag but the results I am getting don't make any sense. My roll and yaw are always either ~3.14 or ~-3,14 (roll and yaw aren't identical, one might be positive and the other negative, but they both get those values) My pitch is mostly between 0.2 and -0.2.

I could not figure out any correlation between my drones orientation and the roll, pitch and yaw I am getting, so I am assuming I am doing something completely wrong, but if Im somehow making sense then any help as to how to correct myself would be greatly appreciated.

If there is a better way to go about it I am open to suggestions.

Thanks for any help available!

edit retag close merge delete

my guess is that you're not getting the transform between the ardrone and the tag but the transform between the tag and some other coordinate system. I assume you've checked output_frame and tf tree for problems?

( 2017-10-23 23:53:20 -0500 )edit

I just realized I forgot to mention what worked for me. I actually don't know what happened, but I left the project for 2 months and coming back the coordinate systems just made sense.. One thing I did notice is that the ardrone takes care of roll and yaw by itself, and I only needed to change pitch

( 2018-03-13 01:52:36 -0500 )edit

Sort by » oldest newest most voted

I just realized I forgot to mention what worked for me. I actually don't know what happened, but I left the project for 2 months and coming back the coordinate systems just made sense.. One thing I did notice is that the ardrone takes care of roll and yaw by itself, and I only needed to change pitch

more