mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 07:43:33 +08:00
hysteresis: remove dependency/side effect on time
This commit is contained in:
@@ -45,9 +45,9 @@ void Takeoff::generateInitialRampValue(const float hover_thrust, float velocity_
|
||||
}
|
||||
|
||||
void Takeoff::updateTakeoffState(const bool armed, const bool landed, const bool want_takeoff,
|
||||
const float takeoff_desired_vz, const bool skip_takeoff)
|
||||
const float takeoff_desired_vz, const bool skip_takeoff, const hrt_abstime &now_us)
|
||||
{
|
||||
_spoolup_time_hysteresis.set_state_and_update(armed);
|
||||
_spoolup_time_hysteresis.set_state_and_update(armed, now_us);
|
||||
|
||||
switch (_takeoff_state) {
|
||||
case TakeoffState::disarmed:
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <systemlib/hysteresis/hysteresis.h>
|
||||
#include <lib/hysteresis/hysteresis.h>
|
||||
#include <drivers/drv_hrt.h>
|
||||
|
||||
using namespace time_literals;
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
* @return true if setpoint has updated correctly
|
||||
*/
|
||||
void updateTakeoffState(const bool armed, const bool landed, const bool want_takeoff,
|
||||
const float takeoff_desired_vz, const bool skip_takeoff);
|
||||
const float takeoff_desired_vz, const bool skip_takeoff, const hrt_abstime &now_us);
|
||||
|
||||
/**
|
||||
* Update and return the velocity constraint ramp value during takeoff.
|
||||
|
||||
Reference in New Issue
Block a user