Skip to content

Conversation

@urfeex
Copy link
Member

@urfeex urfeex commented Jan 21, 2026

This is a refactor of RTDE communication effectively improving two things:

  • No more heap memory allocations during communication once everything is setup
  • Reduced parsing and access times of RTDE data that reduces the time of read and send operations

There's currently some documentation and testing missing, hence the draft status.

Creating new objects on the heap isn't really RT-capable and
undeterministic. This adds the possibility to parse incoming data
packages into a pre-allocated package to avoid having to create new
objects on the fly.

To achieve this, the pipeline in the RTDE client has been replaced by a
double buffer with two pre-allocated objects.
This should be a lot faster in accessing/storing objects in the data package
Before that change we were basically allocating strings and a new
DataPackage on each send operation. This change will preallocate a data
package and re-use that for future send operations. The necessary RTDE
dictionary keys are also preallocated.
@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

❌ Patch coverage is 74.42623% with 78 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.03%. Comparing base (4db70eb) to head (3287341).

Files with missing lines Patch % Lines
src/rtde/rtde_client.cpp 61.90% 11 Missing and 13 partials ⚠️
src/rtde/rtde_parser.cpp 77.21% 11 Missing and 7 partials ⚠️
include/ur_client_library/comm/producer.h 37.50% 13 Missing and 2 partials ⚠️
include/ur_client_library/primary/primary_parser.h 12.50% 7 Missing ⚠️
src/rtde/rtde_writer.cpp 93.20% 4 Missing and 3 partials ⚠️
include/ur_client_library/rtde/data_package.h 76.92% 0 Missing and 3 partials ⚠️
src/rtde/data_package.cpp 77.77% 1 Missing and 1 partial ⚠️
src/ur/ur_driver.cpp 50.00% 2 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (4db70eb) and HEAD (3287341). Click for more details.

HEAD has 12 uploads less than BASE
Flag BASE (4db70eb) HEAD (3287341)
start_ursim 3 1
ur5e-10.7.0 3 1
ur20-latest 3 0
ur5-3.14.3 3 0
ur5e-5.9.4 2 0
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #419      +/-   ##
==========================================
- Coverage   43.13%   38.03%   -5.10%     
==========================================
  Files          99      100       +1     
  Lines        8685     8766      +81     
  Branches     1182     1182              
==========================================
- Hits         3746     3334     -412     
- Misses       4657     5200     +543     
+ Partials      282      232      -50     
Flag Coverage Δ
start_ursim 81.61% <ø> (-1.60%) ⬇️
ur20-latest ?
ur5-3.14.3 ?
ur5e-10.7.0 36.63% <74.42%> (+0.54%) ⬆️
ur5e-5.9.4 ?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

// loop.
my_client.start();
my_client.start(false);
const std::string key = "target_speed_fraction";
Copy link
Member

Choose a reason for hiding this comment

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

variable should have a more explaning name and maybe also in UPPERCAST letters as it is a constant

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