Primary client script execution feedback#484
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #484 +/- ##
==========================================
- Coverage 76.85% 76.69% -0.16%
==========================================
Files 116 116
Lines 6343 6519 +176
Branches 2761 2881 +120
==========================================
+ Hits 4875 5000 +125
- Misses 1120 1148 +28
- Partials 348 371 +23
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
try to fix the ones not working in CI
7d912f5 to
6a8cbe8
Compare
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 60e3346. Configure here.
| if (is_warning && fail_on_warnings) | ||
| { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
Warning failure path doesn't stop running script
Medium Severity
When is_warning && fail_on_warnings is true, sendScriptBlocking returns false without calling commandStop() to halt the running program on the robot. The error-handling path (the is_error block just above) correctly calls commandStop() before returning false. This inconsistency means a warning that doesn't inherently stop the robot (i.e., not a protective stop) leaves the script still executing while the caller believes execution failed.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 60e3346. 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 script-execution flow on the
PrimaryClientthat depends on robot state, safety mode, and asynchronous key/error/runtime-exception messages; failures here could impact program execution/stop behavior and client control flow.Overview
Adds
PrimaryClient::sendScriptBlocking()to upload URScript and wait for start/stop feedback, failing on robot errors, runtime exceptions, start timeout, and (optionally) warnings; it also introducessafetyModeAllowsExecution()plus script preparation/validation (comment stripping, auto-wrapping indef, name validation/truncation) and a newScriptCodeSyntaxException.Extends primary message consumption to handle
KeyMessageandRuntimeExceptionMessage, queues them inPrimaryClient, and uses them to determine script outcome. Updates build config to silence GCC 13–15<regex>warnings forprimary_client.cpp, adds a newsend_script_blockingexample, expands primary-client tests for the new behavior, and documents thePrimaryClientarchitecture page.Reviewed by Cursor Bugbot for commit 60e3346. Bugbot is set up for automated code reviews on this repo. Configure here.