Enhance RTDE with throttling options, document & bug fix.#574
Open
Harrier-SA wants to merge 2 commits intoAMRC-FactoryPlus:mainfrom
Open
Enhance RTDE with throttling options, document & bug fix.#574Harrier-SA wants to merge 2 commits intoAMRC-FactoryPlus:mainfrom
Harrier-SA wants to merge 2 commits intoAMRC-FactoryPlus:mainfrom
Conversation
…imestamp bug and updated documentation.
KavanPrice
requested changes
Dec 16, 2025
| options: | ||
| dependencies: | ||
| throttleEnabled: true | ||
| order: 4 |
Contributor
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
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)` | ||
| ); | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
RTDEHandlerinedge-rtde/lib/rtde.js, allowing data publishing intervals to be configured viathrottleandpollIntsettings. By default, throttling is enabled at 500ms (2Hz), but can be disabled for full-rate (~125Hz) publishing. [1] [2]startThrottledPublish) and logic to store and periodically publish the latest state when throttling is enabled.handleDatato always remove thetimestampfield fromrobotModeDatabefore publishing, preventing InfluxDB overflow errors.Configuration Schema Updates:
acs-service-setup/dumps/edge.yamlto add new fields:throttleEnabled(boolean) andpollInt(number, ms) for RTDE driver configuration, with improved field descriptions and option ordering. These settings control the new throttling feature.Documentation:
edge-rtde/docs/RTDE-DATA-REFERENCE.mdfile, 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.