From 4cf51beb4b6708aa559a1067a81b88b7fab47f3f Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 4 Aug 2015 17:44:54 +0200 Subject: [PATCH] FW Att control: Fix merge fail for attitude setpoint --- src/modules/fw_att_control/fw_att_control_main.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/modules/fw_att_control/fw_att_control_main.cpp b/src/modules/fw_att_control/fw_att_control_main.cpp index 93ce10038e..442aaa1702 100644 --- a/src/modules/fw_att_control/fw_att_control_main.cpp +++ b/src/modules/fw_att_control/fw_att_control_main.cpp @@ -945,13 +945,15 @@ FixedwingAttitudeControl::task_main() att_sp.thrust = throttle_sp; /* lazily publish the setpoint only once available */ - if (_attitude_sp_pub != nullptr && !_vehicle_status.is_rotary_wing) { - /* publish the attitude setpoint */ - orb_publish(ORB_ID(vehicle_attitude_setpoint), _attitude_sp_pub, &att_sp); + if (!_vehicle_status.is_rotary_wing) { + if (_attitude_sp_pub != nullptr) { + /* publish the attitude setpoint */ + orb_publish(ORB_ID(vehicle_attitude_setpoint), _attitude_sp_pub, &att_sp); - } else if (_attitude_sp_pub != nullptr && !_vehicle_status.is_rotary_wing) { - /* advertise and publish */ - _attitude_sp_pub = orb_advertise(ORB_ID(vehicle_attitude_setpoint), &att_sp); + } else { + /* advertise and publish */ + _attitude_sp_pub = orb_advertise(ORB_ID(vehicle_attitude_setpoint), &att_sp); + } } }