nros C++ API
Lightweight ROS 2 client for embedded real-time systems (C++ headers)
Loading...
Searching...
No Matches
rclcpp::NodeWithTimers< MaxTimers > Class Template Reference

#include <node.hpp>

Inheritance diagram for rclcpp::NodeWithTimers< MaxTimers >:
Collaboration diagram for rclcpp::NodeWithTimers< MaxTimers >:

Public Member Functions

template<class C, void(C::*)() Method>
Result create_timer_in_group (const ::rclcpp::CallbackGroup &group, Timer &out, uint64_t period_ms, C *self)
Result create_timer_in_group (const ::rclcpp::CallbackGroup &group, Timer &out, uint64_t period_ms, nros_cpp_timer_callback_t callback, void *context=nullptr)
template<class C, void(C::*)() Method>
void create_timer_in_group (const CallbackGroup &group, uint64_t period_ms)
void create_timer_in_group (const CallbackGroup &group, uint64_t period_ms, nros_cpp_timer_callback_t callback, void *context=nullptr)
 The plain C callback + ctx form, in a group, parked in the pool.
template<typename Cb>
::rclcpp::TimerHandle create_wall_timer (::rclcpp::Duration period, Cb cb, const ::rclcpp::CallbackGroup *group=nullptr, bool autostart=true)
template<class C, void(C::*)() Method>
Result create_wall_timer (Timer &out, uint64_t period_ms, C *self)
Result create_wall_timer (Timer &out, uint64_t period_ms, nros_cpp_timer_callback_t callback, void *context=nullptr)
template<class C, void(C::*)() Method>
void create_wall_timer_in (uint64_t period_ms)
void create_wall_timer_in (uint64_t period_ms, nros_cpp_timer_callback_t callback, void *context=nullptr)
 The plain C callback + ctx escape hatch, parked in the pool.
 Node ()
 Node (::rclcpp::NodeHandle handle, const char *name, const char *ns=nullptr)
 Node (const char *name, const ::rclcpp::NodeOptions &options)
 Node (const char *name, const char *ns, const ::rclcpp::NodeOptions &options)
 Node (const char *name, const char *ns=nullptr)
 Node (Node &&other)
Public Member Functions inherited from rclcpp::Node
Result add_on_set_parameters_callback (OnSetParametersCallbackType callback, void *context, OnSetParametersCallbackToken &out_handle)
bool check_declared_depth (const char *type_name, const char *topic, const ::rclcpp::QoS &qos)
bool check_declared_param (const char *name, int passed_type)
bool check_declared_qos (const char *type_name, const char *topic, const ::rclcpp::QoS &qos)
Result count_clients (const char *service_name, size_t *out_count) const
Result count_publishers (const char *topic_name, size_t *out_count) const
Result count_services (const char *service_name, size_t *out_count) const
Result count_subscribers (const char *topic_name, size_t *out_count) const
template<typename A>
Result create_action_client (::rclcpp_action::Client< A > &out, const char *action_name, const ::rclcpp::QoS &qos=::rclcpp::QoS::services())
template<typename A>
Result create_action_server (::rclcpp_action::Server< A > &out, const char *action_name, const ::rclcpp::QoS &qos=::rclcpp::QoS::services(), const ::rclcpp::ActionServerOptions &options={})
::rclcpp::CallbackGroup::SharedPtr create_callback_group (::rclcpp::CallbackGroupType type, bool automatically_add_to_executor_with_node=true)
::rclcpp::CallbackGroup create_callback_group (const char *name)
template<typename S, typename F, typename = typename std::enable_if< std::is_convertible<F, void (*)(const typename S::Response&)>::value>::type>
Result create_client (::rclcpp::Client< S > &out, const char *service_name, F callback, const ::rclcpp::QoS &qos=::rclcpp::QoS::services(), const ::rclcpp::ClientOptions &options={})
template<typename S>
Result create_client (::rclcpp::PollClient< S > &out, const char *service_name, const ::rclcpp::QoS &qos=::rclcpp::QoS::services())
template<typename S, typename F, typename>
Result create_client (Client< S > &out, const char *service_name, F callback, const ::rclcpp::QoS &qos, const ::rclcpp::ClientOptions &options)
template<typename S, typename F, typename, typename>
Client< S >::SharedPtr create_client (const char *, F, const ::rclcpp::QoS &)
template<typename S, typename F, typename = typename ::rclcpp::tr::enable_if< !::rclcpp::detail::is_qos_arg<F>::value && !::rclcpp::tr::is_convertible<F, void (*)(const typename S::Response&)>::value>::type, typename = void>
typename::rclcpp::Client< S >::SharedPtr create_client (const char *, F, const ::rclcpp::QoS &=::rclcpp::QoS::services())
 REFUSED — upstream's shared_ptr handler shape.
