mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-14 02:43:33 +08:00
Merge branch 'dynamic_node_id_raft' of https://github.com/UAVCAN/uavcan into dynamic_node_id_raft
This commit is contained in:
@@ -92,6 +92,8 @@ class NodeDiscoverer : TimerBase
|
||||
*/
|
||||
enum { MaxAttemptsToGetNodeInfo = 5 };
|
||||
|
||||
enum { NumNodeStatusStaticReceivers = 64 };
|
||||
|
||||
/*
|
||||
* States
|
||||
*/
|
||||
@@ -102,7 +104,7 @@ class NodeDiscoverer : TimerBase
|
||||
NodeMap node_map_; ///< Will not work in UAVCAN_TINY
|
||||
|
||||
ServiceClient<protocol::GetNodeInfo, GetNodeInfoResponseCallback> get_node_info_client_;
|
||||
Subscriber<protocol::NodeStatus, NodeStatusCallback> node_status_sub_;
|
||||
Subscriber<protocol::NodeStatus, NodeStatusCallback, NumNodeStatusStaticReceivers> node_status_sub_;
|
||||
|
||||
/*
|
||||
* Methods
|
||||
|
||||
@@ -110,6 +110,10 @@ private:
|
||||
handleNodeStatusMessage(msg);
|
||||
}
|
||||
|
||||
protected:
|
||||
/**
|
||||
* This event will be invoked at 2 Hz rate. It can be used by derived classes as well.
|
||||
*/
|
||||
virtual void handleTimerEvent(const TimerEvent&)
|
||||
{
|
||||
const int OfflineTimeoutMs100 = protocol::NodeStatus::OFFLINE_TIMEOUT_MS / 100;
|
||||
@@ -134,7 +138,6 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Called when a node becomes online, changes status or goes offline.
|
||||
* Refer to uavcan.protocol.NodeStatus for the offline timeout value.
|
||||
|
||||
Reference in New Issue
Block a user