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

Add instruction executor for high-level robot control #242

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

urfeex
Copy link
Member

@urfeex urfeex commented Jan 10, 2025

With the trajectory point interface there is a method of executing motions with only the urcl present as shown in https://github.com/UniversalRobots/Universal_Robots_Client_Library/blob/master/examples/trajectory_point_interface.cpp

However, usage is a bit cumbersome, we might want to support a one-liner for executing ptp motions, instead.

This PR adds the InstructionExecutor, a high-level module that uses existing functionality to provide simple-to-use interfaces, currently to execute MoveJ, MoveL and sequences of the two. In future, we might extend that to other instructions such as other motion types, but possibly also other functionality, hence the more general name.

@urfeex urfeex requested review from urrsk and urmahp January 10, 2025 12:34
Copy link

codecov bot commented Jan 10, 2025

Codecov Report

Attention: Patch coverage is 92.55319% with 7 lines in your changes missing coverage. Please review.

Project coverage is 72.93%. Comparing base (2c12bee) to head (5d58245).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
src/control/trajectory_point_interface.cpp 60.00% 6 Missing ⚠️
src/ur/instruction_executor.cpp 98.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #242      +/-   ##
==========================================
+ Coverage   71.71%   72.93%   +1.21%     
==========================================
  Files          71       75       +4     
  Lines        2786     2889     +103     
  Branches      353      360       +7     
==========================================
+ Hits         1998     2107     +109     
+ Misses        596      591       -5     
+ Partials      192      191       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

The times are only rough and should reflect the trajectory time plus
some overhead.
examples/CMakeLists.txt Outdated Show resolved Hide resolved
examples/instruction_executor.cpp Outdated Show resolved Hide resolved
src/control/trajectory_point_interface.cpp Outdated Show resolved Hide resolved
Estimating the exact execution time in CI is very hard, so we restrict
it by bounds to check whether the right parameters are actually being
used.

This could be greatly improved by faking / mocking the actual execution
for a unit test instead of using URSim in an integration test.
// time parametrization below with a motion time of 2.5 seconds, so this is the upper bound to
// distinguish between the two. This large range is necessary, as the actual overhead is not
// known.
ASSERT_GT(duration.count(), 1400);

Choose a reason for hiding this comment

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

Shall we add some failures to test if the error codes match?
EXCEPTIONS maybe?

Copy link
Member Author

Choose a reason for hiding this comment

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

good point, thank you!

examples/instruction_executor.cpp Outdated Show resolved Hide resolved
@urfeex urfeex requested a review from SarveshMalladi January 22, 2025 09:14
Otherwise the hardware will send a result that we will never read and
this will bleed into next excution.
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.

2 participants