template<typename S>
inline ::rclcpp::Owned<::rclcpp::PollClient< S > > create_client (const char *name, const ::rclcpp::QoS &qos)
template<typename S>
::rclcpp::Owned<::rclcpp::PollClient< S > > create_client (const char *name, const ::rclcpp::QoS &qos=::rclcpp::QoS::services())
template<typename S, typename F, typename>
Client< S >::SharedPtr create_client (const char *name, F callback, const ::rclcpp::QoS &qos)
template<typename S, typename F, typename = typename ::rclcpp::tr::enable_if<::rclcpp::tr::is_convertible< F, void (*)(const typename S::Response&)>::value>::type>
typename::rclcpp::Client< S >::SharedPtr create_client (const char *name, F callback, const ::rclcpp::QoS &qos=::rclcpp::QoS::services())
 Callback-style service client (void(const S::Response&)).
template<typename A, typename B, typename... R>
void create_generic_publisher (const A &topic, const B &type, const ::rclcpp::QoS &qos, const R &...)
::rclcpp::Owned<::rclcpp::GenericPublisher > create_generic_publisher (const char *topic, const char *type, const char *type_hash, const ::rclcpp::QoS &qos=::rclcpp::QoS::default_profile())
template<typename A, typename B, typename Cb, typename... R>
void create_generic_subscription (const A &topic, const B &type, const ::rclcpp::QoS &qos, Cb &&callback, const R &...)
template<typename Cb>
::rclcpp::SubscriptionHandle<::rclcpp::GenericSubscription > create_generic_subscription (const char *topic, const char *type, const char *type_hash, const ::rclcpp::QoS &qos, Cb callback)
template<typename Cb>
inline ::rclcpp::SubscriptionHandle<::rclcpp::GenericSubscription > create_generic_subscription (const char *topic, const char *type, const char *type_hash, const ::rclcpp::QoS &qos, Cb callback)
Result create_guard_condition (::rclcpp::GuardCondition &out, nros_cpp_guard_callback_t callback, void *context=nullptr)
template<typename A>
Result create_polling_action_client (::rclcpp::PollingActionClient< A > &out, const char *action_name)
 Phase 122.3.d.b — Create an L1 polling-mode action client.
template<typename A>
Result create_polling_action_server (::rclcpp::PollingActionServer< A > &out, const char *action_name)
template<typename M>
Result create_polling_subscription (::rclcpp::PollingSubscription< M > &out, const char *topic, const ::rclcpp::QoS &qos=::rclcpp::QoS::default_profile())
template<typename M>
Result create_publisher (::rclcpp::Publisher< M > &out, const char *topic, const ::rclcpp::QoS &qos, const ::rclcpp::PublisherOptions &options)
template<typename M>
Result create_publisher (::rclcpp::Publisher< M > &out, const char *topic, const ::rclcpp::QoS &qos=::rclcpp::QoS::default_profile())
template<typename M>
typename::rclcpp::Publisher< M >::SharedPtr create_publisher (const char *topic, ::size_t depth)
 create_publisher<M>(topic, depth) — the integer-depth spelling.
template<typename M>
Publisher< M >::SharedPtr create_publisher (const char *topic, ::size_t depth)
template<typename M>
Publisher< M >::SharedPtr create_publisher (const char *topic, const ::rclcpp::QoS &qos)
template<typename M>
typename::rclcpp::Publisher< M >::SharedPtr create_publisher (const char *topic, const ::rclcpp::QoS &qos=::rclcpp::QoS::default_profile())
 create_publisher<M>(topic, qos) — available on every target.
