# Mounting the GPS/Compass

The GPS/Compass should be mounted on the frame as far away from other electronics as possible, with the direction marker pointing towards the front of the vehicle. The diagram below shows the heading marker on the Pixhawk 4 and compass.

Connect compass/GPS to Pixhawk 4

# Compass Orientation

The compass can also be mounted in any other supported orientation, where the supported orientations can be seen in CAL_MAGn_ROT, and have the same meaning as used for orienting the flight controller.

If you're using the normal Compass Calibration process the parameter CAL_MAG_ROT_AUTO is enabled, and the orientation should be detected automatically.

WARNING

You must mount the compass in a supported orientation!

If you mount the compass at an orientation that isn't supported, for example Yaw 30, PX4 will detect the closest supported value. This will result in errors/warnings, even if the calibration appeared to succeed.