Hello forum-users!

I have two BNO055 attached to the Arduino and they operate in fusion mode NDOF to show their orientation in space. They show the absolute orientation with respect to the earths magnetic field as said in the data sheet. Now I attach them to a device and would like to transform the starting position, so that it is (0,0,0). So I am struggeling with rotating the earths coordinate system (CS) into the coordinate system of the body. My first approach of calculating the rotation matrix with the Euler angles at the starting position and multiplying it with the vector containing the starting positions did not work.

I know that this is more a theoretical question, but maybe so of you guys have come across this problem and can give me some hint. Would be awesome.