template<typename M>
Result create_publisher (Publisher< M > &out, const char *topic, const ::rclcpp::QoS &qos)
template<typename M>
Result create_publisher (Publisher< M > &out, const char *topic, const ::rclcpp::QoS &qos, const ::rclcpp::PublisherOptions &options)
template<typename M>
::rclcpp::Publisher< M > create_publisher_in (const char *topic, const ::rclcpp::QoS &qos=::rclcpp::QoS::default_profile())
template<typename M>
Result create_publisher_in_group (const ::rclcpp::CallbackGroup &, ::rclcpp::Publisher< M > &out, const char *topic, const ::rclcpp::QoS &qos=::rclcpp::QoS::default_profile())
template<typename S>
Result create_service (::rclcpp::PollService< S > &out, const char *service_name, const ::rclcpp::QoS &qos=::rclcpp::QoS::services())
template<typename S, typename F, typename = typename std::enable_if<std::is_convertible< F, void (*)(const typename S::Request&, typename S::Response&)>::value>::type>
Result create_service (::rclcpp::Service< S > &out, const char *service_name, F callback, const ::rclcpp::QoS &qos=::rclcpp::QoS::services(), const ::rclcpp::ServiceOptions &options={})
template<typename S, typename F, typename = typename ::rclcpp::tr::enable_if< !::rclcpp::detail::is_qos_arg<F>::value && !::rclcpp::tr::is_convertible<F, void (*)(const typename S::Request&, typename S::Response&)>::value>::type, typename = void>
typename::rclcpp::Service< S >::SharedPtr create_service (const char *, F, const ::rclcpp::QoS &=::rclcpp::QoS::services())
template<typename S>
inline ::rclcpp::Owned<::rclcpp::PollService< S > > create_service (const char *name, const ::rclcpp::QoS &qos)
template<typename S>
::rclcpp::Owned<::rclcpp::PollService< S > > create_service (const char *name, const ::rclcpp::QoS &qos=::rclcpp::QoS::services())
template<typename S, typename F, typename, typename>
Service< S >::SharedPtr create_service (const char *name, F callback, const ::rclcpp::QoS &qos)
template<typename S, typename F, typename>
Service< S >::SharedPtr create_service (const char *name, F callback, const ::rclcpp::QoS &qos)
template<typename S, typename F>
typename::rclcpp::Service< S >::SharedPtr create_service (const char *name, F callback, const ::rclcpp::QoS &qos, const ::rclcpp::CallbackGroup *group)
template<typename S, typename F>
Service< S >::SharedPtr create_service (const char *name, F callback, const ::rclcpp::QoS &qos, const ::rclcpp::CallbackGroup *group)
template<typename S, typename F, typename = typename ::rclcpp::tr::enable_if<::rclcpp::tr::is_convertible< F, void (*)(const typename S::Request&, typename S::Response&)>::value>::type>
typename::rclcpp::Service< S >::SharedPtr create_service (const char *name, F callback, const ::rclcpp::QoS &qos=::rclcpp::QoS::services())
 Callback-style service server (void(const S::Request&, S::Response&)).
template<typename S, typename F, typename>
Result create_service (Service< S > &out, const char *service_name, F callback, const ::rclcpp::QoS &qos, const ::rclcpp::ServiceOptions &options)
template<typename M>
Result create_subscription (::rclcpp::PollSubscription< M > &out, const char *topic, const ::rclcpp::QoS &qos, const ::rclcpp::SubscriptionOptions &options)
template<typename M>
Result create_subscription (::rclcpp::PollSubscription< M > &out, const char *topic, const ::rclcpp::QoS &qos=::rclcpp::QoS::default_profile())
template<typename M, typename F, typename = typename std::enable_if<std::is_convertible<F, void (*)(const M&)>::value>::type>
Result create_subscription (::rclcpp::Subscription< M > &out, const char *topic, const ::rclcpp::QoS &qos, F callback, const ::rclcpp::SubscriptionOptions &options={})
template<typename M, typename Cb>
typename::rclcpp::Subscription< M >::SharedPtr create_subscription (const char *topic, ::size_t depth, Cb cb)
 create_subscription<M>(topic, depth, callback).
