Skip to content

Add missing robot types#513

Open
urfeex wants to merge 4 commits into
UniversalRobots:masterfrom
urfeex:add_missing_robot_types
Open

Add missing robot types#513
urfeex wants to merge 4 commits into
UniversalRobots:masterfrom
urfeex:add_missing_robot_types

Conversation

@urfeex
Copy link
Copy Markdown
Member

@urfeex urfeex commented Jun 1, 2026

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

Low Risk
Localized logging/string conversion behavior with clearer errors for invalid enums; robot type/series unknown values now throw instead of warning plus UNDEFINED.

Overview
Updates enum-to-string helpers in datatypes.h so UR8LONG and UR18 map to UR8_LONG and UR18, and RobotMode::UNKNOWN is handled explicitly instead of falling through to an error.

Switch exhaustiveness: default branches are removed from robotModeString, safetyModeString, safetyStatusString, robotTypeString, and robotSeriesString. Known sentinel values (UNDEFINED / UNKNOWN) stay as normal cases; any other out-of-range value throws std::invalid_argument with std::to_string (replacing stringstream in several paths). Robot type/series no longer log a warning and return "UNDEFINED" for unlisted numeric values—they now throw like the other helpers.

Adds datatypes_tests (test_datatypes.cpp) covering all known enum strings and invalid-value throws.

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

urfeex added 2 commits June 1, 2026 10:03
This way, we will get a compiler warning when we add new enum types.
@urfeex urfeex requested a review from a team June 1, 2026 08:11
@urfeex urfeex added the bugfix label Jun 1, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

❌ Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 15.63%. Comparing base (627cf20) to head (dbf90f4).

Files with missing lines Patch % Lines
include/ur_client_library/ur/datatypes.h 0.00% 13 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (627cf20) and HEAD (dbf90f4). Click for more details.

HEAD has 455 uploads less than BASE
Flag BASE (627cf20) HEAD (dbf90f4)
start_ursim 16 1
check_version_ur3-3.14.3 16 1
check_version_ur18-5.25.1 14 1
check_version_ur5e-5.12.8 16 1
check_version_ur3e-5.9.4 16 1
check_version_ur8long-5.25.1 16 1
check_version_ur15-5.25.1 16 1
check_version_ur20-5.25.1 16 1
check_version_ur10e-5.15.2 16 1
check_version_ur7e-5.22.2 16 1
check_version_ur12e-5.25.1 16 1
check_version_ur16e-5.25.1 16 1
check_version_ur5-3.15.8 16 1
check_version_ur30-5.25.1 16 1
check_version_ur15-10.12.1 16 1
check_version_ur20-10.12.1 16 1
check_version_ur8long-10.12.1 15 1
check_version_ur16e-10.12.1 16 1
check_version_ur5e-10.11.0 16 1
check_version_ur18-10.12.1 16 1
check_version_ur10-3.15.8 16 1
check_version_ur7e-10.11.0 16 1
check_version_ur10e-10.11.0 16 1
check_version_ur30-10.12.1 16 1
check_version_ur3e-10.11.0 15 1
check_version_ur12e-10.12.1 16 1
ur5e-10.11.0 13 0
ur5e-10.12.0 13 0
ur5e-10.7.0 13 0
ur20-latest 12 0
ur5-3.14.3 10 0
ur5e-5.9.4 8 0
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #513       +/-   ##
===========================================
- Coverage   78.12%   15.63%   -62.50%     
===========================================
  Files         116      116               
  Lines        6566     6608       +42     
  Branches     2898     2920       +22     
===========================================
- Hits         5130     1033     -4097     
- Misses       1077     5489     +4412     
+ Partials      359       86      -273     
Flag Coverage Δ
check_version_ur10-3.15.8 11.38% <0.00%> (-1.75%) ⬇️
check_version_ur10e-10.11.0 11.43% <0.00%> (-0.09%) ⬇️
check_version_ur10e-5.15.2 11.43% <0.00%> (-1.10%) ⬇️
check_version_ur12e-10.12.1 11.43% <0.00%> (-0.09%) ⬇️
check_version_ur12e-5.25.1 11.38% <0.00%> (-0.44%) ⬇️
check_version_ur15-10.12.1 11.38% <0.00%> (-0.14%) ⬇️
check_version_ur15-5.25.1 11.38% <0.00%> (-0.38%) ⬇️
check_version_ur16e-10.12.1 11.43% <0.00%> (-0.14%) ⬇️
check_version_ur16e-5.25.1 11.38% <0.00%> (-0.33%) ⬇️
check_version_ur18-10.12.1 11.38% <0.00%> (-0.19%) ⬇️
check_version_ur18-5.25.1 11.38% <0.00%> (-0.51%) ⬇️
check_version_ur20-10.12.1 11.43% <0.00%> (-0.14%) ⬇️
check_version_ur20-5.25.1 11.58% <0.00%> (-0.78%) ⬇️
check_version_ur3-3.14.3 11.80% <0.00%> (-1.46%) ⬇️
check_version_ur30-10.12.1 11.38% <0.00%> (-0.14%) ⬇️
check_version_ur30-5.25.1 11.38% <0.00%> (-0.44%) ⬇️
check_version_ur3e-10.11.0 11.38% <0.00%> (-0.14%) ⬇️
check_version_ur3e-5.9.4 11.38% <0.00%> (-0.56%) ⬇️
check_version_ur5-3.15.8 11.38% <0.00%> (-2.04%) ⬇️
check_version_ur5e-10.11.0 11.38% <0.00%> (-0.19%) ⬇️
check_version_ur5e-5.12.8 11.62% <0.00%> (-0.27%) ⬇️
check_version_ur7e-10.11.0 11.38% <0.00%> (-0.19%) ⬇️
check_version_ur7e-5.22.2 11.38% <0.00%> (-0.51%) ⬇️
check_version_ur8long-10.12.1 11.38% <0.00%> (-0.19%) ⬇️
check_version_ur8long-5.25.1 11.43% <0.00%> (-0.83%) ⬇️
python_scripts 75.90% <ø> (ø)
start_ursim 82.41% <ø> (-2.79%) ⬇️
ur20-latest ?
ur5-3.14.3 ?
ur5e-10.11.0 ?
ur5e-10.12.0 ?
ur5e-10.7.0 ?
ur5e-5.9.4 ?

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.

Copy link
Copy Markdown

@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 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
Copy link
Copy Markdown
Member

@urrsk urrsk left a comment

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

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