mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 23:33:33 +08:00
adapted to new vehicle attitude message
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user