Browse Source

Copter: convert RTL_ALT to int32

gps-1.3.1
Josh Henderson 3 years ago committed by Randy Mackay
parent
commit
24b6f024ea
  1. 6
      ArduCopter/Parameters.cpp
  2. 2
      ArduCopter/Parameters.h
  3. 2
      ArduCopter/avoidance_adsb.cpp
  4. 2
      ArduCopter/avoidance_adsb.h

6
ArduCopter/Parameters.cpp

@ -109,7 +109,7 @@ const AP_Param::Info Copter::var_info[] = { @@ -109,7 +109,7 @@ const AP_Param::Info Copter::var_info[] = {
// @DisplayName: RTL Altitude
// @Description: The minimum alt above home the vehicle will climb to before returning. If the vehicle is flying higher than this value it will return at its current altitude.
// @Units: cm
// @Range: 200 8000
// @Range: 200 300000
// @Increment: 1
// @User: Standard
GSCALAR(rtl_altitude, "RTL_ALT", RTL_ALT),
@ -1186,6 +1186,10 @@ void Copter::load_parameters(void) @@ -1186,6 +1186,10 @@ void Copter::load_parameters(void)
// convert fs_options parameters
convert_fs_options_params();
#if MODE_RTL_ENABLED == ENABLED
g.rtl_altitude.convert_parameter_width(AP_PARAM_INT16);
#endif
hal.console->printf("load_all took %uus\n", (unsigned)(micros() - before));
// setup AP_Param frame type flags

2
ArduCopter/Parameters.h

@ -394,7 +394,7 @@ public: @@ -394,7 +394,7 @@ public:
AP_Float pilot_takeoff_alt;
#if MODE_RTL_ENABLED == ENABLED
AP_Int16 rtl_altitude;
AP_Int32 rtl_altitude;
AP_Int16 rtl_speed_cms;
AP_Float rtl_cone_slope;
AP_Int16 rtl_alt_final;

2
ArduCopter/avoidance_adsb.cpp

@ -144,7 +144,7 @@ void AP_Avoidance_Copter::set_mode_else_try_RTL_else_LAND(Mode::Number mode) @@ -144,7 +144,7 @@ void AP_Avoidance_Copter::set_mode_else_try_RTL_else_LAND(Mode::Number mode)
}
}
int16_t AP_Avoidance_Copter::get_altitude_minimum() const
int32_t AP_Avoidance_Copter::get_altitude_minimum() const
{
#if MODE_RTL_ENABLED == ENABLED
// do not descend if below RTL alt

2
ArduCopter/avoidance_adsb.h

@ -20,7 +20,7 @@ private: @@ -20,7 +20,7 @@ private:
void set_mode_else_try_RTL_else_LAND(Mode::Number mode);
// get minimum limit altitude allowed on descend
int16_t get_altitude_minimum() const;
int32_t get_altitude_minimum() const;
protected:
// override avoidance handler

Loading…
Cancel
Save