mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 02:13:33 +08:00
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 <bapstroman@gmail.com>
This commit is contained in:
@@ -137,16 +137,13 @@ VtolAttitudeControl::VtolAttitudeControl() :
|
|||||||
parameters_update();
|
parameters_update();
|
||||||
|
|
||||||
if (_params.vtol_type == vtol_type::TAILSITTER) {
|
if (_params.vtol_type == vtol_type::TAILSITTER) {
|
||||||
_tailsitter = new Tailsitter(this);
|
_vtol_type = new Tailsitter(this);
|
||||||
_vtol_type = _tailsitter;
|
|
||||||
|
|
||||||
} else if (_params.vtol_type == vtol_type::TILTROTOR) {
|
} else if (_params.vtol_type == vtol_type::TILTROTOR) {
|
||||||
_tiltrotor = new Tiltrotor(this);
|
_vtol_type = new Tiltrotor(this);
|
||||||
_vtol_type = _tiltrotor;
|
|
||||||
|
|
||||||
} else if (_params.vtol_type == vtol_type::STANDARD) {
|
} else if (_params.vtol_type == vtol_type::STANDARD) {
|
||||||
_standard = new Standard(this);
|
_vtol_type = new Standard(this);
|
||||||
_vtol_type = _standard;
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
_task_should_exit = true;
|
_task_should_exit = true;
|
||||||
|
|||||||
@@ -219,9 +219,6 @@ private:
|
|||||||
bool _abort_front_transition;
|
bool _abort_front_transition;
|
||||||
|
|
||||||
VtolType *_vtol_type = nullptr; // base class for different vtol types
|
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***********************************************************************
|
//*****************Member functions***********************************************************************
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user