mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 05:23:33 +08:00
control_allocator: handle thrust allocation for VTOL's properly
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
committed by
Daniel Agar
parent
936f2dff52
commit
0568cff299
@@ -413,6 +413,30 @@ void Standard::fill_actuator_outputs()
|
||||
break;
|
||||
}
|
||||
|
||||
_torque_setpoint_0->timestamp = hrt_absolute_time();
|
||||
_torque_setpoint_0->timestamp_sample = _actuators_mc_in->timestamp_sample;
|
||||
_torque_setpoint_0->xyz[0] = mc_out[actuator_controls_s::INDEX_ROLL];
|
||||
_torque_setpoint_0->xyz[1] = mc_out[actuator_controls_s::INDEX_PITCH];
|
||||
_torque_setpoint_0->xyz[2] = mc_out[actuator_controls_s::INDEX_YAW];
|
||||
|
||||
_torque_setpoint_1->timestamp = hrt_absolute_time();
|
||||
_torque_setpoint_1->timestamp_sample = _actuators_fw_in->timestamp_sample;
|
||||
_torque_setpoint_1->xyz[0] = fw_out[actuator_controls_s::INDEX_ROLL];
|
||||
_torque_setpoint_1->xyz[1] = fw_out[actuator_controls_s::INDEX_PITCH];
|
||||
_torque_setpoint_1->xyz[2] = fw_out[actuator_controls_s::INDEX_YAW];
|
||||
|
||||
_thrust_setpoint_0->timestamp = hrt_absolute_time();
|
||||
_thrust_setpoint_0->timestamp_sample = _actuators_mc_in->timestamp_sample;
|
||||
_thrust_setpoint_0->xyz[0] = 0.f;
|
||||
_thrust_setpoint_0->xyz[1] = 0.f;
|
||||
_thrust_setpoint_0->xyz[2] = -mc_in[actuator_controls_s::INDEX_THROTTLE];
|
||||
|
||||
_thrust_setpoint_1->timestamp = hrt_absolute_time();
|
||||
_thrust_setpoint_1->timestamp_sample = _actuators_fw_in->timestamp_sample;
|
||||
_thrust_setpoint_1->xyz[0] = fw_in[actuator_controls_s::INDEX_THROTTLE];
|
||||
_thrust_setpoint_1->xyz[1] = 0.f;
|
||||
_thrust_setpoint_1->xyz[2] = 0.f;
|
||||
|
||||
_actuators_out_0->timestamp_sample = _actuators_mc_in->timestamp_sample;
|
||||
_actuators_out_1->timestamp_sample = _actuators_fw_in->timestamp_sample;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user