mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-23 00:04:02 -04:00
Added param option for Simple mode reset
This commit is contained in:
parent
f5a54f3da8
commit
6bac318def
@ -568,6 +568,8 @@ AP_Relay relay;
|
|||||||
static bool usb_connected;
|
static bool usb_connected;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static float roll_I;
|
||||||
|
static float pitch_I;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Top-level logic
|
// Top-level logic
|
||||||
@ -1261,10 +1263,9 @@ static void update_navigation()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// are we in SIMPLE mode?
|
// are we in SIMPLE mode?
|
||||||
if(do_simple){
|
if(do_simple && g.reset_simple){
|
||||||
// get distance to home
|
// get distance to home
|
||||||
if(home_distance > 10){
|
if(home_distance > 10){ // 10m from home
|
||||||
// 10m
|
|
||||||
// we reset the angular offset to be a vector from home to the quad
|
// we reset the angular offset to be a vector from home to the quad
|
||||||
initial_simple_bearing = home_to_copter_bearing;
|
initial_simple_bearing = home_to_copter_bearing;
|
||||||
//Serial.printf("ISB: %d\n", initial_simple_bearing);
|
//Serial.printf("ISB: %d\n", initial_simple_bearing);
|
||||||
|
@ -106,6 +106,7 @@ public:
|
|||||||
k_param_low_voltage,
|
k_param_low_voltage,
|
||||||
k_param_ch7_option,
|
k_param_ch7_option,
|
||||||
k_param_sonar_type, // 153
|
k_param_sonar_type, // 153
|
||||||
|
k_param_reset_simple,
|
||||||
|
|
||||||
//
|
//
|
||||||
// 160: Navigation parameters
|
// 160: Navigation parameters
|
||||||
@ -200,6 +201,8 @@ public:
|
|||||||
AP_Int8 optflow_enabled;
|
AP_Int8 optflow_enabled;
|
||||||
AP_Float input_voltage;
|
AP_Float input_voltage;
|
||||||
AP_Float low_voltage;
|
AP_Float low_voltage;
|
||||||
|
AP_Int8 reset_simple;
|
||||||
|
|
||||||
|
|
||||||
// Waypoints
|
// Waypoints
|
||||||
//
|
//
|
||||||
@ -315,6 +318,7 @@ public:
|
|||||||
optflow_enabled (OPTFLOW, k_param_optflow_enabled, PSTR("FLOW_ENABLE")),
|
optflow_enabled (OPTFLOW, k_param_optflow_enabled, PSTR("FLOW_ENABLE")),
|
||||||
input_voltage (INPUT_VOLTAGE, k_param_input_voltage, PSTR("IN_VOLT")),
|
input_voltage (INPUT_VOLTAGE, k_param_input_voltage, PSTR("IN_VOLT")),
|
||||||
low_voltage (LOW_VOLTAGE, k_param_low_voltage, PSTR("LOW_VOLT")),
|
low_voltage (LOW_VOLTAGE, k_param_low_voltage, PSTR("LOW_VOLT")),
|
||||||
|
reset_simple (RESET_SIMPLE, k_param_reset_simple, PSTR("RST_SIMPL")),
|
||||||
|
|
||||||
waypoint_mode (0, k_param_waypoint_mode, PSTR("WP_MODE")),
|
waypoint_mode (0, k_param_waypoint_mode, PSTR("WP_MODE")),
|
||||||
command_total (0, k_param_command_total, PSTR("WP_TOTAL")),
|
command_total (0, k_param_command_total, PSTR("WP_TOTAL")),
|
||||||
|
@ -468,6 +468,10 @@
|
|||||||
# define RTL_THR THROTTLE_HOLD
|
# define RTL_THR THROTTLE_HOLD
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef RESET_SIMPLE
|
||||||
|
# define RESET_SIMPLE DISABLED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user