Add ClockSyncConfigurator for Unitree WebRTC#1346
Merged
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 |
paul-nechifor
previously approved these changes
Feb 24, 2026
…rator Addresses PR review feedback: replace manual input() with typer.confirm() and all print() calls with proper logging.
The doclinks pre-commit hook needs to run on markdown changes too.
paul-nechifor
previously approved these changes
Feb 24, 2026
…onfigurator # Conflicts: # dimos/robot/cli/dimos.py
Address PR review: add dedicated .configurators() chaining method for SystemConfigurator instances, keeping .requirements() for plain callable checks only.
paul-nechifor
previously approved these changes
Feb 26, 2026
paul-nechifor
approved these changes
Feb 26, 2026
paul-nechifor
approved these changes
Feb 26, 2026
jeff-hykin
pushed a commit
that referenced
this pull request
Apr 4, 2026
* time system checks * refactor(system_configurator): split into package with separate modules 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. * refactor: remove unitree_clock_sync wrapper, use system_checks directly Drop requirements.py and its tests — the global_config-based connection type check was unnecessary. Blueprints now call system_checks(ClockSyncConfigurator()) directly. * refactor: consolidate human-readable formatters into dimos/utils/human.py Replace 6 scattered duration/byte formatting implementations with two shared functions: human_duration() and human_bytes(). * fix(clock_sync): use ntpdate/sntp instead of systemd for clock fix 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). * refactor: add human_number() for SI-suffixed number formatting Move msgs/sec formatter from benchmark heatmap into dimos/utils/human.py as human_number() (42, 1.5k, 3.2M). * blueprint configurator support * clock configurator refactor * configurator API comment * small fixes * 200ms time tolerance * small fixes * use typer.confirm and logger instead of input/print in system configurator Addresses PR review feedback: replace manual input() with typer.confirm() and all print() calls with proper logging. * remove markdown paths-ignore from code-cleanup workflow The doclinks pre-commit hook needs to run on markdown changes too. * removed autoconf from cli * feat(blueprints): separate .configurators() from .requirements() Address PR review: add dedicated .configurators() chaining method for SystemConfigurator instances, keeping .requirements() for plain callable checks only. * configurators list cleanup * blueprints gen bugfix
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