|
Python YASMIN (Yet Another State MachINe)
|


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. | |
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.
| 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.
|
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.
|
protected |
Executor for managing node operations.
|
staticprotected |
The single instance of YasminNode.
|
staticprotected |
Lock to control access to the instance.
|
protected |
Thread to execute the spinning of the node.