mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-13 18:37:34 +08:00
commander: add valid_registrations_mask to ArmingCheckRequest.msg
This allows external modes to individually check if they are flagged as invalid/unresponsive. Previously this was done only based on whether or not ArmingCheckRequest was received, which does not work when multiple modes are running.
This commit is contained in:
@@ -293,6 +293,15 @@ void ExternalChecks::update()
|
||||
arming_check_request_s request{};
|
||||
request.request_id = ++_current_request_id;
|
||||
request.timestamp = hrt_absolute_time();
|
||||
request.valid_registrations_mask = _active_registrations_mask;
|
||||
|
||||
// Clear unresponsive ones
|
||||
for (int i = 0; i < MAX_NUM_REGISTRATIONS; ++i) {
|
||||
if (_registrations[i].unresponsive) {
|
||||
request.valid_registrations_mask &= ~(1u << i);
|
||||
}
|
||||
}
|
||||
|
||||
_arming_check_request_pub.publish(request);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user