Add missing robot types#513
Conversation
This way, we will get a compiler warning when we add new enum types.
Codecov Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 95cb4ea. Configure here.
| case RobotType::UR5: | ||
| return "UR5"; | ||
| case urcl::RobotType::UR8LONG: | ||
| return "UR8_LONG"; |
There was a problem hiding this comment.
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)
Reviewed by Cursor Bugbot for commit 95cb4ea. Configure here.


This consists of two commits:
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
robotTypeStringsoUR8LONG,UR18, andUNDEFINEDmap toUR8_LONG,UR18, andUNDEFINEDinstead of falling through adefaultbranch.Refactors
robotModeString,safetyModeString,safetyStatusString,robotTypeString, androbotSeriesStringto dropdefaultcases: each enum value is handled explicitly, withRobotMode::UNKNOWNandRobotSeries::UNDEFINEDas named cases. Unhandled numeric values nowthrow std::invalid_argumentusingstd::to_stringrather thanstringstream(androbotTypeString/robotSeriesStringno longer log a warning and returnUNDEFINEDfor unknown values).Together, new enum members should trigger
-Wswitch(treated as error in CI) instead of silently hittingdefault.Reviewed by Cursor Bugbot for commit 95cb4ea. Bugbot is set up for automated code reviews on this repo. Configure here.