Skip to content

Allow setting payload inertia matrix via set_payload service backwards-compatible#1811

Open
srvald wants to merge 10 commits into
UniversalRobots:mainfrom
srvald:set_target_payload_compatible
Open

Allow setting payload inertia matrix via set_payload service backwards-compatible#1811
srvald wants to merge 10 commits into
UniversalRobots:mainfrom
srvald:set_target_payload_compatible

Conversation

@srvald

@srvald srvald commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the driver-side changes to support the extended SetPayload service in a backwards-compatible manner.

Note: This PR replaces the breaking-change approach discussed in PR #1808. It depends on the updated ur_msgs/SetPayload.srv (ros-industrial/ur_msgs#43) and on the setTargetPayload() addition to ur_client_library (UniversalRobots/Universal_Robots_Client_Library#515).

Backwards Compatibility (No Breaking Changes)

Unlike the previous proposal, this implementation does not break existing code or API contracts. The service request has been extended by appending the new fields. Existing callers who only provide mass and center_of_gravity (with inertia components defaulting to 0.0) will continue to work seamlessly.

The updated SetPayload.srv structure is:

float32 mass  
geometry_msgs/Vector3 center_of_gravity  
float64 ixx  
float64 iyy  
float64 izz  
float64 ixy  
float64 ixz  
float64 iyz  
float64 transition_time  
---  
bool success

Note

Medium Risk
Changes robot payload dynamics and async command gating (all inertia + transition_time must be set); incorrect values affect motion/force behavior, though defaults preserve legacy callers.

Overview
Extends SetPayload end-to-end so callers can set payload inertia (six components) and a transition time, while keeping existing mass/COG-only requests valid when new fields default to zero.

The GPIO controller forwards the new service fields through ros2_control command interfaces and, when verify_payload_on_set is enabled, waits for the transition duration then checks RTDE feedback for mass, COG, and inertia.

The hardware interface adds matching payload command/state GPIOs, reads payload_inertia from RTDE (recipe updated), and calls setTargetPayload() instead of the older setPayload() path. URDF/xacro declares the new interfaces.

Adds integration_test_payload.py (inertia, transition time, sequential updates) to the integration test suite.

Reviewed by Cursor Bugbot for commit 3731249. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit b5c8486. Configure here.

Comment thread ur_robot_driver/src/hardware_interface.cpp
@urfeex urfeex added the blocked label Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants