mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-22 22:32:11 +08:00
VTOL: Don't overwrite attitude setpoint in Stabilized transition modes (#24406)
Build all targets / Scan for Board Targets (push) Waiting to run
Build all targets / Build Group [${{ matrix.group }}] (push) Blocked by required conditions
Build all targets / Upload Artifacts to S3 (push) Blocked by required conditions
Build all targets / Create Release and Upload Artifacts (push) Blocked by required conditions
Checks / build (NO_NINJA_BUILD=1 px4_fmu-v5_default) (push) Waiting to run
Checks / build (NO_NINJA_BUILD=1 px4_sitl_default) (push) Waiting to run
Checks / build (check_format) (push) Waiting to run
Checks / build (check_newlines) (push) Waiting to run
Checks / build (module_documentation) (push) Waiting to run
Checks / build (px4_fmu-v2_default stack_check) (push) Waiting to run
Checks / build (px4_sitl_allyes) (push) Waiting to run
Checks / build (shellcheck_all) (push) Waiting to run
Checks / build (tests) (push) Waiting to run
Checks / build (tests_coverage) (push) Waiting to run
Checks / build (validate_module_configs) (push) Waiting to run
Clang Tidy / build (push) Waiting to run
MacOS build / build (px4_fmu-v5_default) (push) Waiting to run
MacOS build / build (px4_sitl) (push) Waiting to run
Ubuntu environment build / Build and Test (ubuntu:22.04) (push) Waiting to run
Ubuntu environment build / Build and Test (ubuntu:24.04) (push) Waiting to run
Container build / Build and Push Container (push) Waiting to run
EKF Update Change Indicator / unit_tests (push) Waiting to run
Failsafe Simulator Build / build (failsafe_web) (push) Waiting to run
FLASH usage analysis / Analyzing px4_fmu-v5x (push) Waiting to run
FLASH usage analysis / Analyzing px4_fmu-v6x (push) Waiting to run
MAVROS Mission Tests / build (map[mission:MC_mission_box vehicle:iris]) (push) Waiting to run
MAVROS Mission Tests / build (map[mission:rover_mission_1 vehicle:rover]) (push) Waiting to run
MAVROS Offboard Tests / build (map[test_file:mavros_posix_tests_offboard_posctl.test vehicle:iris]) (push) Waiting to run
Nuttx Target with extra env config / build (px4_fmu-v5_default) (push) Waiting to run
Python CI Checks / build (push) Waiting to run
ROS Translation Node Tests / Build and test (map[ros_version:humble ubuntu:jammy]) (push) Waiting to run
ROS Translation Node Tests / Build and test (map[ros_version:jazzy ubuntu:noble]) (push) Waiting to run
SITL Tests / Testing PX4 tailsitter (push) Waiting to run
SITL Tests / Testing PX4 iris (push) Waiting to run
SITL Tests / Testing PX4 standard_vtol (push) Waiting to run
Build all targets / Scan for Board Targets (push) Waiting to run
Build all targets / Build Group [${{ matrix.group }}] (push) Blocked by required conditions
Build all targets / Upload Artifacts to S3 (push) Blocked by required conditions
Build all targets / Create Release and Upload Artifacts (push) Blocked by required conditions
Checks / build (NO_NINJA_BUILD=1 px4_fmu-v5_default) (push) Waiting to run
Checks / build (NO_NINJA_BUILD=1 px4_sitl_default) (push) Waiting to run
Checks / build (check_format) (push) Waiting to run
Checks / build (check_newlines) (push) Waiting to run
Checks / build (module_documentation) (push) Waiting to run
Checks / build (px4_fmu-v2_default stack_check) (push) Waiting to run
Checks / build (px4_sitl_allyes) (push) Waiting to run
Checks / build (shellcheck_all) (push) Waiting to run
Checks / build (tests) (push) Waiting to run
Checks / build (tests_coverage) (push) Waiting to run
Checks / build (validate_module_configs) (push) Waiting to run
Clang Tidy / build (push) Waiting to run
MacOS build / build (px4_fmu-v5_default) (push) Waiting to run
MacOS build / build (px4_sitl) (push) Waiting to run
Ubuntu environment build / Build and Test (ubuntu:22.04) (push) Waiting to run
Ubuntu environment build / Build and Test (ubuntu:24.04) (push) Waiting to run
Container build / Build and Push Container (push) Waiting to run
EKF Update Change Indicator / unit_tests (push) Waiting to run
Failsafe Simulator Build / build (failsafe_web) (push) Waiting to run
FLASH usage analysis / Analyzing px4_fmu-v5x (push) Waiting to run
FLASH usage analysis / Analyzing px4_fmu-v6x (push) Waiting to run
MAVROS Mission Tests / build (map[mission:MC_mission_box vehicle:iris]) (push) Waiting to run
MAVROS Mission Tests / build (map[mission:rover_mission_1 vehicle:rover]) (push) Waiting to run
MAVROS Offboard Tests / build (map[test_file:mavros_posix_tests_offboard_posctl.test vehicle:iris]) (push) Waiting to run
Nuttx Target with extra env config / build (px4_fmu-v5_default) (push) Waiting to run
Python CI Checks / build (push) Waiting to run
ROS Translation Node Tests / Build and test (map[ros_version:humble ubuntu:jammy]) (push) Waiting to run
ROS Translation Node Tests / Build and test (map[ros_version:jazzy ubuntu:noble]) (push) Waiting to run
SITL Tests / Testing PX4 tailsitter (push) Waiting to run
SITL Tests / Testing PX4 iris (push) Waiting to run
SITL Tests / Testing PX4 standard_vtol (push) Waiting to run
Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -172,11 +172,6 @@ void Standard::update_transition_state()
|
||||
|
||||
VtolType::update_transition_state();
|
||||
|
||||
const Eulerf attitude_setpoint_euler(Quatf(_v_att_sp->q_d));
|
||||
float roll_body = attitude_setpoint_euler.phi();
|
||||
float pitch_body = attitude_setpoint_euler.theta();
|
||||
float yaw_body = attitude_setpoint_euler.psi();
|
||||
|
||||
// we get attitude setpoint from a multirotor flighttask if climbrate is controlled.
|
||||
// in any other case the fixed wing attitude controller publishes attitude setpoint from manual stick input.
|
||||
if (_v_control_mode->flag_control_climb_rate_enabled) {
|
||||
@@ -186,7 +181,6 @@ void Standard::update_transition_state()
|
||||
}
|
||||
|
||||
memcpy(_v_att_sp, _mc_virtual_att_sp, sizeof(vehicle_attitude_setpoint_s));
|
||||
roll_body = Eulerf(Quatf(_fw_virtual_att_sp->q_d)).phi();
|
||||
|
||||
} else {
|
||||
// we need a recent incoming (fw virtual) attitude setpoint, otherwise return (means the previous setpoint stays active)
|
||||
@@ -198,6 +192,16 @@ void Standard::update_transition_state()
|
||||
_v_att_sp->thrust_body[2] = -_fw_virtual_att_sp->thrust_body[0];
|
||||
}
|
||||
|
||||
|
||||
const Eulerf attitude_setpoint_euler(Quatf(_v_att_sp->q_d));
|
||||
float roll_body = attitude_setpoint_euler.phi();
|
||||
float pitch_body = attitude_setpoint_euler.theta();
|
||||
float yaw_body = attitude_setpoint_euler.psi();
|
||||
|
||||
if (_v_control_mode->flag_control_climb_rate_enabled) {
|
||||
roll_body = Eulerf(Quatf(_fw_virtual_att_sp->q_d)).phi();
|
||||
}
|
||||
|
||||
if (_vtol_mode == vtol_mode::TRANSITION_TO_FW) {
|
||||
if (_param_vt_psher_slew.get() <= FLT_EPSILON) {
|
||||
// just set the final target throttle value
|
||||
|
||||
@@ -203,11 +203,6 @@ void Tiltrotor::update_transition_state()
|
||||
|
||||
const hrt_abstime now = hrt_absolute_time();
|
||||
|
||||
const Eulerf attitude_setpoint_euler(Quatf(_v_att_sp->q_d));
|
||||
float roll_body = attitude_setpoint_euler.phi();
|
||||
float pitch_body = attitude_setpoint_euler.theta();
|
||||
float yaw_body = attitude_setpoint_euler.psi();
|
||||
|
||||
// we get attitude setpoint from a multirotor flighttask if altitude is controlled.
|
||||
// in any other case the fixed wing attitude controller publishes attitude setpoint from manual stick input.
|
||||
if (_v_control_mode->flag_control_climb_rate_enabled) {
|
||||
@@ -217,7 +212,6 @@ void Tiltrotor::update_transition_state()
|
||||
}
|
||||
|
||||
memcpy(_v_att_sp, _mc_virtual_att_sp, sizeof(vehicle_attitude_setpoint_s));
|
||||
roll_body = Eulerf(Quatf(_fw_virtual_att_sp->q_d)).phi();
|
||||
_thrust_transition = -_mc_virtual_att_sp->thrust_body[2];
|
||||
|
||||
} else {
|
||||
@@ -231,6 +225,15 @@ void Tiltrotor::update_transition_state()
|
||||
}
|
||||
|
||||
|
||||
const Eulerf attitude_setpoint_euler(Quatf(_v_att_sp->q_d));
|
||||
float roll_body = attitude_setpoint_euler.phi();
|
||||
float pitch_body = attitude_setpoint_euler.theta();
|
||||
float yaw_body = attitude_setpoint_euler.psi();
|
||||
|
||||
if (_v_control_mode->flag_control_climb_rate_enabled) {
|
||||
roll_body = Eulerf(Quatf(_fw_virtual_att_sp->q_d)).phi();
|
||||
}
|
||||
|
||||
if (_vtol_mode == vtol_mode::TRANSITION_FRONT_P1) {
|
||||
// for the first part of the transition all rotors are enabled
|
||||
|
||||
|
||||
Reference in New Issue
Block a user