diff --git a/libraries/AC_PrecLand/AC_PrecLand.cpp b/libraries/AC_PrecLand/AC_PrecLand.cpp index 1f5eb04f94..945b95bbab 100644 --- a/libraries/AC_PrecLand/AC_PrecLand.cpp +++ b/libraries/AC_PrecLand/AC_PrecLand.cpp @@ -162,12 +162,12 @@ const AP_Param::GroupInfo AC_PrecLand::var_info[] = { // @Units: m AP_GROUPINFO("ALT_MAX", 16, AC_PrecLand, _sensor_max_alt, 8), - // @Param: MOVING - // @DisplayName: Precision Landing Target stationary/moving - // @Description: Precision Landing Target stationary/moving - // @Values: 0:Stationary, 1:Moving + // @Param: OPTIONS + // @DisplayName: Precision Landing Extra Options + // @Description: Precision Landing Extra Options + // @Bitmask: 0: Moving Landing Target // @User: Advanced - AP_GROUPINFO("MOVING", 17, AC_PrecLand, _moving, 0), + AP_GROUPINFO("OPTIONS", 17, AC_PrecLand, _options, 0), AP_GROUPEND }; @@ -422,7 +422,7 @@ bool AC_PrecLand::get_target_velocity_relative_cms(Vector2f& ret) // get the absolute velocity of the vehicle void AC_PrecLand::get_target_velocity_cms(const Vector2f& vehicle_velocity_cms, Vector2f& target_vel_cms) { - if (!_moving) { + if (!(_options & PLND_OPTION_MOVING_TARGET)) { // the target should not be moving target_vel_cms.zero(); return; diff --git a/libraries/AC_PrecLand/AC_PrecLand.h b/libraries/AC_PrecLand/AC_PrecLand.h index 3dbac8a6ae..26db39b21c 100644 --- a/libraries/AC_PrecLand/AC_PrecLand.h +++ b/libraries/AC_PrecLand/AC_PrecLand.h @@ -125,6 +125,11 @@ private: SITL = 4, }; + enum PLndOptions { + PLND_OPTION_DISABLED = 0, + PLND_OPTION_MOVING_TARGET = (1 << 0), + }; + // check the status of the target void check_target_status(float rangefinder_alt_m, bool rangefinder_alt_valid); @@ -168,7 +173,7 @@ private: AP_Int8 _retry_behave; // Action to do when trying a landing retry AP_Float _sensor_min_alt; // PrecLand minimum height required for detecting target AP_Float _sensor_max_alt; // PrecLand maximum height the sensor can detect target - AP_Int8 _moving; // True if the landing target is moving (non-stationary) + AP_Int16 _options; // Bitmask for extra options uint32_t _last_update_ms; // system time in millisecond when update was last called bool _target_acquired; // true if target has been seen recently after estimator is initialized