Пример #1
0
    def __init__(self, node):
        super().__init__(ReentrantCallbackGroup())

        self.guard_condition = _rclpy.rclpy_create_guard_condition(node.context.handle)
        self.guard_condition_index = None
        self.guard_is_ready = False

        self.node = node
        self.future = None
Пример #2
0
 def __init__(self, callback, callback_group):
     self.guard_handle, self.guard_pointer = _rclpy.rclpy_create_guard_condition(
     )
     self.callback = callback
     self.callback_group = callback_group
     # True when the callback is ready to fire but has not been "taken" by an executor
     self._executor_event = False
     # True when the executor sees this has been triggered but has not yet been handled
     self._executor_triggered = False
Пример #3
0
 def __init__(self, callback, callback_group, context=None):
     self._context = get_default_context() if context is None else context
     self.__handle = Handle(
         _rclpy.rclpy_create_guard_condition(self._context.handle))
     self.callback = callback
     self.callback_group = callback_group
     # True when the callback is ready to fire but has not been "taken" by an executor
     self._executor_event = False
     # True when the executor sees this has been triggered but has not yet been handled
     self._executor_triggered = False
Пример #4
0
    def __init__(self, node):
        super().__init__(ReentrantCallbackGroup())

        self.guard_condition = _rclpy.rclpy_create_guard_condition(node.context.handle)[0]
        self.guard_condition_index = None
        self.guard_is_ready = False

        self.subscription = _rclpy.rclpy_create_subscription(
            node.handle, EmptyMsg, 'test_topic', qos_profile_default.get_c_qos_profile())[0]
        self.subscription_index = None
        self.subscription_is_ready = False

        self.node = node
        self.future = None
Пример #5
0
 def __init__(self):
     super().__init__()
     self._nodes = set()
     self._nodes_lock = _Lock()
     # This is triggered when wait_for_ready_callbacks should rebuild the wait list
     gc, gc_handle = _rclpy.rclpy_create_guard_condition()
     self._guard_condition = gc
     self._guard_condition_handle = gc_handle
     # True if shutdown has been called
     self._is_shutdown = False
     self._work_tracker = _WorkTracker()
     # State for wait_for_ready_callbacks to reuse generator
     self._cb_iter = None
     self._last_args = None
     self._last_kwargs = None
Пример #6
0
 def __init__(self, *, context=None):
     super().__init__()
     self._context = get_default_context() if context is None else context
     self._nodes = set()
     self._nodes_lock = RLock()
     # Tasks to be executed (oldest first) 3-tuple Task, Entity, Node
     self._tasks = []
     self._tasks_lock = Lock()
     # This is triggered when wait_for_ready_callbacks should rebuild the wait list
     gc, gc_handle = _rclpy.rclpy_create_guard_condition(self._context.handle)
     self._guard_condition = gc
     self._guard_condition_handle = gc_handle
     # True if shutdown has been called
     self._is_shutdown = False
     self._work_tracker = _WorkTracker()
     # State for wait_for_ready_callbacks to reuse generator
     self._cb_iter = None
     self._last_args = None
     self._last_kwargs = None
Пример #7
0
 def __init__(self, *, context: Context = None) -> None:
     super().__init__()
     self._context = get_default_context() if context is None else context
     self._nodes: Set[Node] = set()
     self._nodes_lock = RLock()
     # Tasks to be executed (oldest first) 3-tuple Task, Entity, Node
     self._tasks: List[Tuple[Task, Optional[WaitableEntityType],
                             Optional[Node]]] = []
     self._tasks_lock = Lock()
     # This is triggered when wait_for_ready_callbacks should rebuild the wait list
     gc, gc_handle = _rclpy.rclpy_create_guard_condition(
         self._context.handle)
     self._guard_condition = gc
     self._guard_condition_handle = gc_handle
     # True if shutdown has been called
     self._is_shutdown = False
     self._work_tracker = _WorkTracker()
     # Protect against shutdown() being called in parallel in two threads
     self._shutdown_lock = Lock()
     # State for wait_for_ready_callbacks to reuse generator
     self._cb_iter = None
     self._last_args = None
     self._last_kwargs = None
Пример #8
0
 def __init__(self, context=None):
     if context is None:
         context = get_default_context()
     self.guard_handle, _ = _rclpy.rclpy_create_guard_condition(context.handle)
     _signals.rclpy_register_sigint_guard_condition(self.guard_handle)