feat: hosted teleop over Cloudflare RT#2411
Conversation
|
|
||
| ## Sidecar files | ||
|
|
||
| - **`/tmp/dimos_netem_profile`** — written by `data/notes/benchmarks/netem/apply.sh` |
There was a problem hiding this comment.
What is data/notes/benchmarks/netem/apply.sh? I see this mentioned in several places.
There was a problem hiding this comment.
using netem - Network simulator to simulate degraded network conditions and testing hosted teleop metrics change. But, I am not planning on including it in this PR. Thanks for pointing this, will remove references
| @rpc | ||
| def start(self) -> None: | ||
| # Append a per-run timestamp to the stem so each run is its own file. | ||
| base = getattr(self, "_db_path_base", None) |
There was a problem hiding this comment.
Don't use getattr.
Define it as none in __init__ or on the class.
| base = Path(self.config.db_path) | ||
| self._db_path_base = base | ||
| timestamp = datetime.now().strftime("%Y%m%d_%H%M%S") | ||
| self.config.db_path = base.with_name(f"{base.stem}_{timestamp}{base.suffix}") |
There was a problem hiding this comment.
greptile is correct. Don't mutate the config. Use self._db_path or something.
| Output lands in *out_dir* if given, else next to the .db. Returns the | ||
| written report.md path. Raises if the .db is missing or unreadable. | ||
| """ | ||
| db_path = Path(db_path) |
There was a problem hiding this comment.
| db_path = Path(db_path) |
| raise FileNotFoundError(f"Recording not found: {db_path}") | ||
| if out_dir is None: | ||
| out_dir = db_path.parent | ||
| out_dir = Path(out_dir) |
There was a problem hiding this comment.
| out_dir = Path(out_dir) |
| self._control_loop_thread: threading.Thread | None = None | ||
| self._heartbeat_thread: threading.Thread | None = None | ||
| self._telemetry_thread: threading.Thread | None = None |
There was a problem hiding this comment.
This module has a lot of threads. It could be simplified if you used async... but it would require rewriting multiple things. 😬
| right = self._controllers.get(Hand.RIGHT) | ||
| self._publish_button_state(left, right) | ||
| except Exception: | ||
| logger.exception("Error in control loop") |
There was a problem hiding this comment.
An error here could potentially spam the logs with the same error over and over.
Detailed in #2372
Problem
Hosted Teleop setup for DimOS
Closes DIM-XXX
Solution
Add hosted teleop over WebRTC via a Cloudflare Realtime SFU broker: a
HostedTeleopModulewith cmd/state datachannels + a camera video track that drops into existing blueprints, plus a sharedteleop/utilsrecording &transport-stats stack (recorder, latency/jitter/loss report,
VideoStats).How to Test
Contributor License Agreement