UniversalRobots / Universal_Robots_Client_Library

A C++ library for accessing the UR interfaces that facilitate the use of UR robotic manipulators by external applications.
Apache License 2.0
117 stars 88 forks source link

Improve primary client #137

Closed urmarp closed 3 months ago

urmarp commented 1 year ago

Improved primary interface, this includes following changes:

codecov[bot] commented 1 year ago

Codecov Report

Base: 74.09% // Head: 75.53% // Increases project coverage by +1.44% :tada:

Coverage data is based on head (1d13676) compared to base (09adab9). Patch coverage: 68.91% of modified lines in pull request are covered.

:exclamation: Current head 1d13676 differs from pull request most recent head 3cd736a. Consider uploading reports for the commit 3cd736a to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #137 +/- ## ========================================== + Coverage 74.09% 75.53% +1.44% ========================================== Files 91 135 +44 Lines 3462 4775 +1313 Branches 359 429 +70 ========================================== + Hits 2565 3607 +1042 - Misses 680 931 +251 - Partials 217 237 +20 ``` | [Impacted Files](https://codecov.io/gh/UniversalRobots/Universal_Robots_Client_Library/pull/137?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=UniversalRobots) | Coverage Δ | | |---|---|---| | [include/ur\_client\_library/comm/bin\_parser.h](https://codecov.io/gh/UniversalRobots/Universal_Robots_Client_Library/pull/137?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=UniversalRobots#diff-aW5jbHVkZS91cl9jbGllbnRfbGlicmFyeS9jb21tL2Jpbl9wYXJzZXIuaA==) | `89.23% <ø> (+14.76%)` | :arrow_up: | | [...client\_library/primary/abstract\_primary\_consumer.h](https://codecov.io/gh/UniversalRobots/Universal_Robots_Client_Library/pull/137?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=UniversalRobots#diff-aW5jbHVkZS91cl9jbGllbnRfbGlicmFyeS9wcmltYXJ5L2Fic3RyYWN0X3ByaW1hcnlfY29uc3VtZXIuaA==) | `100.00% <ø> (ø)` | | | [.../ur\_client\_library/primary/program\_state\_message.h](https://codecov.io/gh/UniversalRobots/Universal_Robots_Client_Library/pull/137?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=UniversalRobots#diff-aW5jbHVkZS91cl9jbGllbnRfbGlicmFyeS9wcmltYXJ5L3Byb2dyYW1fc3RhdGVfbWVzc2FnZS5o) | `0.00% <0.00%> (ø)` | | | [include/ur\_client\_library/primary/robot\_message.h](https://codecov.io/gh/UniversalRobots/Universal_Robots_Client_Library/pull/137?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=UniversalRobots#diff-aW5jbHVkZS91cl9jbGllbnRfbGlicmFyeS9wcmltYXJ5L3JvYm90X21lc3NhZ2UuaA==) | `100.00% <ø> (ø)` | | | [.../primary/robot\_message/runtime\_exception\_message.h](https://codecov.io/gh/UniversalRobots/Universal_Robots_Client_Library/pull/137?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=UniversalRobots#diff-aW5jbHVkZS91cl9jbGllbnRfbGlicmFyeS9wcmltYXJ5L3JvYm90X21lc3NhZ2UvcnVudGltZV9leGNlcHRpb25fbWVzc2FnZS5o) | `0.00% <0.00%> (ø)` | | | [include/ur\_client\_library/primary/robot\_state.h](https://codecov.io/gh/UniversalRobots/Universal_Robots_Client_Library/pull/137?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=UniversalRobots#diff-aW5jbHVkZS91cl9jbGllbnRfbGlicmFyeS9wcmltYXJ5L3JvYm90X3N0YXRlLmg=) | `100.00% <ø> (ø)` | | | [include/ur\_client\_library/ur/calibration\_checker.h](https://codecov.io/gh/UniversalRobots/Universal_Robots_Client_Library/pull/137?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=UniversalRobots#diff-aW5jbHVkZS91cl9jbGllbnRfbGlicmFyeS91ci9jYWxpYnJhdGlvbl9jaGVja2VyLmg=) | `83.33% <0.00%> (+16.66%)` | :arrow_up: | | [include/ur\_client\_library/ur/ur\_driver.h](https://codecov.io/gh/UniversalRobots/Universal_Robots_Client_Library/pull/137?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=UniversalRobots#diff-aW5jbHVkZS91cl9jbGllbnRfbGlicmFyeS91ci91cl9kcml2ZXIuaA==) | `33.33% <ø> (ø)` | | | [src/primary/program\_state\_message.cpp](https://codecov.io/gh/UniversalRobots/Universal_Robots_Client_Library/pull/137?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=UniversalRobots#diff-c3JjL3ByaW1hcnkvcHJvZ3JhbV9zdGF0ZV9tZXNzYWdlLmNwcA==) | `0.00% <0.00%> (ø)` | | | [...rimary/robot\_message/runtime\_exception\_message.cpp](https://codecov.io/gh/UniversalRobots/Universal_Robots_Client_Library/pull/137?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=UniversalRobots#diff-c3JjL3ByaW1hcnkvcm9ib3RfbWVzc2FnZS9ydW50aW1lX2V4Y2VwdGlvbl9tZXNzYWdlLmNwcA==) | `0.00% <0.00%> (ø)` | | | ... and [100 more](https://codecov.io/gh/UniversalRobots/Universal_Robots_Client_Library/pull/137?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=UniversalRobots) | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=UniversalRobots). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=UniversalRobots)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

fmauch commented 1 year ago

@urmarp this would be easier to review if these were multiple commits.

urmarp commented 1 year ago

Before reviewing this any further: Could you please elaborate what you have done? What is the handler concept and why did you add this?

Again, splitting this into multiple commits (maybe with commit messages going into more detail) might make things a lot clearer.

I have split the commit into multiple commits and tried to explain the thoughts behind the changes.

Added message handlers for the messages from the primary interface. These handlers save the data from the latest message of each type, which can then be accessed through the primary client. The handlers also enable the possibility to handle the data differently for each message. The primary client can through its consumer get the message handlers and from the message handlers get the latest message of each type.

fmauch commented 3 months ago

Closing this in favor of #186