template<typename M, typename Cb>
Subscription< M >::SharedPtr create_subscription (const char *topic, ::size_t depth, Cb cb)
template<typename M, typename Cb>
typename::rclcpp::Subscription< M >::SharedPtr create_subscription (const char *topic, ::size_t depth, Cb cb, const ::rclcpp::SubscriptionOptions &options)
 create_subscription<M>(topic, depth, callback, options).
template<typename M, typename Cb>
Subscription< M >::SharedPtr create_subscription (const char *topic, ::size_t depth, Cb cb, const ::rclcpp::SubscriptionOptions &options)
template<typename M, typename Cb>
typename::rclcpp::Subscription< M >::SharedPtr create_subscription (const char *topic, const ::rclcpp::QoS &qos, Cb cb)
template<typename M, typename Cb>
Subscription< M >::SharedPtr create_subscription (const char *topic, const ::rclcpp::QoS &qos, Cb cb)
template<typename M, typename Cb>
typename::rclcpp::Subscription< M >::SharedPtr create_subscription (const char *topic, const ::rclcpp::QoS &qos, Cb cb, const ::rclcpp::SubscriptionOptions &options)
template<typename M, typename Cb>
Subscription< M >::SharedPtr create_subscription (const char *topic, const ::rclcpp::QoS &qos, Cb cb, const ::rclcpp::SubscriptionOptions &options)
template<typename M, typename F, typename>
Result create_subscription (Subscription< M > &out, const char *topic, const ::rclcpp::QoS &qos, F callback, const ::rclcpp::SubscriptionOptions &options)
template<typename M, class C, void(C::*)(const M &msg) Method>
void create_subscription_in (const char *topic, const ::rclcpp::QoS &qos=::rclcpp::QoS::default_profile())
template<typename M, typename F, typename = typename std::enable_if<std::is_convertible<F, void (*)(const M&)>::value>::type>
Result create_subscription_in_group (const ::rclcpp::CallbackGroup &group, ::rclcpp::Subscription< M > &out, const char *topic, const ::rclcpp::QoS &qos, F callback, const ::rclcpp::SubscriptionOptions &options={})
template<typename M, class C, void(C::*)(const M &msg) Method>
void create_subscription_in_group (const ::rclcpp::CallbackGroup &group, const char *topic, const ::rclcpp::QoS &qos=::rclcpp::QoS::default_profile())
template<typename M, typename F, typename>
Result create_subscription_in_group (const ::rclcpp::CallbackGroup &group, Subscription< M > &out, const char *topic, const ::rclcpp::QoS &qos, F callback, const ::rclcpp::SubscriptionOptions &options)
template<typename M, typename F, typename = typename std::enable_if< std::is_convertible<F, void (*)(const M&, const uint8_t*, size_t)>::value>::type>
Result create_subscription_with_info (::rclcpp::Subscription< M > &out, const char *topic, const ::rclcpp::QoS &qos, F callback, const ::rclcpp::SubscriptionOptions &options={})
template<typename M, typename F, typename>
Result create_subscription_with_info (Subscription< M > &out, const char *topic, const ::rclcpp::QoS &qos, F callback, const ::rclcpp::SubscriptionOptions &options)
template<class C, void(C::*)() Method>
Result create_timer (Timer &out, const Clock &clock, uint64_t period_ms, C *self)
Result create_timer (Timer &out, const Clock &clock, uint64_t period_ms, nros_cpp_timer_callback_t callback, void *context=nullptr)
template<class C, void(C::*)() Method>
Result create_timer_in_group (const ::rclcpp::CallbackGroup &group, Timer &out, uint64_t period_ms, C *self)
Result create_timer_in_group (const ::rclcpp::CallbackGroup &group, Timer &out, uint64_t period_ms, nros_cpp_timer_callback_t callback, void *context=nullptr)
Result create_timer_oneshot (Timer &out, uint64_t delay_ms, nros_cpp_timer_callback_t callback, void *context=nullptr)
template<typename Cb>
inline ::rclcpp::TimerHandle create_wall_timer (::rclcpp::Duration period, Cb cb, const ::rclcpp::CallbackGroup *group, bool autostart)
template<typename Cb>
::rclcpp::TimerHandle create_wall_timer (::rclcpp::Duration period, Cb cb, const ::rclcpp::CallbackGroup *group=nullptr, bool autostart=true)
template<class C, void(C::*)() Method>
Result create_wall_timer (Timer &out, uint64_t period_ms, C *self)
Result create_wall_timer (Timer &out, uint64_t period_ms, nros_cpp_timer_callback_t callback, void *context=nullptr)
template<typename T>
T declare_parameter (const char *name, T default_value, const ParameterDescriptor &descriptor)
template<typename T>
T declare_parameter (const char *name, T default_value=T())
 rclcpp::Node::declare_parameter<T>(name, default).
