From 3dad79d8f5d4dee59395b876355499147b53020c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Thu, 13 Aug 2020 08:20:54 +0200 Subject: [PATCH] control_allocator: inline one-line setters & getters --- .../ControlAllocation/ControlAllocation.cpp | 55 ------------------- .../ControlAllocation/ControlAllocation.hpp | 18 +++--- 2 files changed, 9 insertions(+), 64 deletions(-) diff --git a/src/modules/control_allocator/ControlAllocation/ControlAllocation.cpp b/src/modules/control_allocator/ControlAllocation/ControlAllocation.cpp index f32522fdad..b442d183f0 100644 --- a/src/modules/control_allocator/ControlAllocation/ControlAllocation.cpp +++ b/src/modules/control_allocator/ControlAllocation/ControlAllocation.cpp @@ -41,30 +41,6 @@ #include "ControlAllocation.hpp" -const matrix::Vector & -ControlAllocation::getActuatorSetpoint() const -{ - return _actuator_sp; -} - -void -ControlAllocation::setControlSetpoint(const matrix::Vector &control) -{ - _control_sp = control; -} - -const matrix::Vector & -ControlAllocation::getControlSetpoint() const -{ - return _control_sp; -} - -const matrix::Vector & -ControlAllocation::getAllocatedControl() const -{ - return _control_allocated; -} - void ControlAllocation::setEffectivenessMatrix( const matrix::Matrix &effectiveness, @@ -75,38 +51,7 @@ ControlAllocation::setEffectivenessMatrix( clipActuatorSetpoint(_actuator_trim); _control_trim = _effectiveness * _actuator_trim; _num_actuators = num_actuators; -} -const matrix::Matrix & -ControlAllocation::getEffectivenessMatrix() const -{ - return _effectiveness; -} - -void -ControlAllocation::setActuatorMin(const matrix::Vector - &actuator_min) -{ - _actuator_min = actuator_min; -} - -const matrix::Vector & -ControlAllocation::getActuatorMin() const -{ - return _actuator_min; -} - -void -ControlAllocation::setActuatorMax(const matrix::Vector - &actuator_max) -{ - _actuator_max = actuator_max; -} - -const matrix::Vector & -ControlAllocation::getActuatorMax() const -{ - return _actuator_max; } void diff --git a/src/modules/control_allocator/ControlAllocation/ControlAllocation.hpp b/src/modules/control_allocator/ControlAllocation/ControlAllocation.hpp index 6cc0529b04..86a2cfc8ed 100644 --- a/src/modules/control_allocator/ControlAllocation/ControlAllocation.hpp +++ b/src/modules/control_allocator/ControlAllocation/ControlAllocation.hpp @@ -112,63 +112,63 @@ public: * * @return Actuator vector */ - const matrix::Vector &getActuatorSetpoint() const; + const matrix::Vector &getActuatorSetpoint() const { return _actuator_sp; } /** * Set the desired control vector * * @param Control vector */ - void setControlSetpoint(const matrix::Vector &control); + void setControlSetpoint(const matrix::Vector &control) { _control_sp = control; } /** * Set the desired control vector * * @param Control vector */ - const matrix::Vector &getControlSetpoint() const; + const matrix::Vector &getControlSetpoint() const { return _control_sp; } /** * Get the allocated control vector * * @return Control vector */ - const matrix::Vector &getAllocatedControl() const; + const matrix::Vector &getAllocatedControl() const { return _control_allocated; } /** * Get the control effectiveness matrix * * @return Effectiveness matrix */ - const matrix::Matrix &getEffectivenessMatrix() const; + const matrix::Matrix &getEffectivenessMatrix() const { return _effectiveness; } /** * Set the minimum actuator values * * @param actuator_min Minimum actuator values */ - void setActuatorMin(const matrix::Vector &actuator_min); + void setActuatorMin(const matrix::Vector &actuator_min) { _actuator_min = actuator_min; } /** * Get the minimum actuator values * * @return Minimum actuator values */ - const matrix::Vector &getActuatorMin() const; + const matrix::Vector &getActuatorMin() const { return _actuator_min; } /** * Set the maximum actuator values * * @param actuator_max Maximum actuator values */ - void setActuatorMax(const matrix::Vector &actuator_max); + void setActuatorMax(const matrix::Vector &actuator_max) { _actuator_max = actuator_max; } /** * Get the maximum actuator values * * @return Maximum actuator values */ - const matrix::Vector &getActuatorMax() const; + const matrix::Vector &getActuatorMax() const { return _actuator_max; } /** * Set the current actuator setpoint.