From e597a9c0a10651731f6ea596a8af8f628de7c782 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Wed, 8 Nov 2017 21:54:11 +0100 Subject: [PATCH] FlightTasks: fix review comments --- src/lib/FlightTasks/FlightTasks.hpp | 10 +++++----- src/lib/FlightTasks/tasks/FlightTaskManual.cpp | 4 ++-- src/lib/FlightTasks/tasks/FlightTaskManual.hpp | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/FlightTasks/FlightTasks.hpp b/src/lib/FlightTasks/FlightTasks.hpp index 885d9b13d6..78c33b8011 100644 --- a/src/lib/FlightTasks/FlightTasks.hpp +++ b/src/lib/FlightTasks/FlightTasks.hpp @@ -67,7 +67,7 @@ public: } else { return 1; } - }; + } /** * Get the output data from the current task @@ -75,7 +75,7 @@ public: const vehicle_local_position_setpoint_s &get_position_setpoint() { return _tasks[_current_task]->get_position_setpoint(); - }; + } /** * Call this function initially to point all tasks to the general output data @@ -83,7 +83,7 @@ public: inline const vehicle_local_position_setpoint_s &operator()() { return get_position_setpoint(); - }; + } /** * Switch to the next task in the available list (for testing) @@ -92,7 +92,7 @@ public: void switch_task() { switch_task(_current_task + 1); - }; + } /** * Switch to a specific task (for normal usage) @@ -120,7 +120,7 @@ public: /* something went wrong, no task running anymore */ _current_task = -1; return 1; - }; + } /** * Get the number of the active task diff --git a/src/lib/FlightTasks/tasks/FlightTaskManual.cpp b/src/lib/FlightTasks/tasks/FlightTaskManual.cpp index f6785395e7..8e77d88759 100644 --- a/src/lib/FlightTasks/tasks/FlightTaskManual.cpp +++ b/src/lib/FlightTasks/tasks/FlightTaskManual.cpp @@ -87,7 +87,7 @@ int FlightTaskManual::update() velocity_setpoint = velocity_setpoint.emult(vel_scale); /* smooth out velocity setpoint by slewrate and return it */ - vel_sp_slewrate(velocity_setpoint, stick_xy, _sticks(3)); + vel_sp_slewrate(stick_xy, _sticks(3), velocity_setpoint); _set_velocity_setpoint(velocity_setpoint); /* handle position and altitude hold */ @@ -146,7 +146,7 @@ void FlightTaskManual::reset_slewrate_xy() _vel_sp_prev(1) = _velocity(1); } -void FlightTaskManual::vel_sp_slewrate(Vector3f &vel_sp, const Vector2f &stick_xy, const float &stick_z) +void FlightTaskManual::vel_sp_slewrate(const Vector2f &stick_xy, const float &stick_z, Vector3f &vel_sp) { Vector2f vel_sp_xy(vel_sp(0), vel_sp(1)); const Vector2f vel_sp_prev_xy(_vel_sp_prev(0), _vel_sp_prev(1)); diff --git a/src/lib/FlightTasks/tasks/FlightTaskManual.hpp b/src/lib/FlightTasks/tasks/FlightTaskManual.hpp index f0b8eb6d0c..4106fc5dd0 100644 --- a/src/lib/FlightTasks/tasks/FlightTaskManual.hpp +++ b/src/lib/FlightTasks/tasks/FlightTaskManual.hpp @@ -133,7 +133,7 @@ private: math::LowPassFilter2p _filter_roll_stick; math::LowPassFilter2p _filter_pitch_stick; - void vel_sp_slewrate(matrix::Vector3f &vel_sp, const matrix::Vector2f &stick_xy, const float &stick_z); + void vel_sp_slewrate(const matrix::Vector2f &stick_xy, const float &stick_z, matrix::Vector3f &vel_sp); void reset_slewrate_xy();