mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-15 06:27:36 +08:00
HACK to enable actuators in HITL
Mixers get loaded on normal output modules the first actuator_outputs instance gets sent to the simulator. No lockdown but the rest of HIL stays.
This commit is contained in:
@@ -188,16 +188,7 @@ then
|
||||
|
||||
if [ $MIXER_AUX_FILE != none ]
|
||||
then
|
||||
# Append aux mixer to main device.
|
||||
if param greater SYS_HITL 0
|
||||
then
|
||||
if mixer append ${OUTPUT_DEV} ${MIXER_AUX_FILE}
|
||||
then
|
||||
echo "INFO [init] Mixer: ${MIXER_AUX_FILE} appended to ${OUTPUT_DEV}"
|
||||
else
|
||||
echo "ERROR [init] Failed appending mixer: ${MIXER_AUX_FILE}"
|
||||
fi
|
||||
fi
|
||||
# Enable actuators in HITL
|
||||
if [ -e $OUTPUT_AUX_DEV -a $OUTPUT_MODE != hil ]
|
||||
then
|
||||
if mixer load ${OUTPUT_AUX_DEV} ${MIXER_AUX_FILE}
|
||||
|
||||
@@ -127,8 +127,7 @@ transition_result_t ArmStateMachine::arming_state_transition(vehicle_status_s &s
|
||||
}
|
||||
|
||||
if (hil_enabled) {
|
||||
/* enforce lockdown in HIL */
|
||||
armed.lockdown = true;
|
||||
// Enable actuators in HITL
|
||||
status_flags.system_sensors_initialized = true;
|
||||
|
||||
/* recover from a prearm fail */
|
||||
|
||||
@@ -2429,10 +2429,8 @@ Commander::run()
|
||||
bool auto_disarm = _actuator_armed.manual_lockdown;
|
||||
|
||||
// auto disarm if locked down to avoid user confusion
|
||||
// skipped in HITL where lockdown is enabled for safety
|
||||
if (_vehicle_status.hil_state != vehicle_status_s::HIL_STATE_ON) {
|
||||
auto_disarm |= _actuator_armed.lockdown;
|
||||
}
|
||||
// Enable actuators in HITL
|
||||
auto_disarm |= _armed.lockdown;
|
||||
|
||||
_auto_disarm_killed.set_state_and_update(auto_disarm, hrt_absolute_time());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user