mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 09:28:58 +00:00
HEARTBEAT and commander failsafe handling cleanup
This commit is contained in:
@@ -1882,17 +1882,19 @@ MavlinkReceiver::handle_message_heartbeat(mavlink_message_t *msg)
|
||||
mavlink_heartbeat_t hb;
|
||||
mavlink_msg_heartbeat_decode(msg, &hb);
|
||||
|
||||
/* ignore own heartbeats, accept only heartbeats from GCS */
|
||||
if (msg->sysid != mavlink_system.sysid && hb.type == MAV_TYPE_GCS) {
|
||||
// ignore own heartbeats
|
||||
if ((msg->sysid != mavlink_system.sysid) && (msg->compid != mavlink_system.compid)) {
|
||||
|
||||
telemetry_status_s &tstatus = _mavlink->get_telemetry_status();
|
||||
|
||||
/* set heartbeat time and topic time and publish -
|
||||
* the telem status also gets updated on telemetry events
|
||||
*/
|
||||
tstatus.heartbeat_time = tstatus.timestamp;
|
||||
tstatus.system_id = msg->sysid;
|
||||
tstatus.component_id = msg->compid;
|
||||
tstatus.heartbeat_time = hrt_absolute_time();
|
||||
tstatus.remote_system_id = msg->sysid;
|
||||
tstatus.remote_component_id = msg->compid;
|
||||
tstatus.remote_type = hb.type;
|
||||
tstatus.remote_system_status = hb.system_status;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user