Skip to content

Conversation

@Harrier-SA
Copy link
Contributor

This pull request adds robust throttling support to the Universal Robots RTDE Edge driver, improves configuration options, and provides comprehensive documentation for all exposed RTDE data. The main changes include configurable throttling of data publishing, new configuration schema fields, removal of problematic timestamp fields, and the addition of a detailed data reference guide.

RTDE Driver Throttling and Data Handling:

  • Added throttling support to RTDEHandler in edge-rtde/lib/rtde.js, allowing data publishing intervals to be configured via throttle and pollInt settings. By default, throttling is enabled at 500ms (2Hz), but can be disabled for full-rate (~125Hz) publishing. [1] [2]
  • Implemented a throttled publishing loop (startThrottledPublish) and logic to store and periodically publish the latest state when throttling is enabled.
  • Bug Fix: Modified handleData to always remove the timestamp field from robotModeData before publishing, preventing InfluxDB overflow errors.
  • Improved clarity and formatting in the data publishing logic for each RTDE data section.

Configuration Schema Updates:

  • Updated acs-service-setup/dumps/edge.yaml to add new fields: throttleEnabled (boolean) and pollInt (number, ms) for RTDE driver configuration, with improved field descriptions and option ordering. These settings control the new throttling feature.

Documentation:

  • Added a new edge-rtde/docs/RTDE-DATA-REFERENCE.md file, providing a comprehensive reference of all available RTDE data, JSONPath access patterns, enumerated values, usage examples, and configuration instructions for throttling.

These changes make the RTDE driver more flexible, user-friendly, and robust for integration with historian and analytics systems.

@KavanPrice KavanPrice self-requested a review December 16, 2025 15:49
options:
dependencies:
throttleEnabled: true
order: 4
Copy link
Contributor

Choose a reason for hiding this comment

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

For readability I'd put these in the order they come in within the UI.

});

// Throttling configuration - read from conf
this.throttleEnabled = conf.throttle !== false; // Default true unless explicitly set to false
Copy link
Contributor

Choose a reason for hiding this comment

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

This behaviour is the opposite to the default value in edge.yaml.

Comment on lines +100 to +119
// Start throttled publishing loop
startThrottledPublish() {
if (this.publishTimer) {
clearInterval(this.publishTimer);
}

this.publishTimer = setInterval(() => {
if (this.latestState) {
this.handleData(this.latestState);
// Don't clear latestState - keep it for next interval in case no new data arrives
}
}, this.pollInt);

this.log(
`✅ Started throttled publishing at ${this.pollInt}ms interval (${(
1000 / this.pollInt
).toFixed(2)}Hz)`
);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Was this implemented using setInterval() for a reason? I'd expect this logic to be a simple check against the last published timestamp within the callback for handling "data". i.e. when you check if throttling is enabled on receiving data from the downstream device, you check when it was last published and ignore if it's smaller than your interval. That way all the logic is in one place.

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