'Rotation matrix from body frame to an arbitrary navigation frame

I'm trying to combine IMU displacements with the time of flight sensor readings in order to navigate through the indoor environment with a non-linear Kalman filter variant. In the graphic below, I tried to give an example of the setup. S0, S1, S2, and S3 are the time of flight anchors that can measure the distance between them and the tracked device. Their locations are given in the parentheses next to their label as meters.

Example setup

I've read some papers related to this work. The thing that I could not understand is how can I project my IMU readings from the body frame to the navigation frame? The navigation frame is the arbitrary frame that I've chosen and the body frame changes with the orientation of the device. In the papers, they are using the 3D rotation matrix below to project their IMU vectors onto the navigation frame (c and s are cosine and sine functions, and the symbols are Euler angles). Aren't the Euler angles that I am going to get from a 6-axis IMU relative?

3D rotation matrix



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source