Skip to content

feat(robot): export config and cut over SharedRobot transport#204

Open
maxxgx wants to merge 2 commits into
max/comp-config-1-corefrom
max/comp-config-2-robot
Open

feat(robot): export config and cut over SharedRobot transport#204
maxxgx wants to merge 2 commits into
max/comp-config-1-corefrom
max/comp-config-2-robot

Conversation

@maxxgx

@maxxgx maxxgx commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Decorates SO101 and WidowX drivers with @export_config.
  • Cuts over robot owner stdin startup envelopes to robot: ComponentConfig.
  • Updates SharedRobot.from_config(), owner worker, and physicalai robot serve CLI.

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.py

Review & merge order

  1. PR #202 — Core config enginemain
    Core physicalai.config (export, instantiate, validation)

  2. PR #204 — Robot drivers & SharedRobot transport (this PR)
    Robot config export and SharedRobot owner process startup

  3. PR #205 — Camera drivers & SharedCamera transport
    Camera config export and SharedCamera publisher startup

  4. PR #206 — Runtime, InferenceModel & CLI
    End-to-end YAML, physicalai run --config, examples, and user docs

In parallel: PR #203 — Component config design docdocs/design
Detailed design doc; not blocking the code PRs

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 MarkRedeman left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add an example here? I imagine this would require a json string?

Comment on lines +19 to +20
rejection of unknown keys (including legacy flat ``robot_class`` /
``robot_kwargs``) before import or hardware access. Public ``SharedRobot``

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not entirely clear to me what a "trusted" driver would be

Comment on lines +315 to +318
# 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why no class path arg here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants