Primary client script execution feedback#484
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #484 +/- ##
==========================================
+ Coverage 76.96% 77.72% +0.75%
==========================================
Files 116 116
Lines 6343 6563 +220
Branches 2761 2898 +137
==========================================
+ Hits 4882 5101 +219
+ Misses 1113 1098 -15
- Partials 348 364 +16 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
urfeex
left a comment
There was a problem hiding this comment.
First, very high-level overview.
urfeex
left a comment
There was a problem hiding this comment.
There seems to be an error somewhere in the logic. When I run the example with a robot that is not break-released, it releases breaks correctly, but then not all following commands are executed. I don't know whether there are some messages being lost due to the frequency things are called with or if there are flags that would need to be reset on the way.
This could be related with the error code handling. One example output is
[1776862206.490350] INFO /home/feex/git/ur_client_library/src/primary/primary_client.cpp 74: Starting primary client pipeline
Client connected
[1776862212.575126] INFO /home/feex/git/ur_client_library/include/ur_client_library/primary/primary_consumer.h 147: Logging an ErrorCodeMessage from the UR Controller Box: C100A7
[1776862212.581287] ERROR /home/feex/git/ur_client_library/src/primary/primary_client.cpp 237: Robot encountered error(s) during script execution, stopping program
[1776862212.581336] ERROR /home/feex/git/ur_client_library/src/primary/primary_client.cpp 240: Robot error code: C286A1
[1776862212.581351] ERROR /home/feex/git/ur_client_library/src/primary/primary_client.cpp 240: Robot error code: C286A1
[1776862212.581362] ERROR /home/feex/git/ur_client_library/src/primary/primary_client.cpp 240: Robot error code: C286A1
[1776862212.581385] ERROR /home/feex/git/ur_client_library/src/primary/primary_client.cpp 240: Robot error code: C286A1
[1776862212.581397] ERROR /home/feex/git/ur_client_library/src/primary/primary_client.cpp 240: Robot error code: C286A1
[1776862212.581407] ERROR /home/feex/git/ur_client_library/src/primary/primary_client.cpp 240: Robot error code: C286A1
[1776862212.581426] ERROR /home/feex/git/ur_client_library/src/primary/primary_client.cpp 240: Robot error code: C286A1
[1776862212.581438] ERROR /home/feex/git/ur_client_library/src/primary/primary_client.cpp 240: Robot error code: C286A1
[1776862212.581453] ERROR /home/feex/git/ur_client_library/src/primary/primary_client.cpp 240: Robot error code: C286A1
[1776862212.581466] ERROR /home/feex/git/ur_client_library/src/primary/primary_client.cpp 240: Robot error code: C286A1
[1776862212.581488] ERROR /home/feex/git/ur_client_library/src/primary/primary_client.cpp 240: Robot error code: C286A1
[1776862212.581505] ERROR /home/feex/git/ur_client_library/src/primary/primary_client.cpp 240: Robot error code: C286A1
[1776862212.581516] ERROR /home/feex/git/ur_client_library/src/primary/primary_client.cpp 240: Robot error code: C304A4
[1776862212.581537] ERROR /home/feex/git/ur_client_library/src/primary/primary_client.cpp 240: Robot error code: C100A7
[1776862212.684815] INFO /home/feex/git/ur_client_library/src/primary/primary_client.cpp 262: Script with name cool_function_name started
[1776862212.684926] INFO /home/feex/git/ur_client_library/src/primary/primary_client.cpp 256: Script with name cool_function_name executed successfully
[1776862212.685579] INFO /home/feex/git/ur_client_library/src/primary/primary_client.cpp 68: Stopping primary client pipeline
34d20cb to
89f09ff
Compare
Adds function definition (if missing) and gives the function a name.
to use dashboard client, as the new implementation of sendScript is not compatible with the structure it has.
sendScript now fails when runtime exception is thrown
Co-authored-by: Felix Exner <feex@universal-robots.com>
Add non-blocking send, add error case
fd597e0 to
4e0fced
Compare
This avoids running close to a singularity
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default mode and found 1 potential issue.
Reviewed by Cursor Bugbot for commit dd01eae. Configure here.

This is not quite done yet, but the main logic and the test cases are there
Still missing documentation and example also needs to be finished.
Note
Medium Risk
Adds new blocking URScript execution flow in
PrimaryClientthat parses/rewrites scripts and reacts to robot error/key/runtime-exception messages, which could affect program execution/stop behavior. Includes substantial new test infrastructure (fake primary server) and example/docs, but changes are isolated to primary-client script sending paths.Overview
Adds a new
PrimaryClient::sendScriptBlocking()API that prepares and validates URScript, checks robot/safety state, sends the script, and then waits forPROGRAM_XXX_STARTED/STOPPEDplus error-code and runtime-exception messages to determine success (optionally failing on warnings and issuingstop programon faults/violations).Extends the primary consumer/visitor to handle
KeyMessageandRuntimeExceptionMessage, addsScriptCodeSyntaxException, and adjusts runtime-exception line/column types touint32_t. Also adds asend_scriptexample + docs and introduces aFakePrimaryServerwith new unit/integration tests covering success paths, timeouts, read-only primary interface (C210), warnings/faults, and runtime exceptions.Reviewed by Cursor Bugbot for commit 772f460. Bugbot is set up for automated code reviews on this repo. Configure here.