Skip to content

Allow setting payload inertia matrix via set_payload service backwards-compatible (backport #1811)#1880

Merged
urfeex merged 3 commits into
humblefrom
mergify/bp/humble/pr-1811
Jul 21, 2026
Merged

Allow setting payload inertia matrix via set_payload service backwards-compatible (backport #1811)#1880
urfeex merged 3 commits into
humblefrom
mergify/bp/humble/pr-1811

Conversation

@mergify

@mergify mergify Bot commented Jul 13, 2026

Copy link
Copy Markdown

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
Payload commands now require all inertia and transition_time interfaces to be set before the driver acts, which can change behavior for callers or mocks that only set mass/COG; depends on matching ur_msgs and ur_client_library versions.

Overview
Extends set_payload end-to-end so callers can set payload inertia (six components) and a transition time, in line with the updated ur_msgs/SetPayload service and ur_client_library setTargetPayload().

GPIO controller forwards the new request fields through ros2_control command interfaces and, when verify_payload_on_set is enabled, compares RTDE feedback against mass, COG, and inertia (with an initial sleep when transition_time > 0).

Hardware interface adds matching payload command/state GPIOs, reads payload_inertia from RTDE, and replaces setPayload with setTargetPayload once mass, COG, inertia, and transition time are all present. URDF/xacro and the RTDE output recipe are updated accordingly.

Integration tests cover inertia, timed transitions, and sequential updates; launch parametrization on tf_prefix was removed from the IO controller test.

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


This is an automatic backport of pull request #1811 done by [Mergify](https://mergify.com).

Note

Medium Risk
Payload handling now requires all inertia and transition_time command interfaces before the driver acts, which can affect mocks or partial callers; depends on matching ur_msgs and ur_client_library versions.

Overview
Extends set_payload so callers can set payload inertia (six components) and a transition time, aligned with the updated ur_msgs/SetPayload service and ur_client_library setTargetPayload().

The GPIO controller writes the new request fields to ros2_control command interfaces and, when verify_payload_on_set is on, waits for transition_time before comparing RTDE feedback to mass, COG, and inertia.

The hardware interface adds matching payload command/state GPIOs, subscribes to payload_inertia in the RTDE recipe, and only issues setTargetPayload once mass, COG, inertia, and transition time are all set (replacing setPayload). Integration tests cover inertia, timed transitions, and sequential updates; IO controller launch tests no longer parametrize tf_prefix.

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

…s-compatible (#1811)

Extend set_payload service with inertia matrix and transition_time

(cherry picked from commit 3d18755)

# Conflicts:
#	ur_controllers/src/gpio_controller.cpp
#	ur_robot_driver/src/hardware_interface.cpp
#	ur_robot_driver/urdf/ur.ros2_control.xacro
@mergify

mergify Bot commented Jul 13, 2026

Copy link
Copy Markdown
Author

Cherry-pick of 3d18755 has failed:

On branch mergify/bp/humble/pr-1811
Your branch is up to date with 'origin/humble'.

You are currently cherry-picking commit 3d18755.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   ur_controllers/include/ur_controllers/gpio_controller.hpp
	modified:   ur_robot_driver/include/ur_robot_driver/hardware_interface.hpp
	modified:   ur_robot_driver/resources/rtde_output_recipe.txt
	modified:   ur_robot_driver/test/integration_test_io_controller.py

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   ur_controllers/src/gpio_controller.cpp
	both modified:   ur_robot_driver/src/hardware_interface.cpp
	deleted by us:   ur_robot_driver/urdf/ur.ros2_control.xacro

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Comment thread ur_controllers/src/gpio_controller.cpp Outdated
Comment thread ur_robot_driver/src/hardware_interface.cpp Outdated
@urfeex urfeex added enhancement New feature or request humble Relevant for humble and higher ROS versions and removed conflicts labels Jul 17, 2026
@urfeex
urfeex force-pushed the mergify/bp/humble/pr-1811 branch from 92c64e3 to 09eb06f Compare July 17, 2026 12:51

@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

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 09eb06f. Configure here.

Comment thread ur_controllers/src/gpio_controller.cpp Outdated
@urfeex
urfeex merged commit fbc2e35 into humble Jul 21, 2026
5 of 11 checks passed
@urfeex
urfeex deleted the mergify/bp/humble/pr-1811 branch July 21, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request humble Relevant for humble and higher ROS versions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants