IMUs and magnetometer have very different placement constraints. For an IMU, you would want to minimum PCB bending stress, vibration, and Temperature changes. For the magnetometer, you want to minimize magnetic field distortions. It is usually easier to find a suitable placement with a 2-chip solution, rather than a single large sensor. I originally recommended BHI160, since you mention that you require a compass. BMX160 does not have an onboard microcontroller, and therefore does not output heading directly. For that you would need an external eCompass algorithm. BHI160 has this algorithm built-in, with a microcontroller and output directly heading.
... View more