Skip to content

Add a resolved acceleration control mode#450

Open
FilipposSot wants to merge 6 commits intoUniversalRobots:masterfrom
FilipposSot:resolved_acceleration_control_mode
Open

Add a resolved acceleration control mode#450
FilipposSot wants to merge 6 commits intoUniversalRobots:masterfrom
FilipposSot:resolved_acceleration_control_mode

Conversation

@FilipposSot
Copy link

@FilipposSot FilipposSot commented Mar 2, 2026

Summary

This PR introduces a new acceleration based control mode through the reverse interface. This allows users to implement a wide variety of acceleration resolved torque controllers while leveraging UR's internal model parameters for the robot dynamics.

This PR builds on top of #445 and should be approved/merged after that PR is merged.


Note

High Risk
High risk because it changes the core external_control.urscript control-loop behavior and introduces a new realtime control mode that affects how torques are computed and applied on the robot.

Overview
Introduces a new reverse-interface control mode, MODE_RESOLVED_ACCELERATION, allowing clients to send joint accelerations which are converted to torques inside external_control.urscript using UR dynamics (mass matrix + coriolis/centrifugal minus estimated external torque from get_tcp_force()/Jacobian).

Extends the script command interface with setFrictionScales(viscous, coulomb) (PolyScope 5.25.1 / 10.12.1+), deprecating setFrictionCompensation; values are clamped to [0,1], new script-command IDs and URScript handling are added, and unit tests/docs/examples are updated accordingly.

Updates example programs/logging for clearer remote-control errors and version gating, adds CI artifact upload of generated URScript files, and adds tests covering the new control mode and script generation/version-conditional behavior.

Written by Cursor Bugbot for commit c86a757. This will update automatically on new commits. Configure here.

urrsk and others added 5 commits February 25, 2026 11:45
Add support for direct_torques new arguments:
  viscous_scale and coulomb_scale arguments.

And mark the old friction_comp as deprecated.
Add a setTcpOffset to the script command interface documentation
@FilipposSot FilipposSot changed the title Resolved acceleration control mode Add a resolved acceleration control mode Mar 2, 2026
@FilipposSot
Copy link
Author

@urrsk @urmahp Here is the PR that we had discussed.


// Increment depends on robot version
double increment_constant = 0.0005;
std::cout << "Robot version: " << g_my_robot->getUrDriver()->getVersion().toString() << std::endl;
Copy link

Choose a reason for hiding this comment

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

Debug print statement accidentally committed

Low Severity

A std::cout statement printing the robot version was added to full_driver.cpp. Every other log message in this file uses the URCL_LOG_* macros. This looks like a leftover debugging statement.

Fix in Cursor Fix in Web

Copy link

@cursor cursor bot left a comment

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 and found 1 potential issue.

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

URCL_LOG_INFO("Setting friction scales is not supported on this robot (version %s). "
"Requires at least 5.25.1 / 10.12.1. Skipping friction scale commands.",
version.toString().c_str());
}
Copy link

Choose a reason for hiding this comment

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

Version check before robot health validation risks crash

Medium Severity

The newly added version check via g_my_robot->getUrDriver()->getVersion() is performed before g_my_robot->isHealthy() at line 135. If the robot wrapper failed to initialize properly (e.g., connection issue), getUrDriver() could return a null shared_ptr, causing a null pointer dereference. The original code checked isHealthy() immediately after construction; this PR inserts the version access before that guard.

Fix in Cursor Fix in Web

@urrsk
Copy link
Member

urrsk commented Mar 4, 2026

Thanks @FilipposSot
We have some depending PR on the coming 5.25.1 release. So let's rebase it when it is release and these are merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants