ros2 / rclpy

rclpy (ROS Client Library for Python)
Apache License 2.0
291 stars 224 forks source link

Replace rclpyHandle with type stubs #1326

Closed InvincibleRMC closed 1 month ago

InvincibleRMC commented 2 months ago

Currently using rclpyHandle to mock the pybind implementation has cause some weirdness when dealing with type annotations. A better and more scalable solutions is replacing it with custom type stubs. One day in the future I would love to use stubgen to automatically generate stubs however it is still missing many features for example generics, TypeDicts, etc. Pybind has made progress in the recent years with function type annotations it however still needs work. This would also allow us to move the Various Handle Protocols into type stubs which is probably a better long term plan.

sloretz commented 1 month ago

Pulls: ros2/rclpy#1326 Gist: https://gist.githubusercontent.com/sloretz/82e7544d7bfb17294da726ff21992977/raw/b3de9474d3262c06a2c13641f9953e346ba19198/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/14379

clalancette commented 1 month ago

Pulls: ros2/rclpy#1326 Gist: https://gist.githubusercontent.com/clalancette/ed71384569fc5e01f7775c1876efc938/raw/b3de9474d3262c06a2c13641f9953e346ba19198/ros2.repos BUILD args: --packages-above-and-dependencies rclpy TEST args: --packages-above rclpy ROS Distro: rolling Job: ci_launcher ci_launcher ran: https://ci.ros2.org/job/ci_launcher/14386

clalancette commented 1 month ago

This one is going to have to be rebased onto the latest to pass CI. Sorry about that.

sloretz commented 1 month ago

Pulls: ros2/rclpy#1326 Gist: https://gist.githubusercontent.com/sloretz/fa85bfa3e6f28e062dda6d0648a316a1/raw/b3de9474d3262c06a2c13641f9953e346ba19198/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/14390