Add missing robot types#513
Conversation
Codecov Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
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.
|
@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! |
This way, we will get a compiler warning when we add new enum types.
dbf90f4 to
cf7711c
Compare
Rebasing onto the latest master updating the possible RTDE fields made the tests run through and upload coverage. Now, things should be good. |

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
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
robotTypeStringwithUR8LONG→"UR8_LONG"andUR18→"UR18", and tightens enum-to-string helpers indatatypes.hso new enum values are less likely to be missed at compile time.The
defaultbranches are removed from the switches onrobotModeString,safetyModeString,safetyStatusString,robotTypeString, androbotSeriesString. Known sentinel values (RobotMode::UNKNOWN,RobotType::UNDEFINED,RobotSeries::UNDEFINED) are handled explicitly; any other unrecognized numeric value throwsstd::invalid_argument(usingstd::to_stringinstead ofstringstream).robotTypeString/robotSeriesStringno longer log and return"UNDEFINED"for unknown enum integers.Adds
datatypes_tests(test_datatypes.cpp) and wires it intests/CMakeLists.txtto 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.