Add set_target_payload support to ScriptCommandInterface#515
Open
srvald wants to merge 1 commit into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #515 +/- ##
===========================================
- Coverage 78.12% 15.70% -62.43%
===========================================
Files 116 116
Lines 6566 6596 +30
Branches 2898 2912 +14
===========================================
- Hits 5130 1036 -4094
- Misses 1077 5476 +4399
+ Partials 359 84 -275
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
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.
Description
Adds support for the URScript
set_target_payload()command through theScriptCommandInterface, allowing users to set the payload mass, center ofgravity, inertia matrix, and transition time.
This follows the same pattern as the existing
setPayload()implementation.Changes
include/ur_client_library/control/script_command_interface.h: AddedsetTargetPayload()declaration and theSET_TARGET_PAYLOAD = 12enum valueto
ScriptCommand.include/ur_client_library/ur/ur_driver.h: AddedsetTargetPayload()declaration to
UrDriver.src/control/script_command_interface.cpp: ImplementedScriptCommandInterface::setTargetPayload(), encoding mass, CoG (3 values),inertia matrix (6 values), and transition time into the binary message.
src/ur/ur_driver.cpp: ImplementedUrDriver::setTargetPayload().resources/external_control.urscript: AddedSET_TARGET_PAYLOAD = 12constant and the corresponding
elifbranch in thescript_commandsthreadto call
set_target_payload().tests/test_script_command_interface.cpp: Addedtest_set_target_payloadunit test verifying correct encoding of all fields(mass, CoG, inertia, transition time) and that unused message slots are zero.
Message layout for SET_TARGET_PAYLOAD
12)Notes
transition_timedefaults to0.0seconds (no transition).Related issues
UniversalRobots/Universal_Robots_ROS2_Driver#1711
Related PR (ur_ros2_driver): UniversalRobots/Universal_Robots_ROS2_Driver#1808
Note
Medium Risk
Adds a new path for robot payload/dynamics parameters; incorrect values could affect motion modeling, but the change mirrors the existing setPayload pattern with tests on the wire format.
Overview
Adds
setTargetPayloadend-to-end so clients can drive URScriptset_target_payload()(mass, CoG, inertia, optional transition time) through the same script-command path assetPayload().ScriptCommandInterfaceandUrDriverexpose the new API; commandSET_TARGET_PAYLOAD(12) encodes eleven payload fields into the fixed 28-int script-command buffer (with zero padding).external_control.urscriptdecodes the message and callsset_target_payload. When the script-command socket is down,UrDriverfalls back to a plainset_target_payload(...)script, matching existing payload behavior. A unit test verifies command id and field encoding.Reviewed by Cursor Bugbot for commit 67d123d. Bugbot is set up for automated code reviews on this repo. Configure here.