From 2db2ef824b69d90b1de3afe8b68e3810feee07ac Mon Sep 17 00:00:00 2001 From: Dennis Mannhart Date: Thu, 15 Feb 2018 11:10:23 +0100 Subject: [PATCH] FlightTaskManual: move all setpoints into base class --- src/lib/FlightTasks/tasks/FlightTaskManual.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lib/FlightTasks/tasks/FlightTaskManual.hpp b/src/lib/FlightTasks/tasks/FlightTaskManual.hpp index c67c9f32b5..33dce897b7 100644 --- a/src/lib/FlightTasks/tasks/FlightTaskManual.hpp +++ b/src/lib/FlightTasks/tasks/FlightTaskManual.hpp @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (c) 2017 PX4 Development Team. All rights reserved. + * Copyright (c) 2018 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -63,6 +63,15 @@ protected: matrix::Vector3f _sticks_expo; /**< modified manual sticks using expo function*/ control::BlockParamFloat _stick_dz; /**< 0-deadzone around the center for the sticks */ + /* Setpoints: NAN means that setpoint is not being considered. */ + matrix::Vector3f _thr_sp{NAN, NAN, NAN}; /**< thrust setpoint */ + matrix::Vector3f _vel_sp{NAN, NAN, NAN}; /**< velocity setpoint */ + matrix::Vector3f _pos_sp{NAN, NAN, NAN}; /**< position setpoint */ + float _yaw_sp{NAN}; /**< yaw setpoint */ + float _yaw_rate_sp{NAN}; /**< yawspeed setpoint */ + + void _resetToNAN(); + private: uORB::Subscription *_sub_manual_control_setpoint{nullptr}; @@ -70,6 +79,5 @@ private: control::BlockParamFloat _xy_vel_man_expo; /**< ratio of exponential curve for stick input in xy direction */ control::BlockParamFloat _z_vel_man_expo; /**< ratio of exponential curve for stick input in z direction */ - bool _evaluateSticks(); /**< checks and sets stick inputs */ };