Skip to content

docs: Adding-a-Robot embodiment cookbook (closes #64)#135

Merged
rylinjames merged 1 commit into
mainfrom
docs/adding-a-robot-cookbook
May 15, 2026
Merged

docs: Adding-a-Robot embodiment cookbook (closes #64)#135
rylinjames merged 1 commit into
mainfrom
docs/adding-a-robot-cookbook

Conversation

@rylinjames
Copy link
Copy Markdown
Collaborator

Summary

Adds docs/adding_a_robot.md — step-by-step guide for adding a new embodiment to Reflex. Closes #64.

Adapted from #128

@DsThakurRawat opened #128 with the same goal. The doc structure (4-step process → two worked examples → common patterns by vertical → checklist) is theirs and good; preserved via Co-Authored-By on the commit.

What this PR fixes vs #128

#128's example JSONs used field names that don't exist in src/reflex/embodiments/schema.json. Anyone copy-pasting would have failed validation. Fixes:

#128 used Schema actually requires
"labels": [...] (no such field — action_dim is the structural signal)
"normalization": { "mean": [...], "std": [...] } mean_action, std_action, mean_state, std_state (4 separate arrays)
Camera "width", "height", "encoding" "resolution": [w, h], "color_space"
"workspace_bbox" (in constraints) (not in schema — only max_ee_velocity, max_gripper_velocity, collision_check)

What I added beyond fixing

  • Both example JSONs validated against the live schema + cross-field rules at PR time. A short Python snippet at the top of docs/adding_a_robot.md's Step 4 lets users do the same — it catches the most common mistake (wrong field names) before opening a PR.
  • "Validate before opening a PR" section with a one-liner that exits 0 on success.
  • Step 1 includes the new optional fields from feat(embodiments): quadcopter preset + optional gripper + payload_release #132: drones omit gripper + max_gripper_velocity and use payload_release instead. Example B (SkyScout, quadcopter) demonstrates this.
  • Step 4 references reflex doctor + reflex go --dry-run as the end-to-end smoke test, not just unit tests.
  • "Common patterns by vertical" section trimmed to verticals actually represented in the FastCrest customer research vault — warehouse AMR, farm/hobby (SO-100 class), aerial drone, smart-camera. Each pattern includes the actual reflex serve / reflex ros2-serve invocation.
  • Drops the duplicate-file step. docs: create 'Adding a Robot' embodiment cookbook (closes #64) #128 instructed users to place the JSON in both src/reflex/embodiments/presets/ AND configs/embodiments/. The latter is a dev fallback that feat(embodiments): quadcopter preset + optional gripper + payload_release #132 deprecated; presets/ is canonical.

Validation pre-commit

[block 1] (myarm6)    ✓ valid (1 expected-enum violation — Step 3 fixes this)
[block 2] (quadcopter) ✓ valid (no errors, no warnings)
[block 3] skip (enum snippet, not a full config)

The "expected-enum violation" on block 1 (myarm6 slug) is the point — Step 3 of the cookbook teaches users to add new slugs to the schema enum. The validator correctly fails on a new slug pre-Step-3 and passes post-Step-3.

Closes / supersedes

Test plan

  • Both example JSONs validated against validate_embodiment_config() from the live source
  • Example A (myarm6) only fails on the expected embodiment enum violation (Step 3 territory); no field-name mistakes, no length mismatches, no out-of-range indices
  • Example B (quadcopter) passes cleanly — uses the optional payload_release block + 10-DOF state matching /mavros/local_position/odom
  • Cross-references match real files (schema.json, cli_reference.md, embodiment_schema.md, getting_started.md)
  • Live preview (no docs site build wired in this repo — GitHub-rendered Markdown)

Adds docs/adding_a_robot.md walking new contributors through adding
a fifth embodiment to Reflex. Two worked examples — MyArm-6 (6-DOF
arm + gripper) and SkyScout (quadcopter delivery drone) — both
validated against the live src/reflex/embodiments/schema.json before
commit. The example JSONs use only real schema fields (mean_action /
std_action / mean_state / std_state, resolution + color_space, etc.)
so anyone copy-pasting can run validate_embodiment_config on them
and get a clean pass after Step 3.

Drops fabrications from the original attempt (#128):
- Field names like 'labels', 'mean'/'std' (instead of mean_action),
  camera 'width'/'height'/'encoding' (instead of resolution +
  color_space), 'workspace_bbox' — none of which are in schema.json
- The 'configs/embodiments/' duplicate-file step (that location was
  a dev fallback; #132 made src/reflex/embodiments/presets/ canonical)

Reflects what's actually shipped after recent foundation merges:
- Optional gripper + payload_release (from #132)
- New quadcopter preset with 10-DOF state matching MAVROS Odometry
- ROS2 bridge --state-msg-type flag (from #133) for drone deployments
- 'Common patterns by vertical' section reflects the FastCrest
  customer research vault's P0 verticals (warehouse AMR, farm, drone,
  smart-camera)

Supersedes #128.

Co-Authored-By: Divyansh Rawat <186957976+DsThakurRawat@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rylinjames rylinjames merged commit b660594 into main May 15, 2026
6 checks passed
@rylinjames rylinjames deleted the docs/adding-a-robot-cookbook branch May 15, 2026 21:51
rylinjames added a commit that referenced this pull request May 16, 2026
 #63) (#137)

Adds docs/troubleshooting.md with the most common error signatures and
fixes Reflex users hit on edge devices, cloud GPUs, ROS2 robots, and
drones. Structure: CUDA/GPU → Jetson → ROS2 bridge → Drone/MAVROS →
Export/validation → Registry → Quick diagnostics.

Adapted from #129 — kept all the original error signatures and fix
patterns (they're real and useful). Only refreshed:
- onnxruntime-gpu pin: 1.18.0 → >=1.25.1 (matches v0.9.2 floor)
- cuDNN floor: 9.0+ → 9.5+ (matches v0.9.2 floor)
- Driver floor: R525+ → R555+ for cuDNN 9.5+ (per v0.9.4 doctor guard)
- Added Blackwell sm_120 section (RTX 5090 / B200) per v0.9.3 guard
- Added the four v0.9.4 reflex doctor guards as the prescribed first
  step on any failure (multi-GPU arch, Jetson R35, cuDNN/driver skew,
  TRT EP empirical session test)
- Replaced #129's reference to PR #121 with the actual shipped
  --state-msg-type flag from #133 (joint_state/imu/odom dispatch)
- Updated cross-ref from understanding_verification.md → verification.md
  (renamed in #136)
- Updated cross-ref to adding_a_robot.md (shipped in #135)
- File renamed TROUBLESHOOTING.md → troubleshooting.md for consistency
  with sibling docs (lowercase, no ALL_CAPS)

Supersedes #129.

Co-authored-by: Divyansh Rawat <186957976+DsThakurRawat@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

[Docs] Create 'Adding a Robot' Tutorial (Embodiment Cookbook)

1 participant