forked from Archive/PX4-Autopilot
fw_pos_control_l1: for tailsitters we need to rotate the body acceleration
vector as it has it's reference in the mc frame Signed-off-by: Roman <bapstroman@gmail.com>
This commit is contained in:
parent
e1e410783a
commit
ab4731a99f
|
@ -1285,6 +1285,15 @@ FixedwingPositionControl::control_position(const math::Vector<2> ¤t_positi
|
|||
|
||||
/* filter speed and altitude for controller */
|
||||
math::Vector<3> accel_body(_sensor_combined.accelerometer_m_s2);
|
||||
|
||||
// tailsitters use the multicopter frame as reference, in fixed wing
|
||||
// we need to use the fixed wing frame
|
||||
if (_parameters.vtol_type == vtol_type::TAILSITTER && _vehicle_status.is_vtol) {
|
||||
float tmp = accel_body(0);
|
||||
accel_body(0) = -accel_body(2);
|
||||
accel_body(2) = tmp;
|
||||
}
|
||||
|
||||
math::Vector<3> accel_earth = _R_nb * accel_body;
|
||||
|
||||
/* tell TECS to update its state, but let it know when it cannot actually control the plane */
|
||||
|
|
Loading…
Reference in New Issue