FlightTasks: add SubscriptionArray class that contains all subscriptions

This is to avoid dynamic (re-)allocations on task switching, due to
orb_{un,}subscribe calls.
This commit is contained in:
Beat Küng
2018-04-05 07:30:12 +02:00
parent b5ecf9824d
commit 9b571abb47
9 changed files with 245 additions and 15 deletions
@@ -54,6 +54,8 @@ public:
virtual ~FlightTaskManual() = default;
bool initializeSubscriptions(SubscriptionArray &subscription_array) override;
int update() override;
protected:
@@ -62,7 +64,7 @@ protected:
float get_input_frame_yaw() { return _yaw; };
private:
uORB::Subscription<manual_control_setpoint_s> _sub_manual_control_setpoint;
uORB::Subscription<manual_control_setpoint_s> *_sub_manual_control_setpoint{nullptr};
control::BlockParamFloat _xy_vel_man_expo; /**< ratio of exponential curve for stick input in xy direction pos mode */
control::BlockParamFloat _z_vel_man_expo; /**< ratio of exponential curve for stick input in xy direction pos mode */