2 #include <mathlib/mathlib.h> 7 const vehicle_local_position_setpoint_s FlightTask::empty_setpoint = {0, NAN, NAN, NAN, NAN, NAN, NAN, NAN, NAN, {NAN, NAN, NAN}, {NAN, NAN, NAN}, {NAN, NAN, NAN}, {}};
101 return vehicle_local_position_setpoint;
177 bool position_triggered_takeoff =
false;
181 float min_altitude = 0.2f;
184 if (PX4_ISFINITE(min_distance_to_ground)) {
185 min_altitude = min_distance_to_ground + 0.05f;
192 bool velocity_triggered_takeoff =
false;
198 return position_triggered_takeoff || velocity_triggered_takeoff;
matrix::Vector3f _acceleration_setpoint
float max_distance_to_ground
matrix::Vector3f _velocity
current vehicle velocity
int globallocalconverter_init(double lat_0, double lon_0, float alt_0, uint64_t timestamp)
Initialize the global mapping between global position (spherical) and local position (NED)...
static const vehicle_local_position_setpoint_s empty_setpoint
Empty setpoint.
hrt_abstime _time_stamp_activate
time stamp when task was activated
void _checkEkfResetCounters()
virtual bool activate(vehicle_local_position_setpoint_s last_setpoint)
Call once on the event where you switch to the task.
float min_distance_to_ground
virtual void _setDefaultConstraints()
Set constraints to default values.
Definition of geo / math functions to perform geodesic calculations.
float _deltatime
passed time in seconds since the task was last updated
static const landing_gear_s empty_landing_gear_default_keep
default landing gear state
virtual void _ekfResetHandlerVelocityXY()
uint8_t vxy_reset_counter
virtual void _ekfResetHandlerPositionXY()
virtual void _ekfResetHandlerHeading(float delta_psi)
hrt_abstime _time_stamp_current
time stamp at the beginning of the current task update
void copyTo(Type dst[M *N]) const
matrix::Vector3f _position_setpoint
Setpoints which the position controller has to execute.
float _dist_to_bottom
current height above ground level
static constexpr uint64_t _timeout
maximal time in us before a loop or data times out
virtual void _ekfResetHandlerVelocityZ()
matrix::Vector3f _jerk_setpoint
matrix::Vector3f _thrust_setpoint
Abstract base class for different advanced flight tasks like orbit, follow me, ...
virtual void _ekfResetHandlerPositionZ()
struct FlightTask::@63 _reset_counters
constexpr T radians(T degrees)
virtual bool updateInitialize()
Call before activate() or update() to initialize time and input data.
matrix::Vector3f _position
current vehicle position
float _time
passed time in seconds since the task was activated
matrix::Vector3f _velocity_setpoint
uORB::SubscriptionData< vehicle_local_position_s > _sub_vehicle_local_position
virtual void reActivate()
Call this to reset an active Flight Task.
vehicle_constraints_s _constraints
Vehicle constraints.
constexpr _Tp min(_Tp a, _Tp b)
virtual bool _checkTakeoff()
Determine when to trigger a takeoff (ignored in flight)
void _evaluateVehicleLocalPosition()
Check and update local position.
void _resetSetpoints()
Reset all setpoints to NAN.
const vehicle_local_position_setpoint_s getPositionSetpoint()
Get the output data.
uint8_t quat_reset_counter
float _yaw
current vehicle yaw heading
uORB::SubscriptionData< vehicle_attitude_s > _sub_attitude
static const vehicle_constraints_s empty_constraints
Empty constraints.
void _initEkfResetCounters()
Monitor the EKF reset counters and call the appropriate handling functions in case of a reset event...
hrt_abstime _time_stamp_last
time stamp when task was last updated
__EXPORT hrt_abstime hrt_absolute_time(void)
Get absolute time in [us] (does not wrap).