controls  3.0.0
Static Public Member Functions | Static Public Attributes | List of all members
Controller::NodeUtils Class Reference

Singleton utility providing access to the shared ROS node and time functions. More...

#include <NodeUtils.h>

Static Public Member Functions

static double current_ros_time ()
 Returns the current ROS clock time in seconds. More...
 
static double current_system_time ()
 Returns the current system (wall-clock) time in seconds. More...
 
static rclcpp::Time current_ros_stamp ()
 Returns the current ROS time as an rclcpp::Time stamp. More...
 
static rclcpp::Logger get_logger ()
 Returns the ROS logger associated with the shared node. More...
 

Static Public Attributes

static std::shared_ptr< rclcpp::Node > node_
 Shared pointer to the single active ROS2 node. More...
 

Detailed Description

Singleton utility providing access to the shared ROS node and time functions.

The node pointer must be set by the application entrypoint before any other method is called. All methods silently degrade when the node is null.

Member Function Documentation

◆ current_ros_stamp()

static rclcpp::Time Controller::NodeUtils::current_ros_stamp ( )
inlinestatic

Returns the current ROS time as an rclcpp::Time stamp.

Returns
Current ROS time as an rclcpp::Time

◆ current_ros_time()

static double Controller::NodeUtils::current_ros_time ( )
inlinestatic

Returns the current ROS clock time in seconds.

Returns
Current ROS time in seconds, or 0.0 if the node is not yet set

◆ current_system_time()

static double Controller::NodeUtils::current_system_time ( )
inlinestatic

Returns the current system (wall-clock) time in seconds.

Returns
Current system time in seconds

◆ get_logger()

static rclcpp::Logger Controller::NodeUtils::get_logger ( )
inlinestatic

Returns the ROS logger associated with the shared node.

Returns
Node logger, or the "controls" logger if no node is set

Member Data Documentation

◆ node_

std::shared_ptr<rclcpp::Node> Controller::NodeUtils::node_
inlinestatic

Shared pointer to the single active ROS2 node.


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