Let's suppose to have a car with a reference system called Body-NED with its origin in the center of gravity of the car, Xb-axis (called North) pointing towards the front of the car, Yb-axis (called East) pointing towards the right door and Zb-axis (called Down) pointing...down the street of course
On this car there is a magnetometer to measure the magnetic field.
Finally we have the Earth's magnetic field that has it's own reference system called Earth-NED with center in the Earth's surface where the car is located and with X-North and Y-East axes laying on the plane perpendicular to Earth's gravity field, while Z-Down is parallel to Earth's gravity field: therefore, X-North points toward magnetic North and Y-East is perpendicular to X-North and Z-Down as regards to the right hand rule.
The Earth's magnetic field is a vector H with components He_x, He_y and He_z with respect to Earth-NED X,Y,Z reference.
Three attitude angles for the car are referenced to the local horizontal plane which is perpendicular to Earth’s gravity.
Yaw is defined as the angle between the Xb axis and the magnetic north on the horizontal plane measured in a clockwise direction when viewing from the top of the car.
Pitch is defined as the angle between the Xb axis and the horizontal plane. When the car is rotating around the Yb axis with the Xb axis moving upwards, pitch is positive and increasing.
Roll is defined as the angle between the Yb axis and the horizontal plane. When the car is rotating around the Xb axis with the Yb axis moving downwards, roll is positive and increasing.
What's the magnetic field measured by the magnetometer on the car?
I know that there are three rotation matrices built on yaw, pitch and roll angles and the product of them has to be used, but I'm confused about the sequence and the change of reference system.
Can you help me please?