Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Executors types #1370

Open
wants to merge 42 commits into
base: rolling
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
1198c24
Add types to wait_for_message.py
InvincibleRMC Jul 31, 2024
a819955
Add copyright
InvincibleRMC Jul 31, 2024
6b52d12
re-run CI
InvincibleRMC Jul 31, 2024
a6072c1
re-run CI
InvincibleRMC Jul 31, 2024
37c87da
Merge branch 'rolling' into wait-for-message
InvincibleRMC Aug 9, 2024
e39049a
move Handles into _rclpy_pybind11
InvincibleRMC Aug 10, 2024
33cf136
Move Handles into type stubs:
InvincibleRMC Aug 10, 2024
22edf24
Move Handles into type stubs
InvincibleRMC Aug 10, 2024
90f1518
move [] into string
InvincibleRMC Aug 10, 2024
1019bcc
fix imports
InvincibleRMC Aug 10, 2024
7f22be9
remove extra line
InvincibleRMC Aug 10, 2024
a61090f
puy _rclpy.Publisher in quotes
InvincibleRMC Aug 10, 2024
c18a10a
fix capitalization
InvincibleRMC Aug 10, 2024
e45fd69
Add EventHandle Constructor
InvincibleRMC Aug 10, 2024
e010378
Use RuntimeError for context
InvincibleRMC Aug 21, 2024
05d5094
Merge branch 'rolling' into wait-for-message
mergify[bot] Aug 21, 2024
47c43f5
Add TYPE_CHECKING import
InvincibleRMC Aug 22, 2024
96a292a
init
InvincibleRMC Aug 23, 2024
5437278
Merge branch 'rolling' into executors
InvincibleRMC Aug 23, 2024
aa67ae0
stash
InvincibleRMC Aug 24, 2024
935b1e3
more progress
InvincibleRMC Aug 24, 2024
b41076b
done
InvincibleRMC Aug 24, 2024
1d6d302
move type into string
InvincibleRMC Aug 24, 2024
ced9524
rclpy.impl
InvincibleRMC Aug 24, 2024
e7740fc
spelling error and type in string
InvincibleRMC Aug 24, 2024
f3adfc2
type in string
InvincibleRMC Aug 24, 2024
0dfd085
Narrow Task[] type
InvincibleRMC Aug 27, 2024
13b3d84
Merge branch 'rolling' into executors
InvincibleRMC Aug 30, 2024
57e3df0
remove if statements around nodes_to_use
InvincibleRMC Aug 30, 2024
9273c86
Merge branch 'rolling' into executors
InvincibleRMC Aug 31, 2024
4455524
merge
InvincibleRMC Sep 4, 2024
ea806d6
merge
InvincibleRMC Sep 4, 2024
06f21d4
Merge branch 'rolling' into executors
InvincibleRMC Sep 4, 2024
47885b7
Merge branch 'rolling' into executors
InvincibleRMC Sep 7, 2024
b4e29f7
Change Generic Srv/Cli
InvincibleRMC Sep 7, 2024
1fe98d4
Update rclpy/rclpy/executors.py
InvincibleRMC Sep 7, 2024
cd7db1d
EntityT cleanup
InvincibleRMC Sep 8, 2024
0668b41
Fix Optional goof
InvincibleRMC Sep 9, 2024
cbe2000
Merge branch 'ros2:rolling' into executors
InvincibleRMC Oct 4, 2024
c196595
remove SrvEventT
InvincibleRMC Oct 4, 2024
2864cde
Only 2 args for srv/client
InvincibleRMC Oct 4, 2024
dd6b1b8
fix Callable[]
InvincibleRMC Oct 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion rclpy/rclpy/callback_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
from rclpy.service import Service
from rclpy.waitable import Waitable
from rclpy.guard_condition import GuardCondition
Entity = Union[Subscription, Timer, Client, Service, Waitable[Any], GuardCondition]
Entity = Union[Subscription[Any], Timer, Client[Any, Any], Service[Any, Any],
GuardCondition, Waitable[Any]]


class CallbackGroup:
Expand Down
8 changes: 4 additions & 4 deletions rclpy/rclpy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@
from rclpy.qos import QoSProfile
from rclpy.service_introspection import ServiceIntrospectionState
from rclpy.task import Future
from rclpy.type_support import Srv, SrvEventT, SrvRequestT, SrvResponseT
from rclpy.type_support import Srv, SrvRequestT, SrvResponseT

# Left To Support Legacy TypeVars
SrvType = TypeVar('SrvType')
SrvTypeRequest = TypeVar('SrvTypeRequest')
SrvTypeResponse = TypeVar('SrvTypeResponse')


class Client(Generic[SrvRequestT, SrvResponseT, SrvEventT]):
class Client(Generic[SrvRequestT, SrvResponseT]):
def __init__(
self,
context: Context,
client_impl: _rclpy.Client,
srv_type: Type[Srv[SrvRequestT, SrvResponseT, SrvEventT]],
srv_type: Type[Srv[SrvRequestT, SrvResponseT]],
srv_name: str,
qos_profile: QoSProfile,
callback_group: CallbackGroup
Expand Down Expand Up @@ -231,7 +231,7 @@ def destroy(self) -> None:
"""
self.__client.destroy_when_not_in_use()

def __enter__(self) -> 'Client[SrvRequestT, SrvResponseT, SrvEventT]':
def __enter__(self) -> 'Client[SrvRequestT, SrvResponseT]':
return self

def __exit__(
Expand Down
Loading