Skip to content

Commit

Permalink
Fix SafeWaitable.add_to_wait_set typing annotation
Browse files Browse the repository at this point in the history
Signed-off-by: Michel Hidalgo <[email protected]>
  • Loading branch information
mhidalgo-bdai committed May 16, 2024
1 parent a411e40 commit 53e5e09
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bdai_ros2_wrappers/bdai_ros2_wrappers/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
from rclpy.callback_groups import CallbackGroup
from rclpy.exceptions import InvalidHandle
from rclpy.node import Node as BaseNode
from rclpy.wait_set import WaitSet
from rclpy.waitables import Waitable

from rclpy.impl.implementation_singleton import rclpy_implementation as _rclpy

from bdai_ros2_wrappers.callback_groups import NonReentrantCallbackGroup
from bdai_ros2_wrappers.logging import MemoizingRcutilsLogger, as_memoizing_logger

Expand All @@ -21,7 +22,7 @@ def __init__(self, wrapped: Waitable) -> None:
def __getattr__(self, name: str) -> Any:
return getattr(self._wrapped, name)

def add_to_wait_set(self, wait_set: WaitSet) -> None:
def add_to_wait_set(self, wait_set: _rclpy.WaitSet) -> None:
"""Add waitable to `wait_set` safely."""
with contextlib.suppress(InvalidHandle):
self._wrapped.add_to_wait_set(wait_set)
Expand Down

0 comments on commit 53e5e09

Please sign in to comment.