Skip to content

Commit

Permalink
AP_SmartRTL: Share the same wording
Browse files Browse the repository at this point in the history
  • Loading branch information
muramura committed Sep 30, 2024
1 parent 3e43f62 commit 2adb811
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libraries/AP_SmartRTL/AP_SmartRTL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void AP_SmartRTL::init()
// check if memory allocation failed
if (_path == nullptr || _prune.loops == nullptr || _simplify.stack == nullptr) {
log_action(Action::DEACTIVATED_INIT_FAILED);
GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "SmartRTL deactivated: init failed");
GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "%s deactivated: init failed", flightMode);
free(_path);
free(_prune.loops);
free(_simplify.stack);
Expand Down Expand Up @@ -390,7 +390,7 @@ void AP_SmartRTL::run_background_cleanup()
// warn if buffer is about to be filled
uint32_t now_ms = AP_HAL::millis();
if ((path_points_count >0) && (path_points_count >= _path_points_max - 9) && (now_ms - _last_low_space_notify_ms > 10000)) {
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "SmartRTL Low on space!");
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "%s Low on space!", flightMode);
_last_low_space_notify_ms = now_ms;
}

Expand Down Expand Up @@ -857,7 +857,7 @@ AP_SmartRTL::dist_point AP_SmartRTL::segment_segment_dist(const Vector3f &p1, co
// difference between two closest points
const Vector3f dP = line_start_diff+line1*t1-line2*t2;

const Vector3f midpoint = (p1+line1*t1 + p3+line2*t2)/2.0f;
const Vector3f midpoint = (p1+line1*t1 + p3+line2*t2) * 0.5f;
return {dP.length(), midpoint};
}

Expand All @@ -866,7 +866,7 @@ void AP_SmartRTL::deactivate(Action action, const char *reason)
{
_active = false;
log_action(action);
GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "SmartRTL deactivated: %s", reason);
GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "%s deactivated: %s", flightMode, reason);
}

#if HAL_LOGGING_ENABLED
Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_SmartRTL/AP_SmartRTL.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,6 @@ class AP_SmartRTL {

// returns true if the two loops overlap (used within add_loop to determine which loops to keep or throw away)
bool loops_overlap(const prune_loop_t& loop1, const prune_loop_t& loop2) const;

const char *flightMode = "SmartRTL";
};

0 comments on commit 2adb811

Please sign in to comment.