mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 07:41:36 +08:00
NodeInitializer - performs network checks during intialization: NodeID collisions, incompatible data types
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <uavcan/node/subscriber.hpp>
|
||||
#include <uavcan/node/timer.hpp>
|
||||
#include <uavcan/node/service_client.hpp>
|
||||
#include <uavcan/util/method_binder.hpp>
|
||||
#include "../node/test_node.hpp"
|
||||
@@ -86,3 +87,19 @@ struct ServiceClientWithCollector
|
||||
return client.call(node_id, request);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct BackgroundSpinner : uavcan::TimerBase
|
||||
{
|
||||
uavcan::INode& spinning_node;
|
||||
|
||||
BackgroundSpinner(uavcan::INode& spinning_node, uavcan::INode& running_node)
|
||||
: uavcan::TimerBase(running_node)
|
||||
, spinning_node(spinning_node)
|
||||
{ }
|
||||
|
||||
void handleTimerEvent(const uavcan::TimerEvent&)
|
||||
{
|
||||
spinning_node.spin(uavcan::MonotonicDuration::fromMSec(1));
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user