mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 17:23:34 +08:00
suggestion for treating obstacle avoidance heartbeats
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user