Skip to content

[sim2 prerequisite] Reconcile connection modules with coordinator control and estop - #4723

Draft
Nabla7 wants to merge 15 commits into
mainfrom
pim/fix/connection-coordinator-integration
Draft

Nabla7 wants to merge 15 commits into
mainfrom
pim/fix/connection-coordinator-integration

Conversation

@Nabla7

@Nabla7 Nabla7 commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Reconcile ConnectionModule with coordinator motor control and latched stops, including callback-driven feedback without a polling thread; 38 focused tests pass.

mustafab0 and others added 11 commits October 14, 2026 09:40
ConnectionModule is the base for a robot driver: one module per robot, in
its own process. A driver declares the standard ports it takes today
(position_command, velocity_command, motor_command, base_command in;
joint_state, odom, imu out) and fills in describe, connect, read_state,
write and halt. The base checks the descriptions and the ports before
connecting, turns each incoming message into named values with the shared
converters (newest message per input and robot), checks them with
validate_command and passes them to write, publishes readings as typed
messages, and calls halt when commands stop arriving. describe_control
returns the descriptions and a session ID that is new on every start.

dimos/control/contract/convert.py holds the converters between the
standard messages and named values, for drivers and the coordinator alike.

MockConnectionModule is a position-driven pretend arm for tests.
The twist base preset reports vx, vy and wz by default, and no output
carried them, so a base driver using the preset defaults failed to start.
base_velocity: Out[Twist] carries them, for the one base in the module.
Interface names come from the Interface enum. The arm preset now needs a
robot model, so the mock connection writes its description out by hand,
and tests with no robot model use turning_joints from the test helpers.
Commands for one robot no longer keep another robot's deadman alive. When
any robot's deadman expires the whole module halts, and status reports
which robots went quiet.
A driver no longer writes describe(). Its config declares one port spec
field per command input (TwistPort, JointPort, MotorPort), named like the
port, and its Out ports say what it reports by message type alone.
control_description() in contract/ports.py merges both into the one
ControlDescription the base class, validate.py and the coordinator use.

- One description and one deadman per module; the list-of-descriptions
  support, per-source timers and describe_control() RPC are gone.
- status() carries session_id; deadman_fired is a bool.
- read_state() returns an empty dict for nothing new, never None.
- The state loop warns, at most once a second, when it runs late.
- The mock takes its joints from a seven-joint URDF shipped beside it.
- presets' joint builder and base unit tables are public so ports.py can
  reuse them; convert.py drops the fixed port-name maps.
Integrate coordinator-streams f46ccd4, e690daa, a9d0ea2 and connection-estop 8b91cba onto connected-hardware ac3631e and main fbe126e.

Discover the current derived single-robot contract with resolved port metadata. Route declared names/subsets, provide explicit complete PD commands, allow read-only model joint feedback, and require fresh feedback from every state key.

Verified 725 control, message, registry and blueprint tests including five worker-process cases; mypy passes eight changed production files. No sim2, transport, mapping or upstream branch changes.
@Nabla7
Nabla7 removed this pull request from stack #4731 October 22, 2026 06:57
@Nabla7
Nabla7 added this pull request to stack #4765 October 22, 2026 06:57

This branch has not been deployed

No deployments
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