Copter: Update compass to the new interface

This commit is contained in:
Víctor Mayoral Vilches 2014-11-15 18:01:41 -08:00 committed by Andrew Tridgell
parent 95a1ab0cab
commit 79e152cd93
4 changed files with 4 additions and 28 deletions

View File

@ -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;

View File

@ -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) {

View File

@ -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

View File

@ -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;