Add missing robot types#513
Open
urfeex wants to merge 4 commits into
Open
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% 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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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 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.hso UR8LONG and UR18 map toUR8_LONGandUR18, and RobotMode::UNKNOWN is handled explicitly instead of falling through to an error.Switch exhaustiveness:
defaultbranches are removed fromrobotModeString,safetyModeString,safetyStatusString,robotTypeString, androbotSeriesString. Known sentinel values (UNDEFINED/UNKNOWN) stay as normal cases; any other out-of-range value throwsstd::invalid_argumentwithstd::to_string(replacingstringstreamin 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.