Browse Source

Copter: complete addition of SafeRTL flight mode

master
Randy Mackay 8 years ago
parent
commit
8df042f00c
  1. 1
      ArduCopter/GCS_Mavlink.cpp
  2. 1
      ArduCopter/flight_mode.cpp
  3. 1
      ArduCopter/heli.cpp
  4. 2
      ArduCopter/navigation.cpp
  5. 1
      ArduCopter/sensors.cpp

1
ArduCopter/GCS_Mavlink.cpp

@ -52,6 +52,7 @@ NOINLINE void Copter::send_heartbeat(mavlink_channel_t chan) @@ -52,6 +52,7 @@ NOINLINE void Copter::send_heartbeat(mavlink_channel_t chan)
case CIRCLE:
case POSHOLD:
case BRAKE:
case SAFE_RTL:
base_mode |= MAV_MODE_FLAG_GUIDED_ENABLED;
// note that MAV_MODE_FLAG_AUTO_ENABLED does not match what
// APM does in any mode, as that is defined as "system finds its own goal

1
ArduCopter/flight_mode.cpp

@ -369,6 +369,7 @@ void Copter::notify_flight_mode(control_mode_t mode) @@ -369,6 +369,7 @@ void Copter::notify_flight_mode(control_mode_t mode)
case AVOID_ADSB:
case GUIDED_NOGPS:
case LAND:
case SAFE_RTL:
// autopilot modes
AP_Notify::flags.autopilot_mode = true;
break;

1
ArduCopter/heli.cpp

@ -108,6 +108,7 @@ void Copter::heli_update_landing_swash() @@ -108,6 +108,7 @@ void Copter::heli_update_landing_swash()
break;
case RTL:
case SAFE_RTL:
if (rtl_state == RTL_Land) {
motors->set_collective_for_landing(true);
}else{

2
ArduCopter/navigation.cpp

@ -32,6 +32,7 @@ void Copter::calc_wp_distance() @@ -32,6 +32,7 @@ void Copter::calc_wp_distance()
case AUTO:
case RTL:
case SAFE_RTL:
wp_distance = wp_nav->get_wp_distance_to_destination();
break;
@ -59,6 +60,7 @@ void Copter::calc_wp_bearing() @@ -59,6 +60,7 @@ void Copter::calc_wp_bearing()
case AUTO:
case RTL:
case SAFE_RTL:
wp_bearing = wp_nav->get_wp_bearing_to_destination();
break;

1
ArduCopter/sensors.cpp

@ -360,6 +360,7 @@ void Copter::update_sensor_status_flags(void) @@ -360,6 +360,7 @@ void Copter::update_sensor_status_flags(void)
case POSHOLD:
case BRAKE:
case THROW:
case SAFE_RTL:
control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL;
control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL;
break;

Loading…
Cancel
Save