Browse Source

Copter: eliminate mode_requires_gps

master
Peter Barker 8 years ago committed by Randy Mackay
parent
commit
ef1489e87a
  1. 2
      ArduCopter/AP_Arming.cpp
  2. 2
      ArduCopter/ArduCopter.cpp
  3. 1
      ArduCopter/Copter.h
  4. 2
      ArduCopter/ekf_check.cpp
  5. 12
      ArduCopter/flight_mode.cpp

2
ArduCopter/AP_Arming.cpp

@ -378,7 +378,7 @@ bool AP_Arming_Copter::gps_checks(bool display_failure) @@ -378,7 +378,7 @@ bool AP_Arming_Copter::gps_checks(bool display_failure)
}
// check if flight mode requires GPS
bool mode_requires_gps = copter.mode_requires_GPS();
bool mode_requires_gps = copter.flightmode->requires_GPS();
// check if fence requires GPS
bool fence_requires_gps = false;

2
ArduCopter/ArduCopter.cpp

@ -387,7 +387,7 @@ void Copter::ten_hz_logging_loop() @@ -387,7 +387,7 @@ void Copter::ten_hz_logging_loop()
if (should_log(MASK_LOG_RCOUT)) {
DataFlash.Log_Write_RCOUT();
}
if (should_log(MASK_LOG_NTUN) && (mode_requires_GPS() || landing_with_GPS())) {
if (should_log(MASK_LOG_NTUN) && (flightmode->requires_GPS() || landing_with_GPS())) {
Log_Write_Nav_Tuning();
}
if (should_log(MASK_LOG_IMU) || should_log(MASK_LOG_IMU_FAST) || should_log(MASK_LOG_IMU_RAW)) {

1
ArduCopter/Copter.h

@ -803,7 +803,6 @@ private: @@ -803,7 +803,6 @@ private:
bool set_mode(control_mode_t mode, mode_reason_t reason);
void update_flight_mode();
void exit_mode(control_mode_t old_control_mode, control_mode_t new_control_mode);
bool mode_requires_GPS();
bool mode_has_manual_throttle(control_mode_t mode);
void notify_flight_mode();
void heli_init();

2
ArduCopter/ekf_check.cpp

@ -98,7 +98,7 @@ bool Copter::ekf_check_position_problem() @@ -98,7 +98,7 @@ bool Copter::ekf_check_position_problem()
}
// We don't know where we are. Is this a problem?
if (copter.mode_requires_GPS(copter.control_mode)) {
if (copter.flightmode->requires_GPS()) {
// Oh, yes, we have a problem
return true;
}

12
ArduCopter/flight_mode.cpp

@ -292,18 +292,6 @@ void Copter::exit_mode(control_mode_t old_control_mode, control_mode_t new_contr @@ -292,18 +292,6 @@ void Copter::exit_mode(control_mode_t old_control_mode, control_mode_t new_contr
#endif //HELI_FRAME
}
// returns true or false whether current control mode requires GPS
bool Copter::mode_requires_GPS()
{
if (flightmode != nullptr) {
return flightmode->requires_GPS();
}
switch (control_mode) {
default:
return false;
}
}
// mode_has_manual_throttle - returns true if the flight mode has a manual throttle (i.e. pilot directly controls throttle)
bool Copter::mode_has_manual_throttle(control_mode_t mode)
{

Loading…
Cancel
Save