Skip to content

Fix moveit_py joint-group position setter conversion - #3821

Open
trippyogi wants to merge 1 commit into
moveit:mainfrom
trippyogi:investigate/3718-joint-group-setters
Open

Fix moveit_py joint-group position setter conversion#3821
trippyogi wants to merge 1 commit into
moveit:mainfrom
trippyogi:investigate/3718-joint-group-setters

Conversation

@trippyogi

Copy link
Copy Markdown

Summary

  • route set_joint_group_positions and set_joint_group_active_positions through an owned std::vector<double> conversion
  • preserve accepted 1-D and n-by-1 array shapes while validating dimensions and group-specific value counts
  • add focused coverage for Python sequences, NumPy dtype conversion, column arrays, active positions, and invalid inputs

Fixes #3718.

Context

The issue reports reproducible segmentation faults on ROS 2 Humble when these two RobotState setters receive NumPy arrays. @LeeMin-hyeong confirmed that switching the bindings from the Eigen::VectorXd overloads to the existing std::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

  • pre-commit checks pass
  • added unit coverage for list input, active-position NumPy input, float32 and integer conversion, n-by-1 arrays, undersized values, and invalid 1-by-n orientation
  • tested the reported Doosan M0609 input with this patch; values were set correctly and the process survived

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?

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
trippyogi marked this pull request as ready for review August 15, 2026 23:03
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.

moveit_py: RobotState joint-group setters segfault in Python

1 participant