1 #ifndef CONTROLS_UTILS_NODEUTILS_H
2 #define CONTROLS_UTILS_NODEUTILS_H
6 #include <rclcpp/rclcpp.hpp>
21 inline static std::shared_ptr<rclcpp::Node>
node_;
32 return node_->get_clock()->now().seconds();
41 return rclcpp::Clock{RCL_SYSTEM_TIME}.now().seconds();
60 return node_->get_logger();
62 return rclcpp::get_logger(
"controls");
Singleton utility providing access to the shared ROS node and time functions.
Definition: NodeUtils.h:16
static double current_ros_time()
Returns the current ROS clock time in seconds.
Definition: NodeUtils.h:28
static double current_system_time()
Returns the current system (wall-clock) time in seconds.
Definition: NodeUtils.h:40
static rclcpp::Logger get_logger()
Returns the ROS logger associated with the shared node.
Definition: NodeUtils.h:58
static rclcpp::Time current_ros_stamp()
Returns the current ROS time as an rclcpp::Time stamp.
Definition: NodeUtils.h:49
static std::shared_ptr< rclcpp::Node > node_
Shared pointer to the single active ROS2 node.
Definition: NodeUtils.h:21
Definition: NodeUtils.h:8