Python YASMIN (Yet Another State MachINe)
Loading...
Searching...
No Matches
yasmin_ros.yasmin_node.YasminNode Class Reference
Inheritance diagram for yasmin_ros.yasmin_node.YasminNode:
Collaboration diagram for yasmin_ros.yasmin_node.YasminNode:

Public Member Functions

None __init__ (self)
 

Static Public Member Functions

"YasminNode" get_instance ()
 

Protected Attributes

MultiThreadedExecutor _executor = MultiThreadedExecutor()
 Executor for managing node operations.
 
Thread _spin_thread = Thread(target=self._executor.spin)
 Thread to execute the spinning of the node.
 

Static Protected Attributes

str _instance = None
 The single instance of YasminNode.
 
RLock _lock = RLock()
 Lock to control access to the instance.
 

Detailed Description

A ROS 2 node for managing and handling YASMIN-based applications.

YasminNode is a singleton class derived from Node and integrates
custom functionalities for executing specific tasks in a ROS 2 environment.

Attributes:
    _instance (YasminNode): The single instance of YasminNode.
    _lock (RLock): A reentrant lock for thread safety.
    _executor (MultiThreadedExecutor): Executor for managing multiple threads.
    _spin_thread (Thread): Thread for spinning the node.

Raises:
    RuntimeError: Raised when attempting to instantiate the node more than once.

Constructor & Destructor Documentation

◆ __init__()

None yasmin_ros.yasmin_node.YasminNode.__init__ ( self)
Default constructor. Initializes the node with a unique name.

This constructor initializes the ROS 2 Node and
starts a MultiThreadedExecutor for handling node callbacks.
It raises a RuntimeError if an attempt is made to create a second instance
of this Singleton class.

Raises:
    RuntimeError: Raised when an attempt is made to create
    more than one instance of YasminNode.

Member Function Documentation

◆ get_instance()

"YasminNode" yasmin_ros.yasmin_node.YasminNode.get_instance ( )
static
Provides access to the singleton instance of YasminNode.

This method ensures there is only one instance of YasminNode running.

Returns:
    YasminNode: A reference to the YasminNode instance.

Raises:
    RuntimeError: Raised if the creation of the instance fails.

Member Data Documentation

◆ _executor

MultiThreadedExecutor yasmin_ros.yasmin_node.YasminNode._executor = MultiThreadedExecutor()
protected

Executor for managing node operations.

◆ _instance

str yasmin_ros.yasmin_node.YasminNode._instance = None
staticprotected

The single instance of YasminNode.

◆ _lock

RLock yasmin_ros.yasmin_node.YasminNode._lock = RLock()
staticprotected

Lock to control access to the instance.

◆ _spin_thread

Thread yasmin_ros.yasmin_node.YasminNode._spin_thread = Thread(target=self._executor.spin)
protected

Thread to execute the spinning of the node.


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