|
nros C++ API
Lightweight ROS 2 client for embedded real-time systems (C++ headers)
|
#include <rclcpp.hpp>
Public Member Functions | |
| ::rclcpp::Duration | period () const |
| Rate (::rclcpp::Duration period) | |
| Rate (double frequency_hz) | |
| void | reset () |
rclcpp::Rate::reset() — anchor the next tick one period from now. | |
| bool | sleep () |
rclcpp::Rate — a periodic loop rate, driven by the nano-ros executor. See the envelope above; the differences from upstream are real.
|
inlineexplicit |
Construct from a frequency in Hz. 0 or negative disables the rate: sleep() becomes a no-op returning false.
|
inlineexplicit |
Construct from a period — rclcpp::Rate(rclcpp::Duration::from_nanoseconds(n)). The always-available spelling, on every target.
|
inline |
The configured period.
rclcpp::Duration rather than std::chrono::nanoseconds (phase-442 W5): a return type that exists only where <chrono> does would keep the whole class hostage to the toolchain, which is what this work item removed. .nanoseconds() is the same number upstream's .count() gives.
|
inline |
rclcpp::Rate::reset() — anchor the next tick one period from now.
|
inline |
Spin the executor until the next tick is due.
true if there was time left to wait, false if the loop had already overrun the period (upstream's contract) or the rate is disabled.