From e44733a03cc1b991290ef8e9b4c1ab56cd13717d Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Tue, 28 Nov 2017 18:17:39 +0100 Subject: [PATCH] FlightTasks: small refactor for review comments --- src/lib/FlightTasks/tasks/FlightTask.cpp | 3 +-- src/lib/FlightTasks/tasks/FlightTask.hpp | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lib/FlightTasks/tasks/FlightTask.cpp b/src/lib/FlightTasks/tasks/FlightTask.cpp index 1c11d3386c..ab57f8720b 100644 --- a/src/lib/FlightTasks/tasks/FlightTask.cpp +++ b/src/lib/FlightTasks/tasks/FlightTask.cpp @@ -26,8 +26,7 @@ int FlightTask::update() _time = (_time_stamp_current - _time_stamp_activate) / 1e6f; _deltatime = math::min((_time_stamp_current - _time_stamp_last), _timeout) / 1e6f; _time_stamp_last = _time_stamp_current; - int ret = _evaluate_vehicle_position(); - return ret; + return _evaluate_vehicle_position(); } int FlightTask::_evaluate_vehicle_position() diff --git a/src/lib/FlightTasks/tasks/FlightTask.hpp b/src/lib/FlightTasks/tasks/FlightTask.hpp index 30daf2dea1..ae46d38ee5 100644 --- a/src/lib/FlightTasks/tasks/FlightTask.hpp +++ b/src/lib/FlightTasks/tasks/FlightTask.hpp @@ -64,9 +64,9 @@ public: virtual bool initializeSubscriptions(SubscriptionArray &subscription_array); /** - * Call once on the event where you switch to the task - * @return 0 on success, <0 on error - */ + * Call once on the event where you switch to the task + * @return 0 on success, <0 on error + */ virtual int activate(); virtual ~FlightTask() = default; @@ -109,7 +109,7 @@ protected: void _set_acceleration_setpoint(const matrix::Vector3f &acceleration_setpoint) { acceleration_setpoint.copyToRaw(&_vehicle_local_position_setpoint.acc_x); } /* Put the yaw angle produced by the task into the setpoint message */ - void _set_yaw_setpoint(const float &yaw) { _vehicle_local_position_setpoint.yaw = yaw; } + void _set_yaw_setpoint(const float yaw) { _vehicle_local_position_setpoint.yaw = yaw; } /* Put the yaw anglular rate produced by the task into the setpoint message */ void _set_yawspeed_setpoint(const float &yawspeed) { _vehicle_local_position_setpoint.yawspeed = yawspeed; }