mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 12:21:36 +08:00
ControlAllocator: only run allocator on torque updates, not thrust
Signed-off-by: Silvan <silvan@auterion.com>
This commit is contained in:
@@ -390,15 +390,8 @@ ControlAllocator::Run()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Also run allocator on thrust setpoint changes if the torque setpoint
|
|
||||||
// has not been updated for more than 5ms
|
|
||||||
if (_vehicle_thrust_setpoint_sub.update(&vehicle_thrust_setpoint)) {
|
if (_vehicle_thrust_setpoint_sub.update(&vehicle_thrust_setpoint)) {
|
||||||
_thrust_sp = matrix::Vector3f(vehicle_thrust_setpoint.xyz);
|
_thrust_sp = matrix::Vector3f(vehicle_thrust_setpoint.xyz);
|
||||||
|
|
||||||
if (dt > 0.005f) {
|
|
||||||
do_update = true;
|
|
||||||
_timestamp_sample = vehicle_thrust_setpoint.timestamp_sample;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (do_update) {
|
if (do_update) {
|
||||||
|
|||||||
Reference in New Issue
Block a user