-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Obstacle Avoidance prearm checks and log health status #11638
Changes from 7 commits
9ad80bb
153345d
5bf776e
62ba7ce
912d902
e004f77
4b85732
4a15a86
99bd6ef
384cfc3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -799,9 +799,21 @@ PARAM_DEFINE_INT32(NAV_RCL_ACT, 2); | |
|
||
/** | ||
* Flag to enable obstacle avoidance | ||
* Temporary Parameter to enable interface testing | ||
* | ||
* @boolean | ||
* @group Mission | ||
*/ | ||
PARAM_DEFINE_INT32(COM_OBS_AVOID, 0); | ||
PARAM_DEFINE_INT32(COM_OBS_AVOID, 0); | ||
|
||
/** | ||
* Set onboard controller bootup timeout | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would call it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Strongly agree. FWIW IMO terminology for onboard/offboard is unhelpful because it is all from perspective of FC, but people think in terms of vehicles. Is this a general companion computer timeout or an avoidance system running on companion computer timeout? Assuming the later I'd do something like:
Note, I have tried to explain how it detects the companion computer. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I've lost that comment line during my changes. To answer your question: Yes, it is exactly the time within the avoidance system is expected to be running (formally defined as To this aim i thing that makes sense to change the name parameter to a more consistent too, i.e I think that the second one would be more consistent with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would probably vote |
||
* | ||
* This parameter defines the bootup timeout. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Much better than what was here. See above for my version - it is much the same, but you don't need to mention time or timeout quite so much. |
||
* After the timeout, a mavlink message that tells the user that the avoidance system | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI, MAVLink, not mavlink by preference. |
||
* is not available is sent. | ||
* @group Commander | ||
* @unit s | ||
* @min 0 | ||
* @max 200 | ||
*/ | ||
PARAM_DEFINE_INT32(COM_ONB_BOOT_T, 100); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ | |
#include <systemlib/mavlink_log.h> | ||
#include <drivers/drv_hrt.h> | ||
|
||
|
||
#include "state_machine_helper.h" | ||
#include "commander_helper.h" | ||
#include "PreflightCheck.h" | ||
|
@@ -915,6 +916,7 @@ bool prearm_check(orb_advert_t *mavlink_log_pub, const vehicle_status_flags_s &s | |
bool reportFailures = true; | ||
bool prearm_ok = true; | ||
|
||
|
||
// USB not connected | ||
if (!status_flags.circuit_breaker_engaged_usb_check && status_flags.usb_connected) { | ||
if (reportFailures) { | ||
|
@@ -997,6 +999,15 @@ bool prearm_check(orb_advert_t *mavlink_log_pub, const vehicle_status_flags_s &s | |
} | ||
} | ||
|
||
if (status_flags.avoidance_system_required && !status_flags.avoidance_system_valid) { | ||
if (prearm_ok && reportFailures) { | ||
mavlink_log_critical(mavlink_log_pub, "ARMING DENIED: Avoidance system not ready"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right so this makes sense. |
||
} | ||
|
||
prearm_ok = false; | ||
|
||
} | ||
|
||
return prearm_ok; | ||
} | ||
|
||
|
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.
Please don't use static, but a class member instead.
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.
Checkout here 99bd6ef