Allow setting payload inertia matrix via set_payload service #1808
Merged
Conversation
This was referenced Jun 5, 2026
Merged
urfeex
requested changes
Jul 2, 2026
urfeex
reviewed
Jul 2, 2026
This will be needed for changes from this branch.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 5bfbbb5. Configure here.
urfeex
approved these changes
Jul 6, 2026
|
Tick the box to add this pull request to the merge queue (same as
|
This was referenced Jul 13, 2026
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
Implements the driver-side changes to support the extended
SetPayloadservice,which now accepts a full
geometry_msgs/Inertiapayload (mass, center of gravity,and 6-component inertia tensor) and a
transition_timefield.This enables use of the robot's
set_target_payload(m, cog, inertia, transition_time)URScript function instead of the simpler
set_payload(m, cog) (DEPRECATED).Breaking changes
The
set_payloadservice request format changes (driven by theur_msgsupdate).Any existing callers must be updated to use
geometry_msgs/Inertiainstead ofseparate
massandcogfields.Changes
ur_controllersPAYLOAD_INERTIA_IXX/IYY/IZZ/IXY/IXZ/IYZandPAYLOAD_TRANSITION_TIMEentries to the
CommandInterfacesenum ingpio_controller.hppPAYLOAD_STATE_INERTIA_*entries to theStateInterfacesenumcommand_interface_configuration()andstate_interface_configuration()with the new payload interfaces
setPayload()callback to pass inertia and transition_time to thecommand interfaces
waitForPayloadRtdeMatch()to verify inertia components and to waitfor
transition_timeto elapse before checking RTDE feedbackur_robot_driverpayload_inertia_,payload_transition_time_andrtde_payload_inertia_members tohardware_interface.hpp(backed by RTDE feedback) to
export_state_interfaces()andexport_command_interfaces()inhardware_interface.cppcheckAsyncIO()to callsetTargetPayload()instead ofsetPayload().payload_inertiatortde_output_recipe.txtur.ros2_control.xacrowith the new payload command and state interfacesintegration_test_payload.pyand registered it inCMakeLists.txtTest
Open one terminal and launch the
ur_ros2_driverby:Then in another terminal execute:
ros2 service call /io_and_status_controller/set_payload ur_msgs/srv/SetPayload '{payload: {m: 0.01, com: {x: 0.2, y: 0.1, z: 0.3}, ixx: 0.01, ixy: 0.0, ixz: 0.03, iyy: 0.01, iyz: 0.02, izz: 0.01}, transition_time: 1.0}'It will successfully set the new changes.
Design notes
geometry_msgs/Inertiawas chosen because it encapsulates mass, center of gravity,and the full inertia tensor in a single standard ROS type, resulting in a cleaner API.
This is a breaking change: the previous
mass(float32) andcog(Vector3) fieldsare replaced by
geometry_msgs/Inertia payload. A backwards-compatible alternativewould be to keep
massandcogand add individualfloat64fields for the inertiacomponents (
ixx,iyy,izz,ixy,ixz,iyz) andtransition_time.If this approach is preferred, then I'll update the implementation, which will mean that the
SetPayload.srvwill be:Related issues
Closes #1711
Note
Medium Risk
Breaking change to a public service API and robot payload configuration path; incorrect inertia or timing could affect motion/dynamics, though changes are localized to set_payload and RTDE verification.
Overview
Extends
set_payloadto match the updatedur_msgs/SetPayloadAPI: callers must passgeometry_msgs/Inertia(m,com, inertia tensor) and an optionaltransition_time, instead of separatemass/center_of_gravityfields. Migration notes document the new service call shape for the Maoka release.The GPIO controller and robot hardware interface now expose inertia and transition_time through ros2_control payload command/state interfaces. RTDE feedback includes
payload_inertia, and optional verification compares mass, COG, and all inertia components (waiting outtransition_timebefore checking). The driver invokessetTargetPayload()on the client library rather than the deprecatedset_payloadURScript path.Rolling builds pin
ur_msgstorolling-devel. Integration and mock-hardware tests use the newInertia-based requests and add coverage for inertia, timed transitions, and sequential updates.Reviewed by Cursor Bugbot for commit 89d8c2b. Bugbot is set up for automated code reviews on this repo. Configure here.