From f8f12ee265e91b390233fde88e2ae033ee255393 Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 22 Nov 2016 08:13:30 +0100 Subject: [PATCH] vtol_att_control: removed unnecessary pointers to derived classes - we interface over the base class pointer so we don't need any pointers to the derived classes of VtolType Signed-off-by: Roman --- src/modules/vtol_att_control/vtol_att_control_main.cpp | 9 +++------ src/modules/vtol_att_control/vtol_att_control_main.h | 3 --- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/modules/vtol_att_control/vtol_att_control_main.cpp b/src/modules/vtol_att_control/vtol_att_control_main.cpp index f63363ad2f..f8806dccd1 100644 --- a/src/modules/vtol_att_control/vtol_att_control_main.cpp +++ b/src/modules/vtol_att_control/vtol_att_control_main.cpp @@ -137,16 +137,13 @@ VtolAttitudeControl::VtolAttitudeControl() : parameters_update(); if (_params.vtol_type == vtol_type::TAILSITTER) { - _tailsitter = new Tailsitter(this); - _vtol_type = _tailsitter; + _vtol_type = new Tailsitter(this); } else if (_params.vtol_type == vtol_type::TILTROTOR) { - _tiltrotor = new Tiltrotor(this); - _vtol_type = _tiltrotor; + _vtol_type = new Tiltrotor(this); } else if (_params.vtol_type == vtol_type::STANDARD) { - _standard = new Standard(this); - _vtol_type = _standard; + _vtol_type = new Standard(this); } else { _task_should_exit = true; diff --git a/src/modules/vtol_att_control/vtol_att_control_main.h b/src/modules/vtol_att_control/vtol_att_control_main.h index e268a92b20..1858e7a26c 100644 --- a/src/modules/vtol_att_control/vtol_att_control_main.h +++ b/src/modules/vtol_att_control/vtol_att_control_main.h @@ -219,9 +219,6 @@ private: bool _abort_front_transition; VtolType *_vtol_type = nullptr; // base class for different vtol types - Tiltrotor *_tiltrotor = nullptr; // tailsitter vtol type - Tailsitter *_tailsitter = nullptr; // tiltrotor vtol type - Standard *_standard = nullptr; // standard vtol type //*****************Member functions***********************************************************************