rosros 0.2.5
Simple unified interface to ROS1 / ROS2 Python API
Loading...
Searching...
No Matches
rosros.rclify.executors.Executor Class Reference
Inheritance diagram for rosros.rclify.executors.Executor:
Inheritance graph

Public Member Functions

 __init__ (self, *context=None)
 
 add_node (self, node)
 Adds a node to this executor.
 
 create_task (self, callback, *args, **kwargs)
 Adds a callback or coroutine to be executed during spin, returns a Future.
 
 get_nodes (self)
 Return nodes that have been added to this executor.
 
 remove_node (self, node)
 Stop managing this node's callbacks.
 
 shutdown (self, timeout_sec=None)
 Shuts down ROS.
 
 spin (self)
 Waits until ROS shut down.
 
 spin_once (self, timeout_sec=None)
 Waits until timeout, or forever if timeout None or negative, or until ROS shutdown.
 
 spin_once_until_future_complete (self, future, timeout_sec=None)
 Waits until future complete or timeout reached or ROS shut down.
 
 spin_until_future_complete (self, future, timeout_sec=None)
 Waits until future complete or timeout reached or ROS shut down.
 
 wake (self)
 Does nothing (ROS2 compatibility stand-in).
 

Protected Attributes

 _context
 
 _is_shutdown
 
 _nodes
 
 _nodes_lock
 

Properties

 context = property
 Returns context given in constructor, or None ((ROS2 compatibility stand-in).
 

Detailed Description

Definition at line 35 of file executors.py.

Constructor & Destructor Documentation

◆ __init__()

rosros.rclify.executors.Executor.__init__ (   self,
context = None 
)
Parameters
contextignored (ROS2 compatibility stand-in)

Definition at line 41 of file executors.py.

Member Function Documentation

◆ add_node()

rosros.rclify.executors.Executor.add_node (   self,
  node 
)

Adds a node to this executor.

Parameters
nodethe node to add to the executor
Returns
True if the node was added, False if it already existed

Definition at line 82 of file executors.py.

◆ create_task()

rosros.rclify.executors.Executor.create_task (   self,
  callback,
args,
**  kwargs 
)

Adds a callback or coroutine to be executed during spin, returns a Future.

Arguments to this function are passed to the callback.

Parameters
callbacka callback to be run in the executor

Definition at line 62 of file executors.py.

◆ get_nodes()

rosros.rclify.executors.Executor.get_nodes (   self)

Return nodes that have been added to this executor.

Definition at line 102 of file executors.py.

◆ remove_node()

rosros.rclify.executors.Executor.remove_node (   self,
  node 
)

Stop managing this node's callbacks.

Parameters
nodethe node to remove from the executor

Definition at line 94 of file executors.py.

◆ shutdown()

rosros.rclify.executors.Executor.shutdown (   self,
  timeout_sec = None 
)

Shuts down ROS.

Parameters
timeout_secignored (ROS2 compatibility stand-in)
Returns
True

Definition at line 70 of file executors.py.

◆ spin()

rosros.rclify.executors.Executor.spin (   self)

Waits until ROS shut down.

Definition at line 106 of file executors.py.

◆ spin_once()

rosros.rclify.executors.Executor.spin_once (   self,
  timeout_sec = None 
)

Waits until timeout, or forever if timeout None or negative, or until ROS shutdown.

Parameters
timeout_secseconds to wait. Block forever if None or negative. Don't wait if 0.

Definition at line 124 of file executors.py.

◆ spin_once_until_future_complete()

rosros.rclify.executors.Executor.spin_once_until_future_complete (   self,
  future,
  timeout_sec = None 
)

Waits until future complete or timeout reached or ROS shut down.

Parameters
futurethe future to wait on until done.
timeout_secmaximum seconds to wait. Block forever if None or negative. Don't wait if 0.

Definition at line 133 of file executors.py.

◆ spin_until_future_complete()

rosros.rclify.executors.Executor.spin_until_future_complete (   self,
  future,
  timeout_sec = None 
)

Waits until future complete or timeout reached or ROS shut down.

Parameters
futurethe future to wait on until done.
timeout_secmaximum seconds to wait. Block forever if None or negative. Don't wait if 0.

Definition at line 116 of file executors.py.

◆ wake()

rosros.rclify.executors.Executor.wake (   self)

Does nothing (ROS2 compatibility stand-in).

Definition at line 98 of file executors.py.

Member Data Documentation

◆ _context

rosros.rclify.executors.Executor._context
protected

Definition at line 43 of file executors.py.

◆ _is_shutdown

rosros.rclify.executors.Executor._is_shutdown
protected

Definition at line 46 of file executors.py.

◆ _nodes

rosros.rclify.executors.Executor._nodes
protected

Definition at line 44 of file executors.py.

◆ _nodes_lock

rosros.rclify.executors.Executor._nodes_lock
protected

Definition at line 45 of file executors.py.

Property Documentation

◆ context

rosros.rclify.executors.Executor.context = property
static

Returns context given in constructor, or None ((ROS2 compatibility stand-in).

Definition at line 50 of file executors.py.


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