mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-09 22:08:56 +08:00
refactor(control_allocator): remove different timeouts again
in the name of simplicity, have one hardcoded timeout. Options to
address actuators that need more time:
- repeatedly send the command from the GS
- use another param in the {MAV/VEHICLE}_CMD to specify the duration,
expose also in commander interface, take default if not given
This commit is contained in:
@@ -164,9 +164,7 @@ void ActuatorGroupPreflightCheck::updateState(hrt_abstime now)
|
||||
}
|
||||
}
|
||||
|
||||
const hrt_abstime duration = isThrust(_group) ? PREFLIGHT_CHECK_DURATION_THRUST : PREFLIGHT_CHECK_DURATION_SERVOS;
|
||||
|
||||
if (now - _started >= duration) {
|
||||
if (now - _started >= PREFLIGHT_CHECK_DURATION) {
|
||||
_running = false;
|
||||
sendAck(_last_command, vehicle_command_ack_s::VEHICLE_CMD_RESULT_ACCEPTED, now);
|
||||
}
|
||||
|
||||
@@ -81,9 +81,7 @@ public:
|
||||
ActuatorEffectiveness &effectiveness);
|
||||
|
||||
private:
|
||||
static constexpr hrt_abstime PREFLIGHT_CHECK_DURATION_SERVOS = 500'000; // 500 ms
|
||||
// A bit longer since FW forward thrust can have significant slew rate
|
||||
static constexpr hrt_abstime PREFLIGHT_CHECK_DURATION_THRUST = 2'000'000; // 2 s
|
||||
static constexpr hrt_abstime PREFLIGHT_CHECK_DURATION = 500'000; // 500 ms
|
||||
|
||||
static bool isThrust(uint8_t group);
|
||||
static bool isKnownGroup(uint8_t group);
|
||||
|
||||
Reference in New Issue
Block a user