Result describe_parameter (const char *name, ParameterDescriptor &out, char *text, ::size_t text_len) const
int32_t error_code () const
 The raw error code of the first latched failure, or 0.
const char * error_what () const
void * executor_handle () const
const nros_cpp_node_t * ffi_handle () const
template<typename S>
Result finish_register_service_ (Service< S > &out, const char *service_name, nros_cpp_ret_t ret, size_t handle)
Result get_client_names_and_types_by_node (const char *node_name, const char *node_namespace, nros_cpp_names_and_types_visit_fn visit, void *ctx) const
Clock * get_clock ()
const Clock * get_clock () const
 Const overload of get_clock().
Result get_fully_qualified_name (char *buf, size_t buf_len, size_t *out_len=nullptr) const
::rclcpp::Logger get_logger () const
const char * get_name () const
 Get the node name.
const char * get_namespace () const
 Get the node namespace.
::rclcpp::node_interfaces::NodeBaseInterface::SharedPtr get_node_base_interface ()
::rclcpp::node_interfaces::NodeClockInterface::SharedPtr get_node_clock_interface ()
 See get_node_base_interface.
::rclcpp::node_interfaces::NodeGraphInterface::SharedPtr get_node_graph_interface ()
 See get_node_base_interface.
::rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr get_node_logging_interface ()
 See get_node_base_interface.
Result get_node_names (nros_cpp_node_visit_fn visit, void *ctx) const
const ::rclcpp::NodeOptions & get_node_options () const
::rclcpp::node_interfaces::NodeWaitablesInterface::SharedPtr get_node_waitables_interface ()
 See get_node_base_interface.
template<typename T>
T get_parameter (const char *name) const
 Value-returning read; T() when the name is undeclared.
template<typename T>
bool get_parameter (const char *name, T &out) const
template<typename T>
bool get_parameter_or (const char *name, T &out, T fallback) const
ParameterType get_parameter_type (const char *name) const
Result get_parameter_types (const char *const *names, ::size_t count, ParameterType *out) const
Result get_publisher_names_and_types_by_node (const char *node_name, const char *node_namespace, nros_cpp_names_and_types_visit_fn visit, void *ctx) const
Result get_publishers_info_by_topic (const char *topic_name, ::rclcpp::TopicEndpointInfoVisitFn visit, void *ctx) const
Result get_publishers_info_by_topic (const char *topic_name, nros_cpp_endpoint_info_visit_fn visit, void *ctx) const
Result get_service_names_and_types (nros_cpp_names_and_types_visit_fn visit, void *ctx) const
Result get_service_names_and_types_by_node (const char *node_name, const char *node_namespace, nros_cpp_names_and_types_visit_fn visit, void *ctx) const
Result get_subscription_names_and_types_by_node (const char *node_name, const char *node_namespace, nros_cpp_names_and_types_visit_fn visit, void *ctx) const
Result get_subscriptions_info_by_topic (const char *topic_name, ::rclcpp::TopicEndpointInfoVisitFn visit, void *ctx) const
Result get_subscriptions_info_by_topic (const char *topic_name, nros_cpp_endpoint_info_visit_fn visit, void *ctx) const
Result get_topic_names_and_types (nros_cpp_names_and_types_visit_fn visit, void *ctx) const
bool has_parameter (const char *name) const
 rclcpp::Node::has_parameter(name).
