diff --git a/src/modules/fw_att_control/FixedwingAttitudeControl.cpp b/src/modules/fw_att_control/FixedwingAttitudeControl.cpp index cab355695188..988853fdeaaf 100644 --- a/src/modules/fw_att_control/FixedwingAttitudeControl.cpp +++ b/src/modules/fw_att_control/FixedwingAttitudeControl.cpp @@ -105,7 +105,7 @@ FixedwingAttitudeControl::vehicle_manual_poll(const float yaw_body) _att_sp.thrust_body[0] = (_manual_control_setpoint.throttle + 1.f) * .5f; - Quatf q(Eulerf(roll_body, pitch_body, yaw_body)); + const Quatf q(Eulerf(roll_body, pitch_body, yaw_body)); q.copyTo(_att_sp.q_d); _att_sp.reset_integral = false; @@ -324,9 +324,9 @@ void FixedwingAttitudeControl::Run() /* Run attitude controllers */ if (_vcontrol_mode.flag_control_attitude_enabled && _in_fw_or_transition_wo_tailsitter_transition) { - Eulerf setpoint(Quatf(_att_sp.q_d)); - float roll_body = setpoint.phi(); - float pitch_body = setpoint.theta(); + const Eulerf setpoint(Quatf(_att_sp.q_d)); + const float roll_body = setpoint.phi(); + const float pitch_body = setpoint.theta(); if (PX4_ISFINITE(roll_body) && PX4_ISFINITE(pitch_body)) { diff --git a/src/modules/fw_pos_control/FixedwingPositionControl.cpp b/src/modules/fw_pos_control/FixedwingPositionControl.cpp index 0d22725cc6b5..ad0636890681 100644 --- a/src/modules/fw_pos_control/FixedwingPositionControl.cpp +++ b/src/modules/fw_pos_control/FixedwingPositionControl.cpp @@ -1675,6 +1675,7 @@ FixedwingPositionControl::control_auto_takeoff(const hrt_abstime &now, const flo } _flaps_setpoint = _param_fw_flaps_to_scl.get(); + if (!_vehicle_status.in_transition_to_fw) { publishLocalPositionSetpoint(pos_sp_curr); }