Skip to content

Conversation

@fmauch
Copy link
Contributor

@fmauch fmauch commented Oct 24, 2022

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.

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.

This commit should not only increase the timeout on the initial read to a
value that should be sufficient, but also establishes a retry with a warning
output.
@codecov
Copy link

codecov bot commented Oct 24, 2022

Codecov Report

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

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
@@            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 Coverage Δ
src/ur/dashboard_client.cpp 0.00% <0.00%> (ø)
tests/test_tcp_server.cpp 99.23% <0.00%> (+0.75%) ⬆️
src/control/trajectory_point_interface.cpp 79.48% <0.00%> (+7.69%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

@fmauch fmauch added this to the Release 1.3.0 milestone Nov 3, 2022
Copy link
Contributor

@urmahp urmahp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I have verified that it works with the increased timeout and that it doesn't work with the original timeout of 1 seconds when the robot simulator has just finished booting.

@fmauch fmauch merged commit 07969f0 into UniversalRobots:master Nov 8, 2022
@fmauch fmauch deleted the dashboard_client_init branch November 8, 2022 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants