Fix moveit_py joint-group position setter conversion - #3821
Open
trippyogi wants to merge 1 commit into
Open
Conversation
Route set_joint_group_positions and set_joint_group_active_positions through an owned float64 vector conversion so the Humble pybind11 Eigen path that crashes on the reported NumPy calls is avoided. Validate shapes and sizes in Python, no-op empty/zero-variable groups before core &gstate[0] access, and leave velocity/acceleration Eigen bindings unchanged until they are shown to share the failure.
trippyogi
marked this pull request as ready for review
August 15, 2026 23:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
set_joint_group_positionsandset_joint_group_active_positionsthrough an ownedstd::vector<double>conversionFixes #3718.
Context
The issue reports reproducible segmentation faults on ROS 2 Humble when these two
RobotStatesetters receive NumPy arrays. @LeeMin-hyeong confirmed that switching the bindings from theEigen::VectorXdoverloads to the existingstd::vector<double>overloads makes the same calls succeed in the affected environment.This change copies array-like input into owned storage before entering
RobotState. It intentionally leaves the velocity and acceleration bindings unchanged, and does not assert a specific Eigen or pybind11 lifetime failure without a backtrace.Verification
Independent crash reproduction remains inconclusive. I tested unmodified Humble on Ubuntu 22.04 with Python 3.10.12, NumPy 1.21.5, pybind11 2.9.1, and MoveIt 2.5.9 using both Panda and the public Doosan M0609 URDF/SRDF. The original Eigen bindings did not crash locally, including an edge-case sweep and a setters-only ASan run. This PR therefore does not claim an independently reproduced red-to-green SIGSEGV; it implements the conversion path reported to resolve the fault and adds regression coverage around that boundary.
@LeeMin-hyeong, could you test this branch in the environment where the original calls crash and confirm whether the baseline fails and this patch passes?