Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard commands, Docker Image and CI step for running the examples #127

Merged
merged 18 commits into from
Nov 28, 2022

Conversation

urrsk
Copy link
Member

@urrsk urrsk commented Oct 29, 2022

This PR started with adding a example for getting the calibration info out from the primary interface. Then I want it to run in the CI for continue test that it could run.
After I added a step running the examples, I realised that the other examples need some adjustments, including some calls through the dashboard server, to turn the Simulated robot into run mode.
Therefore includes this PR also functionalities to run Dashboard command for this purpose, just like it is made in the ROS drivers.
In addition, the CI also was update to use the docker imagel

Made a primary pipeline example for receiving the robot calibration
based on the already existing primary pipeline example and
the ROS calibration code
Instead of building one in the CI we now uses
the image made by UR
Adding short function to make it easier to:
- Power off
- Power on
- Brake release
- Load a program
- Play
- Pause
- Stop
- Close popup
- Close safety popup
- Restart safety
- Unlock protective stop
- Shutdown
The default behavior is to find a run all the examples
For this it was needed to change the examples to not run forever
@urrsk urrsk requested review from fmauch and urmahp October 29, 2022 08:47
@codecov
Copy link

codecov bot commented Oct 29, 2022

Codecov Report

Base: 63.34% // Head: 74.12% // Increases project coverage by +10.78% 🎉

Coverage data is based on head (d5fa901) compared to base (1ed6576).
Patch coverage: 66.97% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #127       +/-   ##
===========================================
+ Coverage   63.34%   74.12%   +10.78%     
===========================================
  Files          89       91        +2     
  Lines        2968     3463      +495     
  Branches      310      360       +50     
===========================================
+ Hits         1880     2567      +687     
+ Misses        927      678      -249     
- Partials      161      218       +57     
Impacted Files Coverage Δ
include/ur_client_library/ur/dashboard_client.h 100.00% <ø> (+100.00%) ⬆️
examples/dashboard_example.cpp 27.58% <27.58%> (ø)
examples/full_driver.cpp 57.77% <50.00%> (+57.77%) ⬆️
src/ur/dashboard_client.cpp 61.38% <56.92%> (+61.38%) ⬆️
examples/rtde_client.cpp 67.74% <63.63%> (+67.74%) ⬆️
tests/test_dashboard_client.cpp 78.26% <78.26%> (ø)
examples/primary_pipeline.cpp 90.47% <81.81%> (+90.47%) ⬆️
examples/primary_pipeline_calibration.cpp 88.23% <88.23%> (ø)
src/ur/version_information.cpp 96.00% <96.00%> (ø)
tests/test_version_information.cpp 100.00% <100.00%> (ø)
... and 39 more

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.

Copy link
Collaborator

@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.

I would add the wait_program.urp to the resources folder inside the examples, since it is required by the dashboard_example.cpp and also add to the error message if it fails to load the program, that the program can be found in the resources folder.

I think that we should add functions for all or at least most of the dashboard commands available, but this doesn't necessarily have to be in this PR.

Other than above comments it looks very good to me and I have tested that all the examples are working properly, with a simulated robot.

examples/dashboard_example.cpp Show resolved Hide resolved
include/ur_client_library/ur/dashboard_client.h Outdated Show resolved Hide resolved
src/ur/dashboard_client.cpp Outdated Show resolved Hide resolved
examples/dashboard_example.cpp Outdated Show resolved Hide resolved
examples/full_driver.cpp Outdated Show resolved Hide resolved
examples/dashboard_example.cpp Outdated Show resolved Hide resolved
examples/full_driver.cpp Outdated Show resolved Hide resolved
@fmauch fmauch added this to the Release 1.3.0 milestone Nov 3, 2022
Copy link
Collaborator

@fmauch fmauch left a comment

Choose a reason for hiding this comment

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

Thanks @urrsk for pushing this from the drivers to the library. I think, it is worth modernizing a couple of things while we're at it, see my comments. As discussed, I'll add some suggestions to the PR directly.

examples/dashboard_example.cpp Outdated Show resolved Hide resolved
examples/dashboard_example.cpp Outdated Show resolved Hide resolved
examples/dashboard_example.cpp Outdated Show resolved Hide resolved
examples/full_driver.cpp Outdated Show resolved Hide resolved
examples/full_driver.cpp Outdated Show resolved Hide resolved
include/ur_client_library/ur/dashboard_client.h Outdated Show resolved Hide resolved
src/ur/dashboard_client.cpp Outdated Show resolved Hide resolved
src/ur/dashboard_client.cpp Outdated Show resolved Hide resolved
include/ur_client_library/ur/dashboard_client.h Outdated Show resolved Hide resolved
include/ur_client_library/ur/dashboard_client.h Outdated Show resolved Hide resolved
@fmauch fmauch self-requested a review November 22, 2022 07:56
urrsk and others added 4 commits November 22, 2022 08:59
The dockerfile is no longer needed
as the repo now uses the docker image
This should be more clear to API users what the timeouts actually mean and
this should be more platform independent to use std::this_thread::sleep_for
instead of usleep.
@fmauch
Copy link
Collaborator

fmauch commented Nov 24, 2022

@urrsk I've included most of your comments from urrsk#1 and I think I would be happy with the state this is in. I tend to disagree with urrsk#1 (comment)

This feels like hitting the "using exceptions as control flow is an anti-pattern" too hard. That might be a more general question though, how we would like to structure this library.

In my opinion this is clearer to users that they'll have to provide the
robot's IP in that case. Also, when run with the start_ursim.sh script
this will work right out of the box
Copy link
Collaborator

@fmauch fmauch left a comment

Choose a reason for hiding this comment

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

Thank you @urrsk and @urmahp for the great work. This should greatly robustify things around the dashboard server.

I'll clean up history a bit and will then merge it.

examples/dashboard_example.cpp Outdated Show resolved Hide resolved
examples/dashboard_example.cpp Show resolved Hide resolved
include/ur_client_library/ur/dashboard_client.h Outdated Show resolved Hide resolved
include/ur_client_library/ur/dashboard_client.h Outdated Show resolved Hide resolved
@fmauch
Copy link
Collaborator

fmauch commented Nov 28, 2022

Merging despite failing pipeline on humble, because of #132.

@fmauch fmauch merged commit 1c06ea6 into UniversalRobots:master Nov 28, 2022
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.

4 participants