mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 00:28:30 -04:00
AP_Compass: removed spurious rotation in PX4 backend
and cleanup rotation macros
This commit is contained in:
parent
d7bac39539
commit
86fc90f54c
@ -119,10 +119,6 @@ void AP_Compass_PX4::read(void)
|
|||||||
_sum[i] /= _count[i];
|
_sum[i] /= _count[i];
|
||||||
_sum[i] *= 1000;
|
_sum[i] *= 1000;
|
||||||
|
|
||||||
// apply default board orientation for this compass type. This is
|
|
||||||
// a noop on most boards
|
|
||||||
_sum[i].rotate(MAG_BOARD_ORIENTATION);
|
|
||||||
|
|
||||||
publish_field(_sum[i], _instance[i]);
|
publish_field(_sum[i], _instance[i]);
|
||||||
|
|
||||||
_sum[i].zero();
|
_sum[i].zero();
|
||||||
|
@ -24,27 +24,11 @@
|
|||||||
#define AP_COMPASS_MOT_COMP_THROTTLE 0x01
|
#define AP_COMPASS_MOT_COMP_THROTTLE 0x01
|
||||||
#define AP_COMPASS_MOT_COMP_CURRENT 0x02
|
#define AP_COMPASS_MOT_COMP_CURRENT 0x02
|
||||||
|
|
||||||
// setup default mag orientation for each board type
|
// setup default mag orientation for some board types
|
||||||
#if CONFIG_HAL_BOARD == HAL_BOARD_APM1
|
#if CONFIG_HAL_BOARD == HAL_BOARD_APM1
|
||||||
# define MAG_BOARD_ORIENTATION ROTATION_ROLL_180
|
# define MAG_BOARD_ORIENTATION ROTATION_ROLL_180
|
||||||
#elif CONFIG_HAL_BOARD == HAL_BOARD_APM2
|
|
||||||
# define MAG_BOARD_ORIENTATION ROTATION_NONE
|
|
||||||
#elif CONFIG_HAL_BOARD == HAL_BOARD_FLYMAPLE
|
|
||||||
# define MAG_BOARD_ORIENTATION ROTATION_NONE
|
|
||||||
#elif CONFIG_HAL_BOARD == HAL_BOARD_PX4
|
|
||||||
# define MAG_BOARD_ORIENTATION ROTATION_NONE
|
|
||||||
#elif CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL
|
|
||||||
# define MAG_BOARD_ORIENTATION ROTATION_NONE
|
|
||||||
#elif CONFIG_HAL_BOARD == HAL_BOARD_LINUX
|
|
||||||
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_NAVIO
|
|
||||||
# define MAG_BOARD_ORIENTATION ROTATION_NONE
|
|
||||||
#else
|
|
||||||
# define MAG_BOARD_ORIENTATION ROTATION_NONE
|
|
||||||
#endif
|
|
||||||
#elif CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
|
|
||||||
# define MAG_BOARD_ORIENTATION ROTATION_NONE
|
|
||||||
#else
|
#else
|
||||||
# error "You must define a default compass orientation for this board"
|
# define MAG_BOARD_ORIENTATION ROTATION_NONE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user