feat(robot): export config and cut over SharedRobot transport#204
feat(robot): export config and cut over SharedRobot transport#204maxxgx wants to merge 2 commits into
Conversation
Decorate robot drivers with @export_config, switch robot owner stdin envelopes to robot: ComponentConfig, and update SharedRobot.from_config() and physicalai robot serve CLI. Co-authored-by: Cursor <cursoragent@cursor.com>
MarkRedeman
left a comment
There was a problem hiding this comment.
This looks good to me, though I think some of the code could be simplified if we ignore the "legacy flat robot class"?
| default=None, | ||
| help="JSON-serializable driver constructor arguments.", | ||
| required=True, | ||
| help="Trusted robot ComponentConfig (class_path + init_args).", |
There was a problem hiding this comment.
Can we add an example here? I imagine this would require a json string?
| rejection of unknown keys (including legacy flat ``robot_class`` / | ||
| ``robot_kwargs``) before import or hardware access. Public ``SharedRobot`` |
There was a problem hiding this comment.
Do we need to keep handing a "legacy flat robot_class" etc?
| robot_kwargs: JSON-serializable driver constructor kwargs (e.g. | ||
| ``port``, ``calibration`` as a path, ``role`` as a str), used | ||
| only when this instance spawns the owner. | ||
| robot: Trusted driver :class:`~physicalai.config.ComponentConfig` to |
There was a problem hiding this comment.
It's not entirely clear to me what a "trusted" driver would be
| # Omit default None so @export_config does not capture "_session": null. | ||
| if _session is not None: | ||
| return cls(name, allow_remote=allow_remote, connect_timeout=connect_timeout, _session=_session) | ||
| return cls(name, allow_remote=allow_remote, connect_timeout=connect_timeout) |
There was a problem hiding this comment.
The constructor has _session: object | None = None, so wouldn't cls(name, allow_remote=allow_remote, connect_timeout=connect_timeout) be the same as cls(name, allow_remote=allow_remote, connect_timeout=connect_timeout, _session=_session), if _session is none?
| return self.joint_positions | ||
|
|
||
|
|
||
| @export_config |
Summary
@export_config.robot: ComponentConfig.SharedRobot.from_config(), owner worker, andphysicalai robot serveCLI.Stacked on #202.
Test plan
uv run pytest tests/unit/robot/test_robot_component_config.py tests/unit/robot/transport/ tests/unit/cli/test_robot_cli.pyReview & merge order
PR #202 — Core config engine →
mainCore
physicalai.config(export, instantiate, validation)PR #204 — Robot drivers & SharedRobot transport (this PR)
Robot config export and SharedRobot owner process startup
PR #205 — Camera drivers & SharedCamera transport
Camera config export and SharedCamera publisher startup
PR #206 — Runtime, InferenceModel & CLI
End-to-end YAML,
physicalai run --config, examples, and user docsIn parallel: PR #203 — Component config design doc →
docs/designDetailed design doc; not blocking the code PRs