Result init (const char *name, const char *ns=nullptr)
Result init_on (void *executor_handle, const char *name, const char *ns=nullptr)
bool initialized () const
bool is_valid () const
 Check if the node is initialized and valid.
Result list_parameters (const char *prefix, char *out_names, ::size_t name_stride, ::size_t max_names, ::size_t &count) const
 Node ()
 Node (::rclcpp::NodeHandle handle, const char *name, const char *ns=nullptr)
 Node (const char *name, const ::rclcpp::NodeOptions &options)
 Node (const char *name, const char *ns, const ::rclcpp::NodeOptions &options)
 Node (const char *name, const char *ns=nullptr)
 Node (Node &&other)
Time now () const
Node & nros_node ()
const Node & nros_node () const
 Const overload of [nros_node].
bool ok () const
Node & operator= (Node &&other)
template<typename S>
Result register_service_ (Service< S > &out, const char *service_name, bool(*trampoline)(const uint8_t *, size_t, uint8_t *, size_t, size_t *, void *), void *context, const ::rclcpp::QoS &qos, const ::rclcpp::ServiceOptions &options, const void *capture, size_t capture_len, void(*capture_drop)(void *))
template<typename S>
Result register_service_ (Service< S > &out, const char *service_name, nros_cpp_service_request_id_callback_t trampoline, void *context, const ::rclcpp::QoS &qos, const ::rclcpp::ServiceOptions &options, const void *capture, size_t capture_len, void(*capture_drop)(void *))
Result remove_on_set_parameters_callback (OnSetParametersCallbackToken handle)
 rclcpp::Node::remove_on_set_parameters_callback(handle).
const char * rmw_implementation_identifier () const
const char * serialization_format () const
void set_error (const char *what, int32_t code)
template<typename T>
Result set_parameter (const char *name, T value)
Result set_parameters_atomically (const ParameterWrite *writes, ::size_t count)
void set_qos_overrides (const nros_cpp_qos_override_t *overrides, size_t len)
SharedPtr shared_from_this ()
ConstSharedPtr shared_from_this () const
 Const overload of [shared_from_this].
Result start_parameter_services ()
Result undeclare_parameter (const char *name)
 ~Node ()

Additional Inherited Members

Public Types inherited from rclcpp::Node
using ConstSharedPtr = ::rclcpp::Handle<const Node>
 rclcpp::Node::ConstSharedPtr.
using ConstWeakPtr = ::rclcpp::Handle<const Node>
 Const spelling of WeakPtr.
using SharedPtr = ::rclcpp::Handle<Node>
using WeakPtr = ::rclcpp::Handle<Node>
Static Public Member Functions inherited from rclcpp::Node
static Result create (Node &out, const char *name, const char *ns=nullptr)

Detailed Description

template<::size_t MaxTimers = 8>
class rclcpp::NodeWithTimers< MaxTimers >

Issue 1131 — the pool is a fixed inline C array, and zero is not a smaller one: Timer timers_[0] is not ISO C++ (GCC/Clang accept it only as the zero-length-array extension). A node that owns no timer does not derive this template at all, which is the real zero.

Below the #ifndef, never above it: an undefined identifier reads as 0 in #if, so a guard above its own default fires on every build (issue 1167). A Node plus an inline pool of MaxTimers rclcpp::Timer slots.

rclcpp::Timer's destructor cancels its timer, so a timer created in a constructor must outlive the call. The out-ref create_wall_timer(Timer&, …) / create_timer_in_group(group, Timer&, …) family on Node makes that the caller's problem, which is the right default. This template is for the component shape, where the storage-free spelling is the ergonomic one:

class Talker : public rclcpp::NodeWithTimers<1> {
public:
explicit Talker(rclcpp::NodeHandle h) : rclcpp::NodeWithTimers<1>(h, "talker") {
pub_ = create_publisher_in<Int32>("/chatter");
}
void on_tick();
};
Definition node.hpp:3226
void create_wall_timer_in(uint64_t period_ms)
Definition node.hpp:3240
::rclcpp::Publisher< M > create_publisher_in(const char *topic, const ::rclcpp::QoS &qos=::rclcpp::QoS::default_profile())
Definition node.hpp:2747
Definition publisher.hpp:178
Definition rclcpp.hpp:75
Definition node.hpp:400

