mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 09:22:18 +00:00
FlightTasks: Introduce the empty setpoint to reset the setpoint for every loop iteration and return it in case of no task running
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include <mathlib/mathlib.h>
|
||||
|
||||
constexpr uint64_t FlightTask::_timeout;
|
||||
constexpr vehicle_local_position_setpoint_s FlightTask::empty_setpoint;
|
||||
|
||||
|
||||
bool FlightTask::initializeSubscriptions(SubscriptionArray &subscription_array)
|
||||
@@ -21,6 +22,7 @@ bool FlightTask::activate()
|
||||
|
||||
bool FlightTask::updateInitialize()
|
||||
{
|
||||
_resetSetpoint();
|
||||
_time_stamp_current = hrt_absolute_time();
|
||||
_time = (_time_stamp_current - _time_stamp_activate) / 1e6f;
|
||||
_deltatime = math::min((_time_stamp_current - _time_stamp_last), _timeout) / 1e6f;
|
||||
|
||||
Reference in New Issue
Block a user