Skip to content

Add missing robot types#513

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

Add missing robot types#513
urfeex wants to merge 2 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 string-conversion helpers in a header; behavior change is clearer errors for unknown enum values instead of warn-and-UNDEFINED for robot type/series.

Overview
Extends robotTypeString so UR8LONG, UR18, and UNDEFINED map to UR8_LONG, UR18, and UNDEFINED instead of falling through a default branch.

Refactors robotModeString, safetyModeString, safetyStatusString, robotTypeString, and robotSeriesString to drop default cases: each enum value is handled explicitly, with RobotMode::UNKNOWN and RobotSeries::UNDEFINED as named cases. Unhandled numeric values now throw std::invalid_argument using std::to_string rather than stringstream (and robotTypeString / robotSeriesString no longer log a warning and return UNDEFINED for unknown values).

Together, new enum members should trigger -Wswitch (treated as error in CI) instead of silently hitting default.

Reviewed by Cursor Bugbot for commit 95cb4ea. 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 16.66667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.73%. Comparing base (627cf20) to head (95cb4ea).

Files with missing lines Patch % Lines
include/ur_client_library/ur/datatypes.h 16.66% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #513      +/-   ##
==========================================
- Coverage   78.12%   77.73%   -0.40%     
==========================================
  Files         116      116              
  Lines        6566     6557       -9     
  Branches     2898     2893       -5     
==========================================
- Hits         5130     5097      -33     
- Misses       1077     1096      +19     
- Partials      359      364       +5     
Flag Coverage Δ
check_version_ur10-3.15.8 10.85% <0.00%> (-2.28%) ⬇️
check_version_ur10e-10.11.0 11.58% <0.00%> (+0.05%) ⬆️
check_version_ur10e-5.15.2 11.48% <0.00%> (-1.06%) ⬇️
check_version_ur12e-10.12.1 11.48% <0.00%> (-0.04%) ⬇️
check_version_ur12e-5.25.1 11.48% <0.00%> (-0.24%) ⬇️
check_version_ur15-10.12.1 11.48% <0.00%> (-0.04%) ⬇️
check_version_ur15-5.25.1 11.67% <0.00%> (-0.04%) ⬇️
check_version_ur16e-10.12.1 11.48% <0.00%> (-0.04%) ⬇️
check_version_ur16e-5.25.1 11.48% <0.00%> (-0.24%) ⬇️
check_version_ur18-10.12.1 11.48% <0.00%> (-0.04%) ⬇️
check_version_ur18-5.25.1 11.48% <0.00%> (-0.24%) ⬇️
check_version_ur20-10.12.1 11.53% <0.00%> (-0.04%) ⬇️
check_version_ur20-5.25.1 11.48% <0.00%> (-0.88%) ⬇️
check_version_ur3-3.14.3 10.90% <0.00%> (-2.36%) ⬇️
check_version_ur30-10.12.1 11.48% <0.00%> (-0.04%) ⬇️
check_version_ur30-5.25.1 11.48% <0.00%> (-0.24%) ⬇️
check_version_ur3e-10.11.0 11.48% <0.00%> (-0.04%) ⬇️
check_version_ur3e-5.9.4 11.67% <0.00%> (-0.27%) ⬇️
check_version_ur5-3.15.8 11.67% <0.00%> (-1.75%) ⬇️
check_version_ur5e-10.11.0 11.48% <0.00%> (-0.04%) ⬇️
check_version_ur5e-5.12.8 11.53% <0.00%> (-0.36%) ⬇️
check_version_ur7e-10.11.0 11.48% <0.00%> (-0.09%) ⬇️
check_version_ur7e-5.22.2 11.67% <0.00%> (-0.22%) ⬇️
check_version_ur8long-10.12.1 11.48% <0.00%> (-0.04%) ⬇️
check_version_ur8long-5.25.1 11.48% <0.00%> (-0.78%) ⬇️
python_scripts 75.90% <ø> (ø)
start_ursim 82.84% <ø> (-2.36%) ⬇️
ur20-latest 73.56% <16.66%> (-0.03%) ⬇️
ur5-3.14.3 73.30% <16.66%> (-0.43%) ⬇️
ur5e-10.11.0 67.77% <16.66%> (-0.23%) ⬇️
ur5e-10.12.0 68.77% <16.66%> (-0.16%) ⬇️
ur5e-10.7.0 67.17% <16.66%> (-0.38%) ⬇️
ur5e-5.9.4 74.08% <16.66%> (-0.26%) ⬇️

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.

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.

case RobotType::UR5:
return "UR5";
case urcl::RobotType::UR8LONG:
return "UR8_LONG";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Inconsistent namespace qualification in new switch cases

Low Severity

The two newly added cases use urcl::RobotType::UR8LONG and urcl::RobotType::UR18 while all other cases in robotTypeString use the unqualified RobotType:: form. Since the function is already inside the urcl namespace, the explicit qualification is redundant and breaks the consistency of the switch statement.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 95cb4ea. Configure here.

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.

1 participant