Heads up for those using Linux boards with HMC5883L sensor.
I merged a long standing pending PR this week that from what I can see will not affect other people: https://github.com/ArduPilot/ardupilot/pull/3792. However, please please be careful and double check the compass orientation in your board still makes sense. Particularly if it’s an internal compass. If you have an external compass, you may benefit from a new constructor now that allows the compass to be forced as external. This allows users not to have to set the compass as external via a param in GCS.
@LanderU why do you need to change AP_Compass.cpp to conditionally add the compass?
I think the additional rotation is needed probably because we are now doing a ROTATION_YAW_90 before the call to rotate_field() which, for external compasses will to the MAG_BOARD_ORIENTATION rotation plus the user selectable rotation.
Without the code context to your change in AP_Compass_HMC5843.cpp I’m not sure what would be the value, but you should probably set the rotation for external compasses via a param, and that will depend on how you orient your external compass.
@lucasdemarchi That’s probably it. The rotation was moved so that the user selectable orientation could be with respect to the “arrow” that appears on the compass+gps kit. The idea is that the user wouldn’t need to set additional orientation if the kit is aligned with the board orientation.
I believe so. But I still think the change in the order is the right way to go for now.