Skip to content

Throw RTDEInvalidKeyException on unknown RTDE key - #544

Merged
urfeex merged 2 commits into
UniversalRobots:masterfrom
urfeex:rtde_init_throw_invalid_keys
Aug 5, 2026
Merged

Throw RTDEInvalidKeyException on unknown RTDE key#544
urfeex merged 2 commits into
UniversalRobots:masterfrom
urfeex:rtde_init_throw_invalid_keys

Conversation

@urfeex

@urfeex urfeex commented Aug 3, 2026

Copy link
Copy Markdown
Member

This allows parsing information about failed fields. Since RTDEInvalidKeyException inherits from UrException, this is not API-breaking.

This should help in generate an explicit user output in UniversalRobots/Universal_Robots_ROS2_Driver#1551


Note

Low Risk
Narrow change to error typing and exception payload on RTDE recipe validation; still inherits from UrException so existing catch-by-base behavior largely holds, with clearer structured data for new handlers.

Overview
When RTDE output setup fails because recipe keys are unknown to the robot (and unavailable outputs are not ignored), the client now throws RTDEInvalidKeyException instead of a generic UrException, carrying the list of bad keys and the existing error text.

RTDEInvalidKeyException gains a constructor that accepts invalid_keys plus optional message text, and exposes invalid_keys as a public field so callers (e.g. ROS2 driver) can report which fields failed without parsing what().

Tests for invalid input/output recipe keys use GMock ThrowsMessage / HasSubstr, link rtde_tests against gmock_main, and add TestableRTDEClient to exercise init() with an injected bad output recipe.

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

This allows parsing information about failed fields. Since
RTDEInvalidKeyException inherits from UrException, this is not
API-breaking.
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.15%. Comparing base (c5d1e26) to head (5444044).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #544      +/-   ##
==========================================
- Coverage   79.29%   79.15%   -0.14%     
==========================================
  Files         115      115              
  Lines        6776     6804      +28     
  Branches     3000     3002       +2     
==========================================
+ Hits         5373     5386      +13     
- Misses       1035     1050      +15     
  Partials      368      368              
Flag Coverage Δ
check_version_ur10-3.15.8 12.56% <0.00%> (+0.89%) ⬆️
check_version_ur10e-10.11.0 11.11% <0.00%> (-0.06%) ⬇️
check_version_ur10e-5.15.2 11.30% <0.00%> (-0.28%) ⬇️
check_version_ur12e-10.12.1 11.11% <0.00%> (-0.06%) ⬇️
check_version_ur12e-5.25.1 11.11% <0.00%> (-0.24%) ⬇️
check_version_ur15-10.12.1 11.11% <0.00%> (-0.06%) ⬇️
check_version_ur15-5.25.1 11.30% <0.00%> (-0.06%) ⬇️
check_version_ur16e-10.12.1 11.11% <0.00%> (-0.06%) ⬇️
check_version_ur16e-5.25.1 11.35% <0.00%> (-0.01%) ⬇️
check_version_ur18-10.12.1 11.11% <0.00%> (-0.01%) ⬇️
check_version_ur18-5.25.1 11.11% <0.00%> (-0.24%) ⬇️
check_version_ur20-10.12.1 11.21% <0.00%> (-0.01%) ⬇️
check_version_ur20-5.25.1 11.11% <0.00%> (-0.40%) ⬇️
check_version_ur3-3.14.3 12.56% <0.00%> (-0.37%) ⬇️
check_version_ur30-10.12.1 11.11% <0.00%> (-0.06%) ⬇️
check_version_ur30-5.25.1 11.11% <0.00%> (-0.48%) ⬇️
check_version_ur3e-10.11.0 11.16% <0.00%> (-0.06%) ⬇️
check_version_ur3e-5.9.4 11.11% <0.00%> (-0.82%) ⬇️
check_version_ur5-3.15.8 11.35% <0.00%> (-1.58%) ⬇️
check_version_ur5e-10.11.0 11.11% <0.00%> (-0.06%) ⬇️
check_version_ur5e-5.12.8 11.35% <0.00%> (-0.23%) ⬇️
check_version_ur7e-10.11.0 11.11% <0.00%> (-0.06%) ⬇️
check_version_ur7e-5.22.2 11.30% <0.00%> (-0.06%) ⬇️
check_version_ur8long-10.12.1 11.11% <0.00%> (-0.10%) ⬇️
check_version_ur8long-5.25.1 11.16% <0.00%> (-0.31%) ⬇️
python_scripts 75.90% <ø> (ø)
start_ursim 85.33% <ø> (+0.24%) ⬆️
ur20-latest 74.97% <100.00%> (?)
ur5-3.14.3 74.63% <100.00%> (-0.10%) ⬇️
ur5e-10.11.0 69.38% <100.00%> (-0.24%) ⬇️
ur5e-10.12.0 70.64% <100.00%> (+0.07%) ⬆️
ur5e-10.7.0 68.68% <100.00%> (-0.27%) ⬇️
ur5e-5.9.4 75.40% <100.00%> (-0.04%) ⬇️
ur7e-10.13.0 70.61% <100.00%> (+0.07%) ⬆️

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

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

@urrsk urrsk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggest adding a test covering this improvement

@urfeex
urfeex requested a review from urrsk August 4, 2026 15:12
@mergify

mergify Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@urfeex
urfeex merged commit 7df9f19 into UniversalRobots:master Aug 5, 2026
52 of 64 checks passed
@urfeex
urfeex deleted the rtde_init_throw_invalid_keys branch August 5, 2026 08:46
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