Skip to content

Currents as efforts - #1918

Draft
urfeex wants to merge 5 commits into
UniversalRobots:lyricalfrom
urfeex:currents_as_efforts
Draft

Currents as efforts#1918
urfeex wants to merge 5 commits into
UniversalRobots:lyricalfrom
urfeex:currents_as_efforts

Conversation

@urfeex

@urfeex urfeex commented Jul 31, 2026

Copy link
Copy Markdown
Member

Manual backport of #1551 that doesn't change the behavior for existing distributions.


Note

Medium Risk
Changes joint effort semantics and RTDE output recipe composition; misconfiguration or mixed launch defaults could surprise consumers of joint_states, though defaults aim to preserve motor-current reporting.

Overview
Adds a use_currents_as_efforts hardware parameter (and launch/xacro wiring) so joint effort state can come from either actual_current (motor currents, default / prior behavior) or actual_current_as_torque on PolyScope ≥ 5.23.0 / 10.11.0 when the parameter is false.

The hardware interface now builds RTDE input/output recipes in memory, optionally appends actual_current_as_torque to the output recipe, fails configure if torques are requested on unsupported software, and selects the correct RTDE field in read(). Docs clarify that joint_states effort is currents by default and how to get true torques.

ur_control.launch.py exposes the new launch argument (default false in that file); ur_rsp.launch.py and xacro default true to preserve existing deployments without changing effort semantics.

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

Comment thread ur_robot_driver/launch/ur_control.launch.py
Comment thread ur_robot_driver/src/hardware_interface.cpp
Comment thread ur_robot_driver/launch/ur_control.launch.py
@urfeex
urfeex force-pushed the currents_as_efforts branch from eb12471 to cf1310f Compare July 31, 2026 13:48

@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 9db1bb3. Configure here.

// Newer software version (5.23.0 / 10.11.0) support reporting the actual joint torques. On older
// versions fall back to the currents, instead.
use_currents_as_efforts_ = ((info_.hardware_parameters["use_currents_as_efforts"] == "true") ||
(info_.hardware_parameters["use_currents_as_efforts"] == "True"));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing param selects torque mode

Medium Severity

If use_currents_as_efforts is absent from hardware parameters, map lookup yields an empty string and the flag stays false, so the driver requests torques. For custom URDFs that predate this parameter, that changes prior currents-as-efforts behavior and can fail on older robot software.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9db1bb3. Configure here.

@urfeex
urfeex marked this pull request as draft August 3, 2026 09:35
@urfeex
urfeex force-pushed the currents_as_efforts branch from 4bdc486 to 854ebb8 Compare August 3, 2026 11:56
@urfeex
urfeex force-pushed the currents_as_efforts branch from 854ebb8 to c69fccd Compare August 3, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants