Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rover: Commonly use standardized wording #26989

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Rover/mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,8 @@ class ModeGuided : public Mode
void limit_init_time_and_location();
bool limit_breached() const;

static constexpr const char *timeout_msg = "target not received last 3secs, stopping";

protected:

enum class SubMode: uint8_t {
Expand Down
6 changes: 3 additions & 3 deletions Rover/mode_guided.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void ModeGuided::update()
{
// stop vehicle if target not updated within 3 seconds
if (have_attitude_target && (millis() - _des_att_time_ms) > 3000) {
gcs().send_text(MAV_SEVERITY_WARNING, "target not received last 3secs, stopping");
gcs().send_text(MAV_SEVERITY_WARNING, timeout_msg);
have_attitude_target = false;
}
if (have_attitude_target) {
Expand All @@ -77,7 +77,7 @@ void ModeGuided::update()
{
// stop vehicle if target not updated within 3 seconds
if (have_attitude_target && (millis() - _des_att_time_ms) > 3000) {
gcs().send_text(MAV_SEVERITY_WARNING, "target not received last 3secs, stopping");
gcs().send_text(MAV_SEVERITY_WARNING, timeout_msg);
have_attitude_target = false;
}
if (have_attitude_target) {
Expand Down Expand Up @@ -112,7 +112,7 @@ void ModeGuided::update()
// handle timeout
if (_have_strthr && (AP_HAL::millis() - _strthr_time_ms) > 3000) {
_have_strthr = false;
gcs().send_text(MAV_SEVERITY_WARNING, "target not received last 3secs, stopping");
gcs().send_text(MAV_SEVERITY_WARNING, timeout_msg);
}
if (_have_strthr) {
// pass latest steering and throttle directly to motors library
Expand Down
Loading