feat(agents): TypeSafeAgent: world state in, joystick cmd_vel out - #4212
Draft
spomichter wants to merge 3 commits into
Draft
spomichter wants to merge 3 commits into
spomichter wants to merge 3 commits into
Conversation
A reactive text-only agent on TypeSafe System One. Each tick folds odom, 3D (or 2D) detections and the scan into one JSON state, asks one request (a 3-way Choice per joystick axis, a stop Noul, a target Choice over the visible labels) and drives: the model picks directions, code sets magnitudes from the target's bearing and distance, ramps the Twist at 10 Hz and zeroes it on a deadman. Holds without odom or detections. `to_json` on PoseStamped, Detection2DArray, Detection3DArray and PointCloud2 (8-sector clearance), all TypedDict-typed. `habitat-typesafe`: HabitatConnection(publish_objects=True) renders the semantic sensor and boxes each visible annotated instance from its depth pixels (HM3D annotations carry no object boxes); generated LCM constructors share nested defaults, so Detection3D is built fresh at every level. `unitree-go2-typesafe` plus a DimSim e2e that publishes a chair and drives to it.
❌ 2 Tests Failed:
View the top 2 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
…nt, drive.py is the adapter
Draft
1 task
… publishes goal: PointStamped and steers to it out of view
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.
Problem
DimOS agents are LLM chat loops. There is no way to run a fast, calibrated, text-only decision model as a reactive controller: perception in, typed decisions out, at a fixed rate, with confidence the code can gate on.
Solution
TypeSafeAgent(dimos/agents/typesafe/:world_state.pyin,drive.pyadapter out,agent.pymodule) drives a robot from TypeSafe System One decisions. Rewrite of #4210 from scratch onmain, applying the review there.world_state.build_world_state()folds odom (PoseStampedorOdometry), 3D or 2D detections and the scan into one JSON state. New typedto_json()onPoseStamped,Detection2DArray,Detection3DArray,PointCloud2(8-sector clearance in the robot frame). Numbers carry word buckets (bearing,distance, sectorstate).drive.questions()builds one 3-way Choice per joystick axis (x,y,yaw), astopNoul and atargetChoice over the visible labels, in the documented API shapes viaclient.choice()/client.noul().requests.postinagent._posttoPOST /v1/systemonewith{state, model, questions}. No client class, no retries: a failed tick zeroes the target and the next tick asks again.drive.decode()gates each axis on confidence;agent._steer()scales turn rate by bearing error and speed by distance to the chosen target, declares arrival under 0.5 m, ramps the Twist at 10 Hz from its own thread, zeroes on a deadman ofmax(1 s, 2.5 / rate_hz). Holds (no request) without odom or detections; gives up after 5 s without motion.human_input/agent/agent_idlecontract, so humancli and the cockpit chat attach unchanged.Blueprints:
habitat-typesafe:habitat_teleop+HabitatConnection(publish_objects=True). HM3D annotations carry no object boxes, so the native renders the semantic sensor and boxes each visible instance from its depth pixels. Generated LCM constructors share nested defaults;Detection3Dis built fresh at every level.unitree-go2-typesafe, with a DimSim e2e that publishes a chair and drives to it.Spec:
dimensionalOS/agentsengineering/typesafe-agent/spec.md.Testing
to_json, world-state buckets, drive decoding, agent loop with a fake client: hold, arrival, odometry input, failure, deadman; habitat server round trips incl. two-object boxes). mypy clean on all changed files.habitat-typesafe, headless, traced): chair 4.5 m ahead at spawn,target=chair, drove 3.8 m and stopped at the chair.test_dimsim_typesafe_agent.py) passes on this branch: 86 s, target confidence 1.0.Run:
TYPESAFE_API_KEY=... uv run dimos run habitat-typesafe, thenuv run humancli --transport zenohandgo to the chair.Supersedes #4210.