Member Function Documentation

◆ create_timer_in_group() [1/4]

template<::size_t MaxTimers = 8>
template<class C, void(C::*)() Method>
Result rclcpp::Node::create_timer_in_group ( const ::rclcpp::CallbackGroup & group,
Timer & out,
uint64_t period_ms,
C * self )
inline

Bind a member void C::on_tick() as a timer IN a callback group (RFC-0047) — the member-binding half of create_timer_in_group.

◆ create_timer_in_group() [2/4]

template<::size_t MaxTimers = 8>
Result rclcpp::Node::create_timer_in_group ( const ::rclcpp::CallbackGroup & group,
Timer & out,
uint64_t period_ms,
nros_cpp_timer_callback_t callback,
void * context = nullptr )
inline

Create a repeating timer in a callback group (RFC-0047).

Like create_wall_timer but associates the timer with group so the executor binds it to the group's SchedContext via group_sched_table. group.get_name() == nullptr or empty falls back to node default.

Parameters
groupCallback group (from create_callback_group).
outReceives the initialized timer.
period_msTimer period in milliseconds.
callbackC function pointer invoked on each tick.
contextUser context passed to the callback (may be nullptr).

◆ create_timer_in_group() [3/4]

template<::size_t MaxTimers = 8>
template<class C, void(C::*)() Method>
void rclcpp::NodeWithTimers< MaxTimers >::create_timer_in_group ( const CallbackGroup & group,
uint64_t period_ms )
inline

A typed member repeating timer in a callback group (RFC-0047), parked in the pool. Was ComponentNode::create_timer_in<C, Method>.

◆ create_timer_in_group() [4/4]

template<::size_t MaxTimers = 8>
void rclcpp::NodeWithTimers< MaxTimers >::create_timer_in_group ( const CallbackGroup & group,
uint64_t period_ms,
nros_cpp_timer_callback_t callback,
void * context = nullptr )
inline

The plain C callback + ctx form, in a group, parked in the pool.

◆ create_wall_timer() [1/3]

template<::size_t MaxTimers = 8>
template<typename Cb>
::rclcpp::TimerHandle rclcpp::Node::create_wall_timer ( ::rclcpp::Duration period,
Cb cb,
const ::rclcpp::CallbackGroup * group = nullptr,
bool autostart = true )

create_wall_timer(period, callback) — upstream's shape, FREESTANDING.

phase-476 W2. Takes any callable (a capturing lambda, a std::bind result) and returns a two-word [rclcpp::TimerHandle]; the callable is copied into the executor arena, which destroys it when the timer is released, so nothing here allocates and nothing needs <memory> or <functional>. The node owns the timer: destroying the node releases it. Body in nros.hpp.

ADOPT-BOUNDED as before: the period is truncated to whole milliseconds, and a missed deadline catches up where rcl drops (see rclcpp::Timer).

Issue 1974 — Jazzy's (period, callback, group = nullptr, autostart = true). group is a const rclcpp::CallbackGroup* (our group is a value token, so a ported nullptr binds and &group names one); autostart = false creates the timer cancelled until reset(). A callback invocable as void(const rclcpp::TimerInfo&) receives the activation's expected and actual call times.

◆ create_wall_timer() [2/3]

template<::size_t MaxTimers = 8>
template<class C, void(C::*)() Method>
Result rclcpp::Node::create_wall_timer ( Timer & out,
uint64_t period_ms,
C * self )
inline

Bind a member void C::on_tick() as a wall-timer callback.

return node.create_wall_timer<Talker, &Talker::on_tick>(timer_, 1000, this);

◆ create_wall_timer() [3/3]

template<::size_t MaxTimers = 8>
Result rclcpp::Node::create_wall_timer ( Timer & out,
uint64_t period_ms,
nros_cpp_timer_callback_t callback,
void * context = nullptr )
inline

Create a repeating WALL timer — rclcpp::Node::create_wall_timer.

The callback fires during spin_once() at the specified period, measured on the platform's monotonic clock. For a timer that follows simulated time, see create_timer above.

