-
Notifications
You must be signed in to change notification settings - Fork 626
Pr humble python bindings #3487
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
base: humble
Are you sure you want to change the base?
Pr humble python bindings #3487
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this contribution. I noticed that the .pyi files deviate from the main branch.
As you copied the stuff from there, why did you change those files?
We should also remove old/unused python code from ROS1. I prepared corresponding commits here. This also fixes the tests.
Finally, copying files is not authoring. Hence, you should remove yourself from the authors list of the copied files. Ideally, the added files should have minimal changes w.r.t. the main branch.
Pr humble python bindings
static py::handle cast(const rclcpp::Time& src, return_value_policy /* policy */, py::handle /* parent */) | ||
{ | ||
py::module rclpy_time = py::module::import("rclpy.time"); | ||
py::object Time = rclpy_time.attr("Time"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should fix the clang-tidy issue:
py::object Time = rclpy_time.attr("Time"); | |
py::object Time = rclpy_time.attr("Time"); // NOLINT(readability-identifier-naming) |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## humble #3487 +/- ##
==========================================
- Coverage 50.96% 50.87% -0.08%
==========================================
Files 390 407 +17
Lines 32520 33323 +803
==========================================
+ Hits 16569 16950 +381
- Misses 15951 16373 +422 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Thanks for the feedback, I'll fix the names. |
Yes, that's what I suggest. I have further reduced the differences to main here. |
Further reduce differences to main
moveit_py/docs/source/conf.py
Outdated
copyright = "2022, Peter David Fagan; 2025, Samuele Sandrini" | ||
author = "Peter David Fagan, Samuele Sandrini" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, authorship doesn't apply here as well.
copyright = "2022, Peter David Fagan; 2025, Samuele Sandrini" | |
author = "Peter David Fagan, Samuele Sandrini" | |
copyright = "2022, Peter David Fagan" | |
author = "Peter David Fagan" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, thanks! I missed that. I had only checked in src
def process_planning_scene_world(self, *args, **kwargs) -> Any: ... | ||
def remove_all_collision_objects(self, *args, **kwargs) -> Any: ... | ||
def set_object_color(self, *args, **kwargs) -> Any: ... | ||
def save_geometry_to_file(self, file_name_and_path) -> Any: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be file_path_and_name
here (and also in the next line)? (also in the main branch).
def read_write(self, *args, **kwargs) -> Any: ... | ||
def request_planning_scene_state(self, *args, **kwargs) -> Any: ... | ||
def start_scene_monitor(self, *args, **kwargs) -> Any: ... | ||
def start_state_monitor(self, *args, **kwargs) -> Any: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might be a duplication. It also appears in the main branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please file a PR to fix those issues on the main branch as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had seen wrong, they are different. Instead, in the previous comment, there is indeed a mismatch between stub file and args in the bindings.
Looks like the ROS docker images are broken and need to be upgraded to the latest ROS install procedure. |
Description
This PR introduces Python bindings (
MoveItPy
) for MoveIt 2 Humble. The implementation was mainly adapted by copying existing code from the Jazzy and Main branches and adjusting for interface differences in Humble (see attached notes from the porting process).Notably, in
planning_component.hpp/.cpp
, the return type ofplan()
changed fromplanning_interface::MotionPlanResponse
tomoveit_cpp::PlanningComponent::PlanSolution
. To maintain consistency with the existing C++ structure (similar to Jazzy’s treatment in moveit_core), I placed the Python bindings withinplanning_component.hpp/.cpp
. Feedback on this placement is welcome if changes are preferred.During testing with
colcon test
, I encountered import issues where themoveit.planning
and related Python modules were not found, even though they work fine when sourcing the workspace, and thus using the installed modules. The cause has not yet been identified (I suspected it was due to the location of thebuild
folder of the__init__.py
together with modules file inside thebuild
folder undertest_moveit
rather thantest_moveit/moveit
, but that turned out not to be the issue).For initial testing, I also forked
moveit2_tutorials
available here.Additional example tests I tried can be found here, which uses this UR-robot cell. Let me know if it is required to provide a docker.
Related issues: #3454 #3473
Checklist