Open
Conversation
Split the monolithic system_configurator.py into a package for better organization as more configurators are added. base.py has the ABC and helpers, clock_sync.py has ClockSyncConfigurator, lcm.py has LCM configurators. __init__.py re-exports everything for backward compat.
Drop requirements.py and its tests — the global_config-based connection type check was unnecessary. Blueprints now call system_checks(ClockSyncConfigurator()) directly.
…n.py Replace 6 scattered duration/byte formatting implementations with two shared functions: human_duration() and human_bytes().
Replace hardcoded timedatectl + systemd-timesyncd with a fallback chain: ntpdate > sntp > date -s. Avoids touching systemd on systems where timesyncd isn't installed (e.g. Arch). Also removes duplicate warning printed from check() (explanation() already handles it).
Move msgs/sec formatter from benchmark heatmap into dimos/utils/human.py as human_number() (42, 1.5k, 3.2M).
Contributor
Greptile SummaryThis PR adds automated clock synchronization checks for Unitree WebRTC deployments and consolidates human-readable formatters across the codebase. Key Changes:
Breaking Changes (intentional):
Testing:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Blueprint.requirements] --> B[system_checks wrapper]
B --> C[configure_system]
C --> D{CI environment?}
D -->|Yes| E[Skip all checks]
D -->|No| F[Run ClockSyncConfigurator.check]
F --> G{NTP query}
G -->|Timeout/Error| H[Pass gracefully]
G -->|Success| I{abs offset > 100ms?}
I -->|No| J[Pass]
I -->|Yes| K[Show explanation]
K --> L{User approves fix?}
L -->|No non-critical| M[Continue with warning]
L -->|Yes| N[Run fix chain]
N --> O{Platform?}
O -->|Linux| P[ntpdate > sntp > date -s]
O -->|macOS| Q[sntp -sS]
P --> R[Blueprint starts]
Q --> R
J --> R
H --> R
M --> R
Last reviewed commit: f2c499b |
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.
Problem
Closes #1344
Closes DIM-575
When running Unitree robots over WebRTC, clock drift between the host and robot causes timestamp mismatches. There was no automated check or fix for this.
Solution
ClockSyncConfiguratorpure py SNTP query detects clock offset (threshold: ±100ms). NTP unreachable -> gracefully warns (works offline). triesntpdate>sntp>date -sfallback.system_checks()bridge - wrapsSystemConfigurator(s) into aBlueprint.requirements()compatible callablesystem_configuratorrefactored into a package -base.py(framework),lcm.py(multicast/buffer),clock_sync.py(new).dimos/utils/human.py- consolidated 6 scattered duration/byte/number formatters intohuman_duration(),human_bytes(),human_number().Integrated into
unitree_go2_basicandunitree_g1_basichardware blueprints.Breaking Changes
None
How to Test
Issues
configurator API needs some improvements
Contributor License Agreement