adapted to new vehicle attitude message

This commit is contained in:
tumbili
2016-10-18 20:46:08 +02:00
committed by Lorenz Meier
parent 215bfaa377
commit 5e0e522903
16 changed files with 142 additions and 94 deletions
+6 -2
View File
@@ -131,6 +131,10 @@ void Tailsitter::update_vtol_state()
* For the backtransition the pitch is controlled in MC mode again and switches to full MC control reaching the sufficient pitch angle.
*/
matrix::Quaternion<float> q(&_v_att->q[0]);
matrix::Euler<float> euler(q);
float pitch = euler(1);
if (!_attc->is_fixed_wing_requested()) {
@@ -157,7 +161,7 @@ void Tailsitter::update_vtol_state()
case TRANSITION_BACK:
// check if we have reached pitch angle to switch to MC mode
if (_v_att->pitch >= PITCH_TRANSITION_BACK) {
if (pitch >= PITCH_TRANSITION_BACK) {
_vtol_schedule.flight_mode = MC_MODE;
}
@@ -180,7 +184,7 @@ void Tailsitter::update_vtol_state()
// check if we have reached airspeed and pitch angle to switch to TRANSITION P2 mode
if ((_airspeed->indicated_airspeed_m_s >= _params_tailsitter.airspeed_trans
&& _v_att->pitch <= PITCH_TRANSITION_FRONT_P1) || can_transition_on_ground()) {
&& pitch <= PITCH_TRANSITION_FRONT_P1) || can_transition_on_ground()) {
_vtol_schedule.flight_mode = FW_MODE;
//_vtol_schedule.transition_start = hrt_absolute_time();
}