Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

How to get RPY and plugin to Quaternion

$
0
0
I have an API that takes quaternions to set the orientation of a drone. I want to fix the roll, pitch, and yaw. I currently have the following. tf::Quaternion q_new, q_curr, q_rot; // r, p, y is current vehicle orientation q_curr = tf::createQuaternionFromRPY(r, p, y); // What to plug in here ... q_rot = tf::createQuaternionFromRPY(?, ?, ?); // I think this is how to apply the new orientation to the current q_new = q_curr * q_rot; q_new.normalize(); My problem is I don't know what values to plugin to q_rot to set the new orientation. I can think in RPY values, but not quaternions. For example, I'd like to rotate the drone around the z-axis 90 degrees, or 180 around y, or 90 degrees around the x axis, etc... How does one calculate that?

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>