mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 03:43:34 +08:00
libuavcan: Convenience method NodeStatusProvider::setStatusPublishingPeriod()
This commit is contained in:
@@ -58,9 +58,6 @@ public:
|
||||
UAVCAN_ASSERT(!creation_timestamp_.isZero());
|
||||
|
||||
node_info_.status.status_code = protocol::NodeStatus::STATUS_INITIALIZING;
|
||||
|
||||
// NodeStatus TX timeout equals its publication period minus some arbitrary time gap:
|
||||
node_status_pub_.setTxTimeout(MonotonicDuration::fromMSec(protocol::NodeStatus::PUBLICATION_PERIOD_MS - 10));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -75,6 +72,14 @@ public:
|
||||
*/
|
||||
int forcePublish() { return publish(); }
|
||||
|
||||
/**
|
||||
* Allows to override default publishing rate for uavcan.protocol.NodeStatus.
|
||||
* Refer to the DSDL definition of uavcan.protocol.NodeStatus to see what is the default rate.
|
||||
* Doesn't fail; if the value is outside of acceptable range, a closest valid value will be used instead.
|
||||
*/
|
||||
void setStatusPublishingPeriod(uavcan::MonotonicDuration period);
|
||||
uavcan::MonotonicDuration getStatusPublishingPeriod() const;
|
||||
|
||||
/**
|
||||
* Local node status code control.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user