From 76ad00497bada379bed47b23342ce123bdc52d0d Mon Sep 17 00:00:00 2001 From: Dennis Mannhart Date: Fri, 29 Dec 2017 17:25:29 +0100 Subject: [PATCH] FlightTasks and local setpoint: add thrust setpoint --- msg/vehicle_local_position_setpoint.msg | 3 +++ src/lib/FlightTasks/tasks/FlightTask.hpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/msg/vehicle_local_position_setpoint.msg b/msg/vehicle_local_position_setpoint.msg index db2674dec1..e7a1a8055a 100644 --- a/msg/vehicle_local_position_setpoint.msg +++ b/msg/vehicle_local_position_setpoint.msg @@ -12,3 +12,6 @@ float32 vz # in meters/sec float32 acc_x # in meters/(sec*sec) float32 acc_y # in meters/(sec*sec) float32 acc_z # in meters/(sec*sec) +float32 thr_x # normalized +float32 thr_y # normalized +float32 thr_z # normalized diff --git a/src/lib/FlightTasks/tasks/FlightTask.hpp b/src/lib/FlightTasks/tasks/FlightTask.hpp index 42b784a793..e390c52c2e 100644 --- a/src/lib/FlightTasks/tasks/FlightTask.hpp +++ b/src/lib/FlightTasks/tasks/FlightTask.hpp @@ -130,6 +130,9 @@ protected: /* Put the yaw anglular rate produced by the task into the setpoint message */ void _setYawspeedSetpoint(const float &yawspeed) { _vehicle_local_position_setpoint.yawspeed = yawspeed; } + /* Put the thrust setpoint produced by the task into the setpoint message */ + void _setThrustSetpoint(const matrix::Vector3f &thrust_setpoint) { thrust_setpoint.copyToRaw(&_vehicle_local_position_setpoint.thr_x);} + private: uORB::Subscription *_sub_vehicle_local_position{nullptr};