Browse Source

AP_Compass: ignore COMPASS_ORIENT for internal compass

this means if COMPASS_ORIENT is not 0 and the external compass fails
to start on boot we don't end up with a bad compass orientation
master
Andrew Tridgell 12 years ago
parent
commit
b8b72819c1
  1. 8
      libraries/AP_Compass/AP_Compass_PX4.cpp

8
libraries/AP_Compass/AP_Compass_PX4.cpp

@ -89,13 +89,13 @@ bool AP_Compass_PX4::read(void)
// a noop on most boards // a noop on most boards
_sum.rotate(MAG_BOARD_ORIENTATION); _sum.rotate(MAG_BOARD_ORIENTATION);
// add user selectable orientation
_sum.rotate((enum Rotation)_orientation.get());
// override any user setting of COMPASS_EXTERNAL // override any user setting of COMPASS_EXTERNAL
_external.set(_is_external); _external.set(_is_external);
if (!_external) { if (_external) {
// add user selectable orientation
_sum.rotate((enum Rotation)_orientation.get());
} else {
// add in board orientation from AHRS // add in board orientation from AHRS
_sum.rotate(_board_orientation); _sum.rotate(_board_orientation);
} }

Loading…
Cancel
Save