mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 09:28:58 +00:00
commander is_safe() use const references
This commit is contained in:
@@ -379,15 +379,15 @@ transition_result_t arming_state_transition(vehicle_status_s *status,
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool is_safe(const struct safety_s *safety, const struct actuator_armed_s *armed)
|
||||
bool is_safe(const safety_s& safety, const actuator_armed_s& armed)
|
||||
{
|
||||
// System is safe if:
|
||||
// 1) Not armed
|
||||
// 2) Armed, but in software lockdown (HIL)
|
||||
// 3) Safety switch is present AND engaged -> actuators locked
|
||||
const bool lockdown = (armed->lockdown || armed->manual_lockdown);
|
||||
const bool lockdown = (armed.lockdown || armed.manual_lockdown);
|
||||
|
||||
return !armed->armed || (armed->armed && lockdown) || (safety->safety_switch_available && !safety->safety_off);
|
||||
return !armed.armed || (armed.armed && lockdown) || (safety.safety_switch_available && !safety.safety_off);
|
||||
}
|
||||
|
||||
transition_result_t
|
||||
|
||||
Reference in New Issue
Block a user