-
Notifications
You must be signed in to change notification settings - Fork 18
Add ClockSyncConfigurator for Unitree WebRTC #1346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
leshy
wants to merge
17
commits into
dev
Choose a base branch
from
ivan/feat/clock-sync-configurator
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
c6036e4
time system checks
leshy 7daff8b
refactor(system_configurator): split into package with separate modules
leshy 2953877
refactor: remove unitree_clock_sync wrapper, use system_checks directly
leshy d5bdf2a
refactor: consolidate human-readable formatters into dimos/utils/huma…
leshy c9c63f8
fix(clock_sync): use ntpdate/sntp instead of systemd for clock fix
leshy f2c499b
refactor: add human_number() for SI-suffixed number formatting
leshy 41ee2b8
blueprint configurator support
leshy 0a35bb3
clock configurator refactor
leshy c0b90f9
configurator API comment
leshy b25ad8d
small fixes
leshy 7f5ee1b
200ms time tolerance
leshy 5386891
small fixes
leshy 8edc995
use typer.confirm and logger instead of input/print in system configu…
leshy 0047c0e
Merge remote-tracking branch 'origin/dev' into ivan/feat/clock-sync-c…
leshy f1fa5e6
remove markdown paths-ignore from code-cleanup workflow
leshy 5ed6f28
Merge remote-tracking branch 'origin/dev' into ivan/feat/clock-sync-c…
leshy 1389b2c
removed autoconf from cli
leshy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,6 @@ | ||
| name: code-cleanup | ||
| on: | ||
| pull_request: | ||
| paths-ignore: | ||
| - '**.md' | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # Copyright 2026 Dimensional Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """System configurator package — re-exports for backward compatibility.""" | ||
|
|
||
| import platform | ||
|
|
||
| from dimos.protocol.service.system_configurator.base import ( | ||
| SystemConfigurator, | ||
| configure_system, | ||
| sudo_run, | ||
| ) | ||
| from dimos.protocol.service.system_configurator.clock_sync import ClockSyncConfigurator | ||
| from dimos.protocol.service.system_configurator.lcm import ( | ||
| IDEAL_RMEM_SIZE, | ||
| BufferConfiguratorLinux, | ||
| BufferConfiguratorMacOS, | ||
| MaxFileConfiguratorMacOS, | ||
| MulticastConfiguratorLinux, | ||
| MulticastConfiguratorMacOS, | ||
| ) | ||
|
|
||
|
|
||
| # TODO: This is a configurator API issue and inserted here temporarily | ||
| # | ||
| # We need to use different configurators based on the underlying OS | ||
| # | ||
| # We should have separation of concerns, nothing but configurators themselves care about the OS in this context | ||
| # | ||
| # So configurators with multi-os behavior should be responsible for the right per-OS behaviour, and | ||
| # not external systems | ||
| # | ||
| # We might want to have some sort of recursive configurators | ||
| # | ||
| def lcm_configurators() -> list[SystemConfigurator]: | ||
| """Return the platform-appropriate LCM system configurators.""" | ||
| system = platform.system() | ||
| if system == "Linux": | ||
| return [ | ||
| MulticastConfiguratorLinux(loopback_interface="lo"), | ||
| BufferConfiguratorLinux(), | ||
| ] | ||
| elif system == "Darwin": | ||
| return [ | ||
| MulticastConfiguratorMacOS(loopback_interface="lo0"), | ||
| BufferConfiguratorMacOS(), | ||
| MaxFileConfiguratorMacOS(), # TODO: this is not LCM related and shouldn't be here at all | ||
| ] | ||
| return [] | ||
|
|
||
|
|
||
| __all__ = [ | ||
| "IDEAL_RMEM_SIZE", | ||
| "BufferConfiguratorLinux", | ||
| "BufferConfiguratorMacOS", | ||
| "ClockSyncConfigurator", | ||
| "MaxFileConfiguratorMacOS", | ||
| "MulticastConfiguratorLinux", | ||
| "MulticastConfiguratorMacOS", | ||
| "SystemConfigurator", | ||
| "configure_system", | ||
| "lcm_configurators", | ||
| "sudo_run", | ||
| ] |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configuring and checking requirements seem different. I think you should add:
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered this and it would have been easier but I always like to have less categories then more.
I consider this a category of "function you call - it does either checks or config, if it errors out stuff is not good to run" so this can be pings, clock, network checks, LFS checks etc. From a blueprint perspective that's the way you want to think about the category imo, no need to know what's inside the functions.
Only ugliness here is that configurators are not functions but these classes. I considered keeping the wrapper to turn them into functions external to blueprints.py but this complicates the user facing API.
like
There are a few more things with configurators to refactor, I'd like to turn them info functions, so I expect this code to go away from blueprints.. how does this sound?