Skip to content

Add missing robot types#513

Merged
urfeex merged 4 commits into
UniversalRobots:masterfrom
urfeex:add_missing_robot_types
Jun 8, 2026
Merged

Add missing robot types#513
urfeex merged 4 commits into
UniversalRobots:masterfrom
urfeex:add_missing_robot_types

Conversation

@urfeex

@urfeex urfeex commented Jun 1, 2026

Copy link
Copy Markdown
Member

This consists of two commits:

  • Adding missing robot types to type string conversion
  • Removing default branches in helper function switch cases. This way, adding a new enum entry will raise a compiler warning, which we will treat as an error in CI.

I pushed both commits into this PR, as for the type string conversion this is highly related / the cause why this wasn't detected earlier.


Note

Medium Risk
Invalid or future enum values now throw instead of returning UNDEFINED or only logging for robot type/series, which can change error handling for callers; safety/mode string behavior is similarly stricter for unknown values.

Overview
Extends robotTypeString with UR8LONG"UR8_LONG" and UR18"UR18", and tightens enum-to-string helpers in datatypes.h so new enum values are less likely to be missed at compile time.

The default branches are removed from the switches on robotModeString, safetyModeString, safetyStatusString, robotTypeString, and robotSeriesString. Known sentinel values (RobotMode::UNKNOWN, RobotType::UNDEFINED, RobotSeries::UNDEFINED) are handled explicitly; any other unrecognized numeric value throws std::invalid_argument (using std::to_string instead of stringstream). robotTypeString / robotSeriesString no longer log and return "UNDEFINED" for unknown enum integers.

Adds datatypes_tests (test_datatypes.cpp) and wires it in tests/CMakeLists.txt to cover all known enum mappings and invalid-value throws.

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

@urfeex urfeex requested a review from a team June 1, 2026 08:11
@urfeex urfeex added the bugfix label Jun 1, 2026
@codecov

codecov Bot commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 78.54%. Comparing base (c85ffa8) to head (cf7711c).

Files with missing lines Patch % Lines
include/ur_client_library/ur/datatypes.h 92.30% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #513      +/-   ##
==========================================
+ Coverage   77.66%   78.54%   +0.87%     
==========================================
  Files         115      115              
  Lines        6480     6526      +46     
  Branches     2898     2920      +22     
==========================================
+ Hits         5033     5126      +93     
+ Misses       1081     1033      -48     
- Partials      366      367       +1     
Flag Coverage Δ
check_version_ur10-3.15.8 12.84% <0.00%> (+1.32%) ⬆️
check_version_ur10e-10.11.0 11.43% <0.00%> (-0.04%) ⬇️
check_version_ur10e-5.15.2 11.43% <0.00%> (-0.28%) ⬇️
check_version_ur12e-10.12.1 11.38% <0.00%> (-0.09%) ⬇️
check_version_ur12e-5.25.1 11.38% <0.00%> (-0.88%) ⬇️
check_version_ur15-10.12.1 11.38% <0.00%> (-0.09%) ⬇️
check_version_ur15-5.25.1 11.38% <0.00%> (-0.09%) ⬇️
check_version_ur16e-10.12.1 11.43% <0.00%> (-0.04%) ⬇️
check_version_ur16e-5.25.1 11.38% <0.00%> (-0.09%) ⬇️
check_version_ur18-10.12.1 11.43% <0.00%> (-0.04%) ⬇️
check_version_ur18-5.25.1 11.38% <0.00%> (-0.14%) ⬇️
check_version_ur20-10.12.1 11.43% <0.00%> (-0.14%) ⬇️
check_version_ur20-5.25.1 11.62% <0.00%> (-0.04%) ⬇️
check_version_ur3-3.14.3 11.62% <0.00%> (+0.78%) ⬆️
check_version_ur30-10.12.1 11.43% <0.00%> (-0.04%) ⬇️
check_version_ur30-5.25.1 11.38% <0.00%> (-0.09%) ⬇️
check_version_ur3e-10.11.0 11.43% <0.00%> (-0.04%) ⬇️
check_version_ur3e-5.9.4 12.17% <0.00%> (+0.69%) ⬆️
check_version_ur5-3.15.8 11.58% <0.00%> (+0.10%) ⬆️
check_version_ur5e-10.11.0 11.38% <0.00%> (-0.14%) ⬇️
check_version_ur5e-5.12.8 11.38% <0.00%> (-0.33%) ⬇️
check_version_ur7e-10.11.0 11.48% <0.00%> (+0.01%) ⬆️
check_version_ur7e-5.22.2 11.38% <0.00%> (-0.14%) ⬇️
check_version_ur8long-10.12.1 11.38% <0.00%> (-0.09%) ⬇️
check_version_ur8long-5.25.1 11.38% <0.00%> (-0.14%) ⬇️
start_ursim 82.84% <ø> (+1.45%) ⬆️
ur5-3.14.3 74.34% <92.30%> (+1.10%) ⬆️
ur5e-10.11.0 68.90% <92.30%> (+1.32%) ⬆️
ur5e-10.12.0 69.89% <92.30%> (+1.12%) ⬆️
ur5e-10.7.0 68.29% <92.30%> (+0.92%) ⬆️
ur5e-5.9.4 75.09% <92.30%> (+0.95%) ⬆️

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.

@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 95cb4ea. Configure here.

Comment thread include/ur_client_library/ur/datatypes.h

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

@urfeex please add unit test to cover the changes

@urrsk

urrsk commented Jun 8, 2026

Copy link
Copy Markdown
Member

@urfeex The changes looks good, but it seems that the new unittest are not running. At least I could not find it in the log and the code coverage did not change!

@urfeex urfeex force-pushed the add_missing_robot_types branch from dbf90f4 to cf7711c Compare June 8, 2026 08:21
@urfeex

urfeex commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

@urfeex The changes looks good, but it seems that the new unittest are not running. At least I could not find it in the log and the code coverage did not change!

Rebasing onto the latest master updating the possible RTDE fields made the tests run through and upload coverage. Now, things should be good.

@urfeex urfeex requested a review from urrsk June 8, 2026 09:09
@urfeex urfeex merged commit e76636f into UniversalRobots:master Jun 8, 2026
86 of 96 checks passed
@urfeex urfeex deleted the add_missing_robot_types branch June 9, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants