-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
Sub: make gcs failsafe timeout a parameter #27503
Conversation
f807f5a
to
d094268
Compare
d094268
to
abc1d4b
Compare
ArduSub/defines.h
Outdated
#ifndef FS_GCS_TIMEOUT_MS | ||
# define FS_GCS_TIMEOUT_MS 2500 // gcs failsafe triggers after this number of milliseconds with no GCS heartbeat | ||
#ifndef FS_GCS_TIMEOUT_S | ||
# define FS_GCS_TIMEOUT_S 5.0 // gcs failsafe triggers after this number of milliseconds with no GCS heartbeat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# define FS_GCS_TIMEOUT_S 5.0 // gcs failsafe triggers after this number of milliseconds with no GCS heartbeat | |
# define FS_GCS_TIMEOUT_S 5.0 // gcs failsafe triggers after this number of seconds with no GCS heartbeat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thanks!
abc1d4b
to
aa24ce9
Compare
ArduSub/failsafe.cpp
Outdated
@@ -321,7 +321,8 @@ void Sub::failsafe_gcs_check() | |||
uint32_t tnow = AP_HAL::millis(); | |||
|
|||
// Check if we have gotten a GCS heartbeat recently (GCS sysid must match SYSID_MYGCS parameter) | |||
if (tnow - gcs_last_seen_ms < FS_GCS_TIMEOUT_MS) { | |||
const float validated_timeout = constrain_float(g.failsafe_gcs_timeout, 2.0, 120); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really have my reservations about these constraints - particularly the lower one.
This is magic stuff happening in the code, there's nothing the user can know about this from the parameter description.
I don't think it's unreasonable for the user to set outside the bounds you've put in here.
Are you sure you want to bound things here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you.
I though I had seen that somewhere else but I cant find it anywhere...
Anyway. code updated, thanks for the review
aa24ce9
to
91277f9
Compare
91277f9
to
c604f98
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.