Parameters
outReceives the initialized timer.
period_msTimer period in milliseconds.
callbackC function pointer invoked on each tick.
contextUser context passed to the callback (may be nullptr).

◆ create_wall_timer_in() [1/2]

template<::size_t MaxTimers = 8>
template<class C, void(C::*)() Method>
void rclcpp::NodeWithTimers< MaxTimers >::create_wall_timer_in ( uint64_t period_ms)
inline

Create a typed member repeating wall timer parked in the pool.

Was ComponentNode::create_wall_timer<C, Method>(period_ms); _in because upstream's create_wall_timer(duration, callback) is a different shape on the same type and a signature-only difference is resolved silently. Latches ok()=false on failure or pool exhaustion.

◆ create_wall_timer_in() [2/2]

template<::size_t MaxTimers = 8>
void rclcpp::NodeWithTimers< MaxTimers >::create_wall_timer_in ( uint64_t period_ms,
nros_cpp_timer_callback_t callback,
void * context = nullptr )
inline

The plain C callback + ctx escape hatch, parked in the pool.

◆ Node() [1/6]

template<::size_t MaxTimers = 8>
rclcpp::Node::Node ( )
inline

Default constructor — creates an uninitialized node. Pair with [init].

◆ Node() [2/6]

template<::size_t MaxTimers = 8>
rclcpp::Node::Node ( ::rclcpp::NodeHandle handle,
const char * name,
const char * ns = nullptr )
inlineexplicit

Construct against an EXPLICIT executor-bound handle — what a generated entry writes, and what nros::ComponentNode(NodeHandle, name) was before phase-427 W4 merged it here.

This is the SECOND of the type's two constructors. On a null handle or a creation failure it latches the error rather than aborting: the entry checks ok() post-construct and halts naming this node (RFC-0044 Q2).

Precedence (issue 1456), per HALF of the identity and stated rather than emergent:

launch-declared (on the handle) > this constructor's argument > the type's own default (name is required; ns defaults to UNSET, which since issue 1473 means the EXECUTOR's namespace, not the root)

So a component whose class hardcodes a DIFFERENT name than the launch file declares is named by the LAUNCH FILE, which is the only answer that lets one component class be instantiated twice in one launch file: two Comp(h) : Node(h, "talker") objects would otherwise both be /talker. It is upstream's order too — -r __node:=alpha outranks the literal an rclcpp::Node subclass passes its base.

The halves are independent: a launch file declaring only a namespace leaves the class's name standing (/island/talker), and one declaring neither changes nothing at all. The class's literal is a DEFAULT, never dead — which is what keeps a hand-written main constructing the same component (no entry, no handle identity) working unchanged.

◆ Node() [3/6]

template<::size_t MaxTimers = 8>
rclcpp::Node::Node ( const char * name,
const ::rclcpp::NodeOptions & options )
inline

Upstream's (name, options) constructor, freestanding. The one option NodeOptions carries, clock_type() (issue 1975), picks the node's clock; every other option refuses at its call site (options.hpp).

◆ Node() [4/6]

template<::size_t MaxTimers = 8>
rclcpp::Node::Node ( const char * name,
const char * ns,
const ::rclcpp::NodeOptions & options )
inline

Upstream's (name, namespace, options) constructor, freestanding. No default for options here: Node(name, ns) is the two-argument constructor above, and a default would make that call ambiguous.

◆ Node() [5/6]

template<::size_t MaxTimers = 8>
rclcpp::Node::Node ( const char * name,
const char * ns = nullptr )
inlineexplicit

rclcpp::Node("talker") — upstream's shape, no allocator, every target.

Opens on the GLOBAL executor rclcpp::init() created (issue 0465 — one session per image). ADOPT-BOUNDED: upstream throws where this leaves ok() false, which is weaker, so it has to be LOUD by other means — the generated entry checks ok() and halts naming the node (RFC-0044 Q2), and a hand-written main must check it. The book says so; the compiler cannot.

◆ Node() [6/6]

template<::size_t MaxTimers = 8>
rclcpp::Node::Node ( Node && other)
inline

The documentation for this class was generated from the following file: