How do I calculate roll,pitch and yaw value from the position co ordinates of the drone, that is x,y and z from the gps sensor??? Using the x,y and z co ordinates I have to calculate roll,pitch and yaw. What is the equation for this??
The position coordinates x, y, z are inadequate information to compute the roll pitch and yaw.
x, y, and z are the position of the vehicle in space. roll, pitch, and yaw are the attitude or orientation. They can change independently. Aka you can change the orientation of the vehicle independently from the position of the vehicle.
It is not possible to calculate your roll - pitch - yaw angles from linear position information. If you are using a simulated robot with sensors, you can use the gyroscope readings from the IMU sensor, that way you are going to have the angular velocities in three axes. You can then integrate this readings to get angular position. However, because of the integration, the error is going to increase rapidly; therefore you need to combine these readings with some additional sensors (magnetometer, accelerometer) to improve accuracy - you can check Complementary and Kalman Filter for that.
use a compact module that has gyroscope and compass sensor
- "X" angle as your "Roll" angle
- "Y" angle as your "Pitch" angle
- and the compass data that gives you the "Azimuth" or "bearing" and it's you "Yaw" angle
you can check this out :