mirror of https://github.com/ArduPilot/ardupilot
Copter: Update compass to the new interface
This commit is contained in:
parent
95a1ab0cab
commit
79e152cd93
|
@ -257,19 +257,7 @@ static AP_Int8 *flight_modes = &g.flight_mode1;
|
|||
|
||||
static AP_Baro barometer;
|
||||
|
||||
#if CONFIG_COMPASS == HAL_COMPASS_PX4
|
||||
static AP_Compass_PX4 compass;
|
||||
#elif CONFIG_COMPASS == HAL_COMPASS_VRBRAIN
|
||||
static AP_Compass_VRBRAIN compass;
|
||||
#elif CONFIG_COMPASS == HAL_COMPASS_HMC5843
|
||||
static AP_Compass_HMC5843 compass;
|
||||
#elif CONFIG_COMPASS == HAL_COMPASS_HIL
|
||||
static AP_Compass_HIL compass;
|
||||
#elif CONFIG_COMPASS == HAL_COMPASS_AK8963
|
||||
static AP_Compass_AK8963_MPU9250 compass;
|
||||
#else
|
||||
#error Unrecognized CONFIG_COMPASS setting
|
||||
#endif
|
||||
static Compass compass;
|
||||
|
||||
AP_InertialSensor ins;
|
||||
|
||||
|
|
|
@ -1031,12 +1031,6 @@ static void load_parameters(void)
|
|||
ahrs._kp_yaw.set_and_save(0.1);
|
||||
}
|
||||
|
||||
// setup different Compass learn setting for ArduCopter than the default
|
||||
// but allow users to override in their config
|
||||
if (!compass._learn.load()) {
|
||||
compass._learn.set_and_save(0);
|
||||
}
|
||||
|
||||
if (!g.format_version.load() ||
|
||||
g.format_version != Parameters::k_format_version) {
|
||||
|
||||
|
|
|
@ -44,12 +44,6 @@
|
|||
#error CONFIG_HAL_BOARD must be defined to build ArduCopter
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// sensor types
|
||||
|
||||
#define CONFIG_BARO HAL_BARO_DEFAULT
|
||||
#define CONFIG_COMPASS HAL_COMPASS_DEFAULT
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// HIL_MODE OPTIONAL
|
||||
|
||||
|
|
|
@ -477,13 +477,13 @@ static void report_compass()
|
|||
|
||||
// motor compensation
|
||||
cliSerial->print_P(PSTR("Motor Comp: "));
|
||||
if( compass.motor_compensation_type() == AP_COMPASS_MOT_COMP_DISABLED ) {
|
||||
if( compass.get_motor_compensation_type() == AP_COMPASS_MOT_COMP_DISABLED ) {
|
||||
cliSerial->print_P(PSTR("Off\n"));
|
||||
}else{
|
||||
if( compass.motor_compensation_type() == AP_COMPASS_MOT_COMP_THROTTLE ) {
|
||||
if( compass.get_motor_compensation_type() == AP_COMPASS_MOT_COMP_THROTTLE ) {
|
||||
cliSerial->print_P(PSTR("Throttle"));
|
||||
}
|
||||
if( compass.motor_compensation_type() == AP_COMPASS_MOT_COMP_CURRENT ) {
|
||||
if( compass.get_motor_compensation_type() == AP_COMPASS_MOT_COMP_CURRENT ) {
|
||||
cliSerial->print_P(PSTR("Current"));
|
||||
}
|
||||
Vector3f motor_compensation;
|
||||
|
|
Loading…
Reference in New Issue