Copter: removed special cases for DCM gain changes on arm/disarm

copter no longer uses DCM, so it doesn't need these special cases
This commit is contained in:
Andrew Tridgell 2015-04-28 10:25:55 +10:00
parent 42d2addbdd
commit cb2427ef9e
6 changed files with 2 additions and 37 deletions

View File

@ -1034,24 +1034,10 @@ static void load_parameters(void)
hal.scheduler->panic(PSTR("Bad var table"));
}
// change the default for the AHRS_GPS_GAIN for ArduCopter
// if it hasn't been set by the user
if (!ahrs.gps_gain.load()) {
ahrs.gps_gain.set_and_save(1.0);
}
// disable centrifugal force correction, it will be enabled as part of the arming process
ahrs.set_correct_centrifugal(false);
hal.util->set_soft_armed(false);
// setup different AHRS gains for ArduCopter than the default
// but allow users to override in their config
if (!ahrs._kp.load()) {
ahrs._kp.set_and_save(0.1);
}
if (!ahrs._kp_yaw.load()) {
ahrs._kp_yaw.set_and_save(0.1);
}
if (!g.format_version.load() ||
g.format_version != Parameters::k_format_version) {

View File

@ -137,8 +137,8 @@ enum aux_sw_func {
#define CH6_OPTFLOW_KP 17 // deprecated -- remove
#define CH6_OPTFLOW_KI 18 // deprecated -- remove
#define CH6_OPTFLOW_KD 19 // deprecated -- remove
#define CH6_AHRS_YAW_KP 30 // ahrs's compass effect on yaw angle (0 = very low, 1 = very high)
#define CH6_AHRS_KP 31 // accelerometer effect on roll/pitch angle (0=low)
#define CH6_AHRS_YAW_KP 30 // deprecated -- remove
#define CH6_AHRS_KP 31 // deprecated -- remove
#define CH6_INAV_TC 32 // deprecated -- remove
#define CH6_DECLINATION 38 // compass declination in radians
#define CH6_CIRCLE_RATE 39 // circle turn rate in degrees (hard coded to about 45 degrees in either direction)

View File

@ -156,9 +156,6 @@ static bool init_arm_motors(bool arming_from_gcs)
did_ground_start = true;
}
// go back to normal AHRS gains
ahrs.set_fast_gains(false);
// enable gps velocity based centrefugal force compensation
ahrs.set_correct_centrifugal(true);
hal.util->set_soft_armed(true);
@ -708,9 +705,6 @@ static void init_disarm_motors()
// reset the mission
mission.reset();
// setup fast AHRS gains to get right attitude
ahrs.set_fast_gains(true);
// log disarm to the dataflash
Log_Write_Event(DATA_DISARMED);

View File

@ -575,16 +575,12 @@ static void auto_trim()
// calculate pitch trim adjustment
float pitch_trim_adjustment = ToRad((float)g.rc_2.control_in / 4000.0f);
// make sure accelerometer values impact attitude quickly
ahrs.set_fast_gains(true);
// add trim to ahrs object
// save to eeprom on last iteration
ahrs.add_trim(roll_trim_adjustment, pitch_trim_adjustment, (auto_trim_counter == 0));
// on last iteration restore leds and accel gains to normal
if(auto_trim_counter == 0) {
ahrs.set_fast_gains(false);
AP_Notify::flags.save_trim = false;
}
}

View File

@ -292,9 +292,6 @@ static void startup_ground(bool force_gyro_cal)
ahrs.reset_gyro_drift();
}
// setup fast AHRS gains to get right attitude
ahrs.set_fast_gains(true);
// set landed flag
set_land_complete(true);
set_land_complete_maybe(true);

View File

@ -120,14 +120,6 @@ static void tuning() {
break;
#endif
case CH6_AHRS_YAW_KP:
ahrs._kp_yaw.set(tuning_value);
break;
case CH6_AHRS_KP:
ahrs._kp.set(tuning_value);
break;
case CH6_DECLINATION:
// set declination to +-20degrees
compass.set_declination(ToRad((2.0f * g.rc_6.control_in - g.radio_tuning_high)/100.0f), false); // 2nd parameter is false because we do not want to save to eeprom because this would have a performance impact