Skip to content

Conversation

@AdamPettinger
Copy link

@AdamPettinger AdamPettinger commented Dec 12, 2025

I have a UR20 mounted on another robot that can change its orientation enough to cause problems for the arm's mounting installation.

These changes expose the set_gravity URScript functionality through the Client Library, allowing a user to update the gravity vector of the robot during live operation. There is a corresponding PR on ROS2_Driver that further exposes this as a ROS service. This is obviously risky if you calculate the gravity vector incorrectly.

Signed-off-by: AdamPettinger <adam.l.pettinger@gmail.com>
Signed-off-by: AdamPettinger <adam.l.pettinger@gmail.com>
Signed-off-by: AdamPettinger <adam.l.pettinger@gmail.com>
Signed-off-by: AdamPettinger <adam.l.pettinger@gmail.com>
Signed-off-by: AdamPettinger <adam.l.pettinger@gmail.com>
@urfeex
Copy link
Member

urfeex commented Dec 15, 2025

Thank you for your contribution. Do you plan to change anything on this given that it's a draft?

Doing a quick review the implementation seems fine, only some tests and documentation would be good.

@codecov
Copy link

codecov bot commented Dec 15, 2025

Codecov Report

❌ Patch coverage is 0% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.73%. Comparing base (030e993) to head (4dac160).

Files with missing lines Patch % Lines
src/control/script_command_interface.cpp 0.00% 14 Missing ⚠️
src/ur/ur_driver.cpp 0.00% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #415      +/-   ##
==========================================
- Coverage   43.15%   42.73%   -0.42%     
==========================================
  Files          99       99              
  Lines        8660     8681      +21     
  Branches     1179     1182       +3     
==========================================
- Hits         3737     3710      -27     
- Misses       4644     4689      +45     
- Partials      279      282       +3     
Flag Coverage Δ
start_ursim 81.54% <ø> (-3.07%) ⬇️
ur20-latest 40.76% <0.00%> (-0.17%) ⬇️
ur5-3.14.3 40.62% <0.00%> (-0.14%) ⬇️
ur5e-10.7.0 35.81% <0.00%> (-0.26%) ⬇️
ur5e-5.9.4 40.77% <0.00%> (-0.17%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AdamPettinger
Copy link
Author

Honestly, drafted all three of the related PRs because I haven't tested much with real hardware on Rolling (all the way with the ur_robot_driver). We have been running this on Jazzy for months, but I just rebased on Rolling in the other repo today.

I don't expect to run into troubles, and am willing to mark this ready for review if you are. I am trying to get around to testing the Rolling version on hardware by today or tomorrow.

@urfeex
Copy link
Member

urfeex commented Dec 18, 2025

As I said, adding tests to https://github.com/UniversalRobots/Universal_Robots_Client_Library/blob/master/tests/test_script_command_interface.cpp and documentation to https://github.com/UniversalRobots/Universal_Robots_Client_Library/blob/master/doc/architecture/script_command_interface.rst would be needed to merge this.

Signed-off-by: AdamPettinger <adam.l.pettinger@gmail.com>
@AdamPettinger AdamPettinger marked this pull request as ready for review December 19, 2025 16:56
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