-
Notifications
You must be signed in to change notification settings - Fork 8
Add claude.md #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add claude.md #162
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,322 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| # EmbodiChain — Developer Reference | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| EmbodiChain is an **end-to-end, GPU-accelerated, modular platform** for building generalized Embodied Intelligence, developed by DexForce Technology Co., Ltd. It provides a simulation lab, gym environments, RL training infrastructure, and agentic frameworks for robot learning research. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| - **License**: Apache 2.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| - **Repository**: https://github.com/DexForce/EmbodiChain | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## Project Structure | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| EmbodiChain/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ├── embodichain/ # Main Python package | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ ├── agents/ # AI agents | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ │ ├── hierarchy/ # LLM-based hierarchical agents (task, code, validation) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ │ ├── mllm/ # Multimodal LLM prompt scaffolding | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ │ └── rl/ # RL agents: PPO algo, rollout buffer, actor-critic models | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ ├── data/ # Assets, datasets, constants, enums | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ ├── lab/ # Simulation lab | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ │ ├── gym/ # OpenAI Gym-compatible environments | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ │ │ ├── envs/ # BaseEnv, EmbodiedEnv, RLEnv | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ │ │ │ ├── managers/ # Observation, event, reward, record, dataset managers | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ │ │ │ │ └── randomization/ # Physics, geometry, spatial, visual randomizers | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ │ │ │ ├── tasks/ # Task implementations (tableware, RL, special) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ │ │ │ ├── action_bank/ # Configurable action primitives | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ │ │ │ └── wrapper/ # Env wrappers (e.g. no_fail) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ │ │ └── utils/ # Gym registration, misc helpers | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ │ ├── sim/ # Simulation core | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ │ │ ├── objects/ # Robot, RigidObject, Articulation, Light, Gizmo, SoftObject | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ │ │ ├── sensors/ # Camera, StereoCamera, BaseSensor | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ │ │ ├── robots/ # Robot-specific configs and params (dexforce_w1, cobotmagic) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ │ │ ├── planners/ # Motion planners (TOPPRA, motion generator) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ │ │ └── solvers/ # IK solvers (SRS, OPW, pink, pinocchio, pytorch) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ │ ├── devices/ # Real-device controllers | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ │ └── scripts/ # Entry-point scripts (run_env, run_agent) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ ├── toolkits/ # Standalone tools | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ │ ├── graspkit/pg_grasp/ # Parallel-gripper grasp sampling | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ │ └── urdf_assembly/ # URDF builder utilities | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ └── utils/ # Shared utilities | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ ├── configclass.py # @configclass decorator | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ ├── logger.py # Project logger | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ ├── math/ # Tensor math helpers | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ └── warp/kinematics/ # GPU kinematics via Warp | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ├── configs/ # Agent configs and task prompts (text/YAML) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ├── docs/ # Sphinx documentation source + build | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| │ └── source/ # .md doc pages (overview, quick_start, features, resources) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ├── tests/ # Test suite | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ├── .github/ # CI workflows and issue/PR templates | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ├── setup.py # Package setup | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| └── VERSION # Package version file | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## Code Style | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| ### Formatting | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| - **Formatter**: `black==24.3.0` — run before every commit. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| black . | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| ### File Headers | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Every source file begins with the Apache 2.0 copyright header: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```python | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| # ---------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Copyright (c) 2021-2026 DexForce Technology Co., Ltd. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| # ... | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+67
to
+74
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Every source file begins with the Apache 2.0 copyright header: | |
| ```python | |
| # ---------------------------------------------------------------------------- | |
| # Copyright (c) 2021-2026 DexForce Technology Co., Ltd. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # ... | |
| Python source files in the `embodichain/` and `tests/` directories must begin with the Apache 2.0 copyright header: | |
| ```python | |
| # ---------------------------------------------------------------------------- | |
| # Copyright (c) 2021-2026 DexForce Technology Co., Ltd. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. |
Copilot
AI
Mar 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This claims from __future__ import annotations should be at the top of every file, but several core modules (e.g. embodichain/lab/gym/envs/base_env.py, embodied_env.py, rl_env.py) do not include it. To avoid establishing an inaccurate convention, either update these files to match or soften the guidance (e.g. "prefer for new files" / "used in many modules").
| - Use `from __future__ import annotations` at the top of every file. | |
| - Prefer `from __future__ import annotations` at the top of new Python files and when updating existing modules, where feasible. |
Copilot
AI
Mar 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the Functor example, class my_randomizer(Functor) uses a lowercase class name, which conflicts with standard Python class naming and can be confused with the function-style functor described above. Consider using a MyRandomizer-style class name (or make this example a plain function) to keep the pattern clear.
| class my_randomizer(Functor): | |
| class MyRandomizer(Functor): |
Copilot
AI
Mar 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This documentation note says the docs are built with Sphinx using Markdown source files, but the repo uses both .rst and .md in docs/source/ (with MyST). Consider updating the wording to “Markdown and reStructuredText” to avoid confusing contributors.
| - Docs are built with **Sphinx** using **Markdown** source files (`docs/source/`). | |
| - Docs are built with **Sphinx** using **Markdown and reStructuredText** source files (`docs/source/`). |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -36,6 +36,67 @@ We welcome pull requests for bug fixes, new features, and documentation improvem | |||||
| * Include a summary of the changes and link to any relevant issues (e.g., `Fixes #123`). | ||||||
| * Ensure all checks pass. | ||||||
|
|
||||||
| ## Using Claude Code for Contributions | ||||||
|
|
||||||
| [Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview) is an AI-powered CLI that can assist you throughout the contribution workflow — from understanding the codebase to writing, reviewing, and debugging code. | ||||||
|
|
||||||
| ### Setup | ||||||
|
|
||||||
| Install Claude Code and authenticate: | ||||||
|
|
||||||
| ```bash | ||||||
| npm install -g @anthropic-ai/claude-code | ||||||
| claude | ||||||
| ``` | ||||||
|
|
||||||
| A `CLAUDE.md` file is present at the root of this repository. Claude Code reads it automatically at startup to load project conventions, structure, and style rules, so it is context-aware from the first prompt. | ||||||
|
|
||||||
| ### Suggested workflows | ||||||
|
|
||||||
| **Explore the codebase before making changes** | ||||||
|
|
||||||
| ``` | ||||||
| > Explain how the Functor/Manager pattern works in embodichain/lab/gym/envs/managers/ | ||||||
| > What is the difference between EmbodiedEnv and RLEnv? | ||||||
| > Show me an example of how a randomization functor is registered in a task config. | ||||||
| ``` | ||||||
|
|
||||||
| **Implement a new feature** | ||||||
|
|
||||||
| ``` | ||||||
| > I want to add a new observation functor that returns the end-effector velocity. | ||||||
| Which existing functor should I model it after? | ||||||
| > Generate the functor following the project style, with a proper docstring and type hints. | ||||||
| ``` | ||||||
|
|
||||||
| **Validate style and formatting before submitting** | ||||||
|
|
||||||
| ``` | ||||||
| > Review my changes in embodichain/lab/gym/envs/managers/randomization/visual.py | ||||||
| for style issues, missing type hints, and docstring completeness. | ||||||
| ``` | ||||||
|
|
||||||
| **Write or update tests** | ||||||
|
|
||||||
| ``` | ||||||
| > Write a pytest test for the randomize_emission_light function in | ||||||
| embodichain/lab/gym/envs/managers/randomization/visual.py. | ||||||
| ``` | ||||||
|
|
||||||
| **Understand a bug** | ||||||
|
|
||||||
| ``` | ||||||
| > I'm getting a KeyError in observation_manager.py at line 42 when env_ids is None. | ||||||
|
||||||
| > I'm getting a KeyError in observation_manager.py at line 42 when env_ids is None. | |
| > I'm getting a KeyError in observation_manager.py when env_ids is None. The traceback points into the observation lookup logic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The project-structure comment says
docs/source/contains “.md doc pages”, but the docs tree is a mix of.rstand.md(with MyST enabled). Adjusting this wording would better reflect the actual documentation setup.