diff --git a/libraries/AP_SmartRTL/AP_SmartRTL.cpp b/libraries/AP_SmartRTL/AP_SmartRTL.cpp index 0de442dc7f..173d12c8f4 100644 --- a/libraries/AP_SmartRTL/AP_SmartRTL.cpp +++ b/libraries/AP_SmartRTL/AP_SmartRTL.cpp @@ -869,6 +869,7 @@ void AP_SmartRTL::deactivate(SRTL_Actions action, const char *reason) GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "SmartRTL deactivated: %s", reason); } +#if HAL_LOGGING_ENABLED // logging void AP_SmartRTL::log_action(SRTL_Actions action, const Vector3f &point) const { @@ -876,6 +877,7 @@ void AP_SmartRTL::log_action(SRTL_Actions action, const Vector3f &point) const AP::logger().Write_SRTL(_active, _path_points_count, _path_points_max, action, point); } } +#endif // returns true if the two loops overlap (used within add_loop to determine which loops to keep or throw away) bool AP_SmartRTL::loops_overlap(const prune_loop_t &loop1, const prune_loop_t &loop2) const diff --git a/libraries/AP_SmartRTL/AP_SmartRTL.h b/libraries/AP_SmartRTL/AP_SmartRTL.h index a83cad692a..144762e512 100644 --- a/libraries/AP_SmartRTL/AP_SmartRTL.h +++ b/libraries/AP_SmartRTL/AP_SmartRTL.h @@ -3,6 +3,7 @@ #include #include #include +#include // definitions and macros #define SMARTRTL_ACCURACY_DEFAULT 2.0f // default _ACCURACY parameter value. Points will be no closer than this distance (in meters) together. @@ -172,8 +173,12 @@ private: // de-activate SmartRTL, send warning to GCS and logger void deactivate(SRTL_Actions action, const char *reason); +#if HAL_LOGGING_ENABLED // logging void log_action(SRTL_Actions action, const Vector3f &point = Vector3f()) const; +#else + void log_action(SRTL_Actions action, const Vector3f &point = Vector3f()) const {} +#endif // parameters AP_Float _accuracy;