robokudo.io.ros

Attributes

_rk_node

Central RoboKudo ROS node.

_rk_node_lock

Lock for safe creation of the central ROS node.

Functions

init_node(→ rclpy.node.Node)

Initialize the central RoboKudo ROS node. Args and kwargs are passed directly to rclpy.create_node().

get_node(→ rclpy.node.Node)

Get the central RoboKudo ROS node instance.

Module Contents

robokudo.io.ros._rk_node: rclpy.node.Node = None

Central RoboKudo ROS node.

robokudo.io.ros._rk_node_lock

Lock for safe creation of the central ROS node.

robokudo.io.ros.init_node(node_name: str, *args: typing_extensions.Any, **kwargs: typing_extensions.Any) rclpy.node.Node

Initialize the central RoboKudo ROS node. Args and kwargs are passed directly to rclpy.create_node().

Initializes the global rk_node variable if not already initialized. The node can simply be accessed through robokudo.io.ros.rk_node at any time.

Parameters:

node_name – Name of the ROS node

Returns:

The newly created ROS node

robokudo.io.ros.get_node() rclpy.node.Node

Get the central RoboKudo ROS node instance.

Returns:

The central ROS node instance

Raises:

RuntimeError – If the node has not been initialized yet