Skip to content

Generics Services and Clients #1275

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

Merged
merged 41 commits into from
Aug 5, 2024
Merged

Conversation

InvincibleRMC
Copy link
Contributor

Builds off #1239. This solution seems to be the best it can be with current python typing tools. In the future if python/typing#548 ever gets approved it could be made slightly more generic but, for now this implementation is fine.

InvincibleRMC and others added 30 commits March 24, 2024 12:45
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
* Testing out Enum wrapper for ClockType

* convert to rcl_clock_type_t

* Update create_time_point

Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
* Add types to exception

* Add type checking guard

* Fix NotInitializedException

* Add missing defualt

Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: SnIcK <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
* Add types to logging_service.py (ros2#1227)

* add types to logging_service

* Add types to duration.py

* Add newlines for class definintions

* update type alias name

* Update to use Protocols

Signed-off-by: Michael Carlstrom <[email protected]>
* Add types to validate files

Signed-off-by: Michael Carlstrom <[email protected]>

* remove type annotations from docstrings

Signed-off-by: Michael Carlstrom <[email protected]>

* removed other type annotated docstrings

Signed-off-by: Michael Carlstrom <[email protected]>

---------

Signed-off-by: Michael Carlstrom <[email protected]>
* Add types to TypeHash and moved away from __slots__ usage

Signed-off-by: Michael Carlstrom <[email protected]>

* remove docstring types

Signed-off-by: Michael Carlstrom <[email protected]>

---------

Signed-off-by: Michael Carlstrom <[email protected]>
* Start typing time.py

Signed-off-by: Michael Carlstrom <[email protected]>

* Testing out Enum wrapper for ClockType

Signed-off-by: Michael Carlstrom <[email protected]>

* convert to rcl_clock_type_t

Signed-off-by: Michael Carlstrom <[email protected]>

* Undo Change to time_point.cpp

Signed-off-by: Michael Carlstrom <[email protected]>

* Update create_time_point

Signed-off-by: Michael Carlstrom <[email protected]>

* Lint fixes

Signed-off-by: Michael Carlstrom <[email protected]>

* Add debug message

Signed-off-by: Michael Carlstrom <[email protected]>

* Remove test file

Signed-off-by: Michael Carlstrom <[email protected]>

* Try extending the type assert

Signed-off-by: Michael Carlstrom <[email protected]>

* Add types to logging_service.py (ros2#1227)

* add types to logging_service

Signed-off-by: Michael Carlstrom <[email protected]>

* Add types to duration.py

Signed-off-by: Michael Carlstrom <[email protected]>

* Add newlines for class definintions

Signed-off-by: Michael Carlstrom <[email protected]>

* update type alias name

Signed-off-by: Michael Carlstrom <[email protected]>

* Remove newline

Signed-off-by: Michael Carlstrom <[email protected]>

* Merge?

Signed-off-by: Michael Carlstrom <[email protected]>

* Fix failed merge

Signed-off-by: Michael Carlstrom <[email protected]>

* Update to use Protocols

Signed-off-by: Michael Carlstrom <[email protected]>

* Fix import error

Signed-off-by: Michael Carlstrom <[email protected]>

* Add types to time.py

Signed-off-by: Michael Carlstrom <[email protected]>

* Linty

Signed-off-by: Michael Carlstrom <[email protected]>

---------

Signed-off-by: Michael Carlstrom <[email protected]>
* Add types to TypeHash and add test cases

Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
InvincibleRMC and others added 4 commits March 28, 2024 20:49
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Signed-off-by: Michael Carlstrom <[email protected]>
Copy link
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having Srv class inherited from Protocol[SrvRequestT, SrvResponseT, SrvEventT] is good refactoring. these type parameters are placeholders for specific types and enable flexibility in defining what types a class implementing this protocol must handle.

@fujitatomoya
Copy link
Collaborator

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@sloretz
Copy link
Contributor

sloretz commented Aug 2, 2024

Pulls: #1275
Gist: https://gist.githubusercontent.com/sloretz/722bb14f5c8623086c24d8a44ca17b9f/raw/e79d08cfbee557546a7ab57e8c07f0a114b56f0a/ros2.repos
BUILD args: --packages-up-to rclpy
TEST args: --packages-select rclpy
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/14359

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@sloretz sloretz merged commit 464a357 into ros2:rolling Aug 5, 2024
2 of 3 checks passed
@InvincibleRMC InvincibleRMC deleted the generics-services branch September 13, 2024 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants