-
Notifications
You must be signed in to change notification settings - Fork 5
Migrate EmbodiAgent #82
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR migrates EmbodiAgent, an LLM-based hierarchical agent system for autonomous robot manipulation. The system consists of three coordinated agents (TaskAgent, CodeAgent, ValidationAgent) that enable robots to perceive, plan, generate executable code, and validate task execution through closed-loop control.
Changes:
- Added agent system with hierarchy-based task decomposition and code generation
- Integrated LangChain dependencies (0.2.14, 0.1.22) and ZeroMQ for agent communication
- Implemented toolkit interfaces for robot action primitives (grasp, place, move, etc.)
- Added mesh processing utilities and online data generation engine
- Created new task environments for pour water and rearrangement with agent support
Reviewed changes
Copilot reviewed 74 out of 75 changed files in this pull request and generated 134 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Added langchain, langchain-openai, zmq, and pycocotools dependencies |
| embodichain/toolkits/interfaces.py | Atomic robot action functions and drive coordination |
| embodichain/toolkits/processor/ | Mesh processing components and entity management |
| embodichain/lab/gym/envs/tasks/tableware/ | New agent-enabled task environments |
| embodichain/lab/scripts/run_agent.py | Main script for agent-based task execution |
| embodichain/data/data_engine/ | Online data generation engine with ZeroMQ communication |
| embodichain/database/agent_prompt/ | Prompt templates and examples for LLM agents |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| self.remove_componenet(AxisAlignedBoundingBox) | ||
| if self.has_component(OrientedBoundingBox): | ||
| self.remove_componenet(OrientedBoundingBox) |
Copilot
AI
Jan 21, 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.
The method name "remove_componenet" contains a typo. It should be "remove_component" (missing the second 't'). This inconsistency may lead to confusion when the correct spelling "remove_component" is defined at line 143, creating two different method names for what appears to be the same operation.
| elif self.method == "svd": | ||
| is_success, mesh_o3dt = cad_standardlize_obb( | ||
| mesh_o3d, | ||
| is_use_mesh_clean=False, | ||
| is_cad_eliminate_symmetry=True, | ||
| symmetry_axis=self.symmetry_axis, | ||
| is_larger_positive=self.is_larger_positive, | ||
| ) |
Copilot
AI
Jan 21, 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 SVD case (line 151), the code calls "cad_standardlize_obb" instead of "cad_standardlize_svd". This appears to be a copy-paste error where both the "obb" and "svd" method options call the same function, making the method parameter ineffective. The SVD case should likely call a different function or this conditional block should be refactored.
| return ( | ||
| abs(spoon_y - spoon_place_target_y) <= tolerance | ||
| or abs(fork_y - fork_place_target_y) <= tolerance | ||
| ) |
Copilot
AI
Jan 21, 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.
The validation logic appears inverted. The condition "abs(spoon_y - spoon_place_target_y) <= tolerance or abs(fork_y - fork_place_target_y) <= tolerance" uses OR, meaning the task is considered successful if EITHER object is correctly placed. However, based on the task description, both objects should be correctly positioned for success. The condition should use AND instead of OR.
| # def reset(self, env_ids: Sequence[int] | None = None) -> None: | ||
| # r"""Resets the manager term. | ||
|
|
||
| # Args: | ||
| # env_ids: The environment ids. Defaults to None, in which case | ||
| # all environments are considered. | ||
| # """ | ||
| # pass |
Copilot
AI
Jan 21, 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 comment appears to contain commented-out code.
| # def process_actions(self, actions: torch.Tensor): | ||
| # r"""Processes the actions sent to the environment. | ||
|
|
||
| # Note: | ||
| # This function is called once per environment step by the manager. | ||
|
|
||
| # Args: | ||
| # actions: The actions to process. | ||
| # """ | ||
| # raise NotImplementedError |
Copilot
AI
Jan 21, 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 comment appears to contain commented-out code.
|
|
||
|
|
||
| @dataclass(eq=False) | ||
| class SpatializationComponenet(EntityComponent): |
Copilot
AI
Jan 21, 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.
| self.queue.remove(shm_name["name"]) | ||
| try: | ||
| shm = shared_memory.SharedMemory(shm_name["name"]) | ||
| except: |
Copilot
AI
Jan 21, 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.
Except block directly handles BaseException.
| rot_matrix = start_pose[:3, :3].T @ end_pose[:3, :3] | ||
| angle = rotation_matrix_to_angle(rot_matrix) | ||
| total_angle += angle | ||
| except Exception: |
Copilot
AI
Jan 21, 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.
'except' clause does nothing but pass and there is no explanatory comment.
| data = CompressedVideoHDF5(file_path, chunks=None).safe_filter( | ||
| data, step_id | ||
| ) | ||
| except Exception: |
Copilot
AI
Jan 21, 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.
'except' clause does nothing but pass and there is no explanatory comment.
| state_max = np.max(states, axis=0) | ||
| state_min = np.min(states, axis=0) | ||
| else: | ||
| state_max = np.maximum(state_max, np.max(states, axis=0)) |
Copilot
AI
Jan 21, 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 statement is unreachable.
| @@ -0,0 +1,5 @@ | |||
| # ---------------------------------------------------------------------------- | |||
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.
Use the correct license
| @@ -0,0 +1,5 @@ | |||
| # ---------------------------------------------------------------------------- | |||
| # Copyright (c) 2021-2025 DexForce Technology Co., Ltd. | |||
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.
Use lerobot format for now. And remove the hdf5 data recordor.
Description
This PR migrates EmbodiAgent, a LLM-based agent system for autonomous robot task execution in EmbodiChain. The system enables robots to perceive, plan, code, execute, and validate complex manipulation tasks through a closed-loop control cycle, which is developed by https://github.com/Jasonxu1225 .
Key Features
Three specialized agents working in coordination:
Key Related Files
embodichain/agents/hierarchy/embodichain/lab/gym/envs/tasks/tableware/embodichain/toolkits/interfaces.pyembodichain/lab/gym/motion_generation/embodichain/agents/README.mdType of change
Screenshots
Pour Water
pour_waterr.mp4
Rearrangement
rearrangement.mp4
Dual Arm Pour Water
pour_water_dual.mp4
Checklist
I have run the
black .command to format the code base.I have made corresponding changes to the documentation
I have added tests that prove my fix is effective or that my feature works
Dependencies have been updated, if applicable.