|
nros C++ API
Lightweight ROS 2 client for embedded real-time systems (C++ headers)
|
#include <stream.hpp>
Public Member Functions | |
| bool | is_valid () const |
| Check if the stream is connected to a valid source. | |
| Stream & | operator= (Stream &&other) noexcept |
| Stream () | |
| Default constructor – creates an unbound stream. | |
| Stream (Stream &&other) noexcept | |
| Result | try_next (T &out) |
| Result | wait_next (void *executor_handle, uint32_t timeout_ms, T &out, uint32_t poll_ms=10) |
Friends | |
| template<typename A > | |
| class | ActionClient |
| template<typename M > | |
| class | Subscription |
Multi-shot message receiver for subscriptions and feedback streams.
Unlike Future<T> (single-shot, move-only), Stream<T> yields multiple values over time. It wraps a non-blocking poll function and adds wait_next() for blocking reception with executor spin.
Usage:
|
inline |
Default constructor – creates an unbound stream.
|
inline |
Check if the stream is connected to a valid source.
Try to receive the next value (non-blocking).
| out | Output object (filled on success). |
|
inline |
Block until the next value arrives, spinning the executor.
| executor_handle | Raw executor handle. |
| timeout_ms | Maximum wait time in milliseconds. |
| out | Output object (filled on success). |
| poll_ms | Per-iteration spin_once timeout in ms (default 10). See Future::wait for the trade-off between latency and wakeup frequency. |