- fixed bad pitch setpoint in fw pos controller for tailsitter

- created enum for vtol types
- minor cleanup and fixes
This commit is contained in:
tumbili
2016-02-18 18:55:56 +01:00
committed by Lorenz Meier
parent 4c61b05ef3
commit 228a54fd51
4 changed files with 27 additions and 5 deletions
@@ -134,15 +134,15 @@ VtolAttitudeControl::VtolAttitudeControl() :
/* fetch initial parameter values */
parameters_update();
if (_params.vtol_type == 0) {
if (_params.vtol_type == vtol_type::TAILSITTER) {
_tailsitter = new Tailsitter(this);
_vtol_type = _tailsitter;
} else if (_params.vtol_type == 1) {
} else if (_params.vtol_type == vtol_type::TILTROTOR) {
_tiltrotor = new Tiltrotor(this);
_vtol_type = _tiltrotor;
} else if (_params.vtol_type == 2) {
} else if (_params.vtol_type == vtol_type::STANDARD) {
_standard = new Standard(this);
_vtol_type = _standard;
@@ -150,7 +150,6 @@ void VtolType::update_fw_state()
{
// copy virtual attitude setpoint to real attitude setpoint
memcpy(_v_att_sp, _fw_virtual_att_sp, sizeof(vehicle_attitude_setpoint_s));
_mc_roll_weight = 0.0f;
_mc_pitch_weight = 0.0f;
_mc_yaw_weight = 0.0f;
+6
View File
@@ -68,6 +68,12 @@ enum mode {
EXTERNAL
};
enum vtol_type {
TAILSITTER = 0,
TILTROTOR,
STANDARD
};
class VtolAttitudeControl;
class VtolType