Skip to content

Conversation

@AdamPettinger
Copy link
Contributor

@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.

@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 58.33333% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.89%. Comparing base (030e993) to head (b6fbb5b).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/ur/ur_driver.cpp 0.00% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #415      +/-   ##
==========================================
- Coverage   43.21%   42.89%   -0.32%     
==========================================
  Files          99       99              
  Lines        8660     8682      +22     
  Branches     1179     1182       +3     
==========================================
- Hits         3742     3724      -18     
- Misses       4639     4677      +38     
- Partials      279      281       +2     
Flag Coverage Δ
start_ursim 81.98% <ø> (-2.64%) ⬇️
ur20-latest 40.92% <58.33%> (-0.01%) ⬇️
ur5-3.14.3 40.78% <58.33%> (-0.08%) ⬇️
ur5e-10.7.0 35.97% <58.33%> (-0.09%) ⬇️
ur5e-5.9.4 40.91% <58.33%> (-0.05%) ⬇️

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
Contributor 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 <[email protected]>
@AdamPettinger AdamPettinger marked this pull request as ready for review December 19, 2025 16:56
Copy link
Member

@urfeex urfeex left a comment

Choose a reason for hiding this comment

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

Thank you for finishing this. That looks great! Having tests in the UrDriver wrapper would be nice, but we are missing those for the other commands, as well.

@urfeex urfeex added the enhancement New feature or request label Dec 22, 2025
@urfeex urfeex merged commit c35be11 into UniversalRobots:master Dec 22, 2025
26 of 28 checks passed
@AdamPettinger AdamPettinger deleted the update_gravity branch January 5, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants