Translate Pitch and Roll Angles of Object to those at different Yaw

I have been trying to find a method to translate the pitch and roll angles of one object to those of another connected object at a different yaw - i.e I have an IMU mounted on a quadcopter frame and a 3 axis gimbal mounted below.

If the gimbal is pointed straight ahead its pitch and roll values equal that of the IMU - however if the gimbal is rotated to say 30 degrees (relative to the frame) the pitch and roll values of the gimbal are now different from that of the IMU.

Could someone please provide the method to translate the pitch and roll angles of the frame to those that the gimbal is experiencing at a certain yaw angle.

I can easily solve this problem by mounting another IMU on the gimbal itself and using its pitch and roll values to stabilise the camera, but would like to know the mathematical solution.

Any help would be greatly appreciated.

I need to find the method to calculate the pitch and roll angles of the gimbal when knowing the pitch and roll of the frame and the yaw angle at which the gimbal is rotated relative to the frame.

• Do you have a picture of your design? It would be easier for me to visualize what you are talking about, are you adjusting your camera with the quadcopter's movements? – Riley Carney Feb 4 '16 at 23:45
• Thanks for the reply, have edited the question to include a image - hopefully this makes things clearer. – Blues_breaker Feb 5 '16 at 0:10
• If you want, I can work on it tonight, thought you were using a different design for the camera movement, so it'll be a little harder. – Riley Carney Feb 5 '16 at 0:16
• Any help would be great, thanks – Blues_breaker Feb 5 '16 at 0:23