MAVLink receiver: Do use correct multi-topic architecture

This prevents two inputs publishing to the same topic. Now if both RC and joystick are connected the first to be active gets control. This is not optimal but consistent and safe.
This commit is contained in:
Lorenz Meier
2017-01-19 15:06:01 +01:00
committed by Lorenz Meier
parent cc4fa627c2
commit b1c6494ed7

View File

@@ -1490,13 +1490,10 @@ MavlinkReceiver::handle_message_manual_control(mavlink_message_t *msg)
manual.y = man.y / 1000.0f;
manual.r = man.r / 1000.0f;
manual.z = man.z / 1000.0f;
manual.data_source = manual_control_setpoint_s::SOURCE_MAVLINK_0 + _mavlink->get_instance_id();
if (_manual_pub == nullptr) {
_manual_pub = orb_advertise(ORB_ID(manual_control_setpoint), &manual);
} else {
orb_publish(ORB_ID(manual_control_setpoint), _manual_pub, &manual);
}
int m_inst;
orb_publish_auto(ORB_ID(manual_control_setpoint), &_manual_pub, &manual, &m_inst, ORB_PRIO_LOW);
}
}