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

dashboard_client: Allow a larger timeout on initial connection #126

Closed fmauch closed 1 year ago

fmauch commented 1 year ago

Apparently, if we connect to the socket right after it became available, it can happen, that we don't get a "connected" message from the dashboard server in a second.

I tested this with a retry timeout of 1ms here. Then, when launching the dashboard_client before starting URSim made the client trying to connect each millisecond. I read the Connected: Universal Robots Dashboard Server message roughly 1.5 seconds after the last Failed to connect to robot on IP... output. This seems to be the minimum time we need to wait for the bootup message after the socket has been opened (at least on my machine with URSim).

Therefore, I set the timeout for the initial read call to 10 seconds and added a retry mechanism to that. I don't think this should happen which is why I added a warning output.

codecov[bot] commented 1 year ago

Codecov Report

Base: 51.21% // Head: 51.23% // Increases project coverage by +0.01% :tada:

Coverage data is based on head (03a4c68) compared to base (1d9b975). Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #126 +/- ## ========================================== + Coverage 51.21% 51.23% +0.01% ========================================== Files 82 82 Lines 2466 2471 +5 Branches 279 278 -1 ========================================== + Hits 1263 1266 +3 - Misses 1072 1075 +3 + Partials 131 130 -1 ``` | [Impacted Files](https://codecov.io/gh/UniversalRobots/Universal_Robots_Client_Library/pull/126?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=UniversalRobots) | Coverage Δ | | |---|---|---| | [src/ur/dashboard\_client.cpp](https://codecov.io/gh/UniversalRobots/Universal_Robots_Client_Library/pull/126/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=UniversalRobots#diff-c3JjL3VyL2Rhc2hib2FyZF9jbGllbnQuY3Bw) | `0.00% <0.00%> (ø)` | | | [tests/test\_tcp\_server.cpp](https://codecov.io/gh/UniversalRobots/Universal_Robots_Client_Library/pull/126/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=UniversalRobots#diff-dGVzdHMvdGVzdF90Y3Bfc2VydmVyLmNwcA==) | `99.23% <0.00%> (+0.75%)` | :arrow_up: | | [src/control/trajectory\_point\_interface.cpp](https://codecov.io/gh/UniversalRobots/Universal_Robots_Client_Library/pull/126/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=UniversalRobots#diff-c3JjL2NvbnRyb2wvdHJhamVjdG9yeV9wb2ludF9pbnRlcmZhY2UuY3Bw) | `79.48% <0.00%> (+7.69%)` | :arrow_up: | 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.