suggestion for treating obstacle avoidance heartbeats

This commit is contained in:
baumanta
2019-03-12 11:24:33 +01:00
committed by Beat Küng
parent 6dec451bab
commit a98f5d2ab2
5 changed files with 76 additions and 8 deletions
+9 -2
View File
@@ -1882,8 +1882,8 @@ MavlinkReceiver::handle_message_heartbeat(mavlink_message_t *msg)
mavlink_heartbeat_t hb;
mavlink_msg_heartbeat_decode(msg, &hb);
// ignore own heartbeats
if ((msg->sysid != mavlink_system.sysid) && (msg->compid != mavlink_system.compid)) {
/* ignore own heartbeats, accept only heartbeats from GCS */
if (msg->sysid != mavlink_system.sysid || hb.type == MAV_TYPE_ONBOARD_CONTROLLER) {
telemetry_status_s &tstatus = _mavlink->get_telemetry_status();
@@ -1895,6 +1895,13 @@ MavlinkReceiver::handle_message_heartbeat(mavlink_message_t *msg)
tstatus.remote_component_id = msg->compid;
tstatus.remote_type = hb.type;
tstatus.remote_system_status = hb.system_status;
if (_telem_status_pub == nullptr) {
_telem_status_pub = orb_advertise(ORB_ID(telemetry_status), &tstatus);
} else {
orb_publish(ORB_ID(telemetry_status), _telem_status_pub, &tstatus);
}
}
}
}
+1
View File
@@ -253,6 +253,7 @@ private:
orb_advert_t _rc_pub{nullptr};
orb_advert_t _trajectory_waypoint_pub{nullptr};
orb_advert_t _transponder_report_pub{nullptr};
orb_advert_t _telem_status_pub{nullptr};
orb_advert_t _visual_odometry_pub{nullptr};
static constexpr int _gps_inject_data_queue_size{6};