estop spec + fall and haywire conditions - #3691
Draft
AaryanAgrawal wants to merge 1 commit into
Draft
Conversation
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #3691 +/- ##
==========================================
+ Coverage 77.79% 77.83% +0.04%
==========================================
Files 1289 1294 +5
Lines 123511 124064 +553
Branches 10823 10881 +58
==========================================
+ Hits 96091 96571 +480
- Misses 24278 24388 +110
+ Partials 3142 3105 -37
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 8 files with indirect coverage changes 🚀 New features to boost your workflow:
|
AaryanAgrawal
force-pushed
the
aaryan/estop
branch
2 times, most recently
from
August 26, 2026 04:37
cb54fca to
e6819ff
Compare
AaryanAgrawal
force-pushed
the
aaryan/estop
branch
from
August 26, 2026 04:46
e6819ff to
b729e5e
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Nothing in dimos notices when a robot falls over or when a policy drives a joint far faster than it should.
ControlCoordinator.set_estop()already stops every task, but nothing automatic ever calls it, and no G1 task implements it, so on a G1 it reaches nothing.This adds conditions at both ends and makes the shared path solid.
Both routes end in the same call, so a condition can live wherever the data is.
The Spec
EStopindimos/spec/control.pyis how a module reaches the stop without importing the coordinator. Declared bare,_estop: EStop, it is a required ref: launching a stack with nothing able to stop the robot raisesNo module met that spec.before anything moves. Declaring the concrete class instead resolves toNoneand only fails at the fall; a topic never fails at all.Note this is a launch-time guarantee, not a CI one.
test_all_blueprintsimports blueprints but never deploys them, so it does not exercise ref resolution.set_estopwas not actually a latchThree fixes to the existing fan out, all reachable today:
grep -c "_estopped" coordinator.pyreturned 0, so despite the docstring, a task registered after a trip came up live. The latch now lives on the coordinator andadd_taskapplies it.getattr(task, "set_estop", None)with no else, which is why nobody noticed the G1 had zero coverage. It now logs the task it cannot stop.Config
max_tilt_degon the G1 connection defaults to 45 deg.max_joint_speed_rad_son the coordinator defaults toNone, off, because a robot agnostic coordinator has no safe default. No existing stack changes behaviour.Results
Replaying a real recording of two deliberate G1 falls through the tilt check, 176,426 samples at 756 Hz:
For the joint limit: a settled standing G1 peaks at 0.77 rad/s and the whole fall reached 1.77 rad/s, against G1 URDF velocity limits of 20 to 37 rad/s.
dimos/control/,dimos/robot/unitree/g1/,dimos/spec/: 298 passed. The 3 failures arecartesian_ikfailing to import GitPython, identical on a cleanmainworktree.test_all_blueprints: 20 failed / 78 passed, byte identical tomain.Simulated in MuJoCo
Both conditions driven by real physics through the shipped check functions. MuJoCo 3.10.0, the
g1_29dofmodel with visual meshes replaced by boxes, since the STLs live in LFS. Simulated, not hardware.Fall, free base tumbling under gravity. Trips at t=0.330s at 45.2 deg, tilt reaches 137.8 deg, one stop issued and then latched.
Flailing joint, left knee kicked to 30 rad/s against a 20 rad/s limit. Trips on the first tick past the limit.
Not done
max_joint_speed_rad_syet, so flailing detection is not armed in tree.MujocoSimModule, not the connection, so the fall check is not wired there. The clip above drives the check directly.