Ahrs_orientation does not work for yaw setting

@amilcarlucas

  1. AHRS_ORIENTAION parameter does not work
  2. set its value to 2, after reboot, nothing change, it should be offset 90 degree yaw,
  3. if use Here+ on GPS1 (serial port 3), change arhs_orientation value to 2, after reboot, nothing change
  4. no any error meesage

follow 2 cases AHRS_ORIENTATION works

  1. use HERE 3 GPS, I guess it uses CAN port
  2. uncheck compass in Setup/Mandatory/Compass or take off GPS(Here+). then set AHRS_ORIENTATION to 2, the yaw is offset 90 degree.

all cases are tested by Rover 4.0 and 4.1 on CubeBlack and CubeOrange

Who has same issue?
BTW, when set it’s value to Roll 90, it works, only yaw doesn’t work.

AHRS_ORIENTATION only works for internal compasses - ie for cube compass. As for external compasses - if to believe Arduplane docs:

“The setting of the orientation of external compasses is no longer required. It’s determined automatically during calibration now.”

But ahrs_orientation works Here 3, a CAN port GPS.
Confused

As I have also something fishy going on with Cube Orange internal compass (board mounted Yaw180) and Here3 - so I tested AHRS_ORIENTATION effect on Cube Orange with internal compass.

It only has effect if you recalibrate IMUs and re-level vehicle after changing AHRS_ORIENTATION (applies only to Cube internal compass).

In my case I have strange problem that compass is ~10-20 degrees off compared to phone compass as a reference.

Im starting to think that AHRS_ORIENTATION: 4 (Yaw180) and COMPASS_ORIENT: 0 (Here3 in flight direction) cannot work together. Even if I only enable external ie Here3 compass - the compass orientation is off by a large scale (~40-140 degrees or so).

The only case when Here3 starts to point into somewhat right direction (ie by having no more than 20 degree variance to phone or internal compass) is when I orient Here3 also Yaw180 physically - and both AHRS_ORIENTATION: 4 for internal compass and COMPASS_ORIENT: 4 are set.

Bug in Arduplane 4.0.9 maybe? @Alvin - any thoughts?

They should work as mentioned in Ardupilot wiki

When externally connected the COMPASS_ORIENT option operates independently of the AHRS_ORIENTATION board orientation option
Complete Parameter List — Copter documentation

Did you recalibrate after each of the change you made?