-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Feat/unitree g1 #2497
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?
Feat/unitree g1 #2497
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 adds custom teleoperation capabilities, a Unitree G1 robot integration, ZMQ-based camera streaming, and a MuJoCo simulation environment for the Unitree G1 robot.
Key Changes:
- Standalone MuJoCo simulator with DDS communication via Unitree SDK2
- ZMQ-based camera image publishing system using shared memory
- Custom teleoperation and robot control utilities
- Calibration tools for robot arm joints
Reviewed Changes
Copilot reviewed 70 out of 421 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| mujoco_sim_g1/view_cameras.py | Camera recorder script that subscribes to ZMQ camera feeds and saves images |
| mujoco_sim_g1/sim/unitree_sdk2py_bridge.py | Bridge between Unitree SDK2 and MuJoCo simulator for robot communication |
| mujoco_sim_g1/sim/simulator_factory.py | Factory pattern implementation for creating MuJoCo/RoboCasa simulators |
| mujoco_sim_g1/sim/sim_utilts.py | Utility functions for MuJoCo model operations (body/geom queries) |
| mujoco_sim_g1/sim/sensor_utils.py | ZMQ server/client and image encoding utilities for camera streaming |
| mujoco_sim_g1/sim/metric_utils.py | Contact detection and height checking utilities for simulation |
| mujoco_sim_g1/sim/image_publish_utils.py | Multiprocessing image publisher using shared memory |
| mujoco_sim_g1/sim/base_sim.py | Core simulation environment with MuJoCo integration |
| mujoco_sim_g1/run_sim.py | Main simulator launcher with command-line interface |
| mujoco_sim_g1/requirements.txt | Python dependencies for simulator |
| mujoco_sim_g1/config.yaml | Robot configuration including PD gains and motor parameters |
| mujoco_sim_g1/assets/*.xml | MuJoCo robot model files for G1 |
| mujoco_sim_g1/README.md | Documentation for simulator setup and usage |
| get_calibration.py | Utility for collecting joint calibration data |
| eval_robot/utils/*.py | Utility functions for robot control and visualization |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mujoco_sim_g1/sim/sim_utilts.py
Outdated
| """ | ||
| Utility functions for working with Mujoco models. | ||
| copied from https://github.com/kevinzakka/mink/blob/main/mink/utils.py | ||
| """ |
Copilot
AI
Nov 21, 2025
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.
Corrected spelling of 'Mujoco' to 'MuJoCo' in comment.
|
|
||
| def __init__(self, config): | ||
| # Note that we do not give the mjdata and mjmodel to the UnitreeSdk2Bridge. | ||
| # It is unsafe and would be unflexible if we use a hand-plugged robot model |
Copilot
AI
Nov 21, 2025
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.
Corrected spelling of 'unflexible' to 'inflexible'.
| # It is unsafe and would be unflexible if we use a hand-plugged robot model | |
| # It is unsafe and would be inflexible if we use a hand-plugged robot model |
| left_hand_q = [self.left_hand_cmd.motor_cmd[i].q for i in range(self.num_hand_motor)] | ||
| with self.right_hand_cmd_lock: | ||
| right_hand_q = [self.right_hand_cmd.motor_cmd[i].q for i in range(self.num_hand_motor)] | ||
| with self.low_cmd_lock and self.left_hand_cmd_lock and self.right_hand_cmd_lock: |
Copilot
AI
Nov 21, 2025
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.
Context manager combining locks with and operator creates a boolean expression instead of acquiring multiple locks. Use nested with statements or contextlib.ExitStack to properly acquire multiple locks.
|
|
||
| return np.concatenate([f, torque]) | ||
|
|
||
| def MujuocoKeyCallback(self, key): |
Copilot
AI
Nov 21, 2025
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.
Corrected spelling of 'Mujuoco' to 'MuJoCo' in method name.
| def MujuocoKeyCallback(self, key): | |
| def MuJoCoKeyCallback(self, key): |
| def __init__(self, weights, data_size=14): | ||
| self._window_size = len(weights) | ||
| self._weights = np.array(weights) | ||
| # assert np.isclose(np.sum(self._weights), 1.0), "[WeightedMovingFilter] the sum of weights list must be 1.0!" |
Copilot
AI
Nov 21, 2025
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.
Commented-out assertion makes the weights constraint unclear. Either remove the commented code or enable the assertion if the constraint is required.
| # assert np.isclose(np.sum(self._weights), 1.0), "[WeightedMovingFilter] the sum of weights list must be 1.0!" | |
| assert np.isclose(np.sum(self._weights), 1.0), "[WeightedMovingFilter] the sum of weights list must be 1.0!" |
eval_robot/test.py
Outdated
|
|
||
| def replay_main(): | ||
|
|
||
| #damp needs to be on? do i start the robot as well |
Copilot
AI
Nov 21, 2025
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.
Incomplete comment with unclear meaning. Remove or clarify the comment to explain what needs to be configured.
| #damp needs to be on? do i start the robot as well | |
| # Ensure that the robot's damping mode is enabled and the robot is started before running this script. |
ee774b5 to
3e204cd
Compare
remove isaaclab, add test scripts added simulator to the hub remove mujoco env
dd382b7 to
58739f4
Compare
-unitree_g1 robot:
-zmq cameras:
-custom teleop:
at a high level, we're integrating
https://github.com/unitreerobotics/unitree_IL_lerobot
https://github.com/unitreerobotics/unitree_rl_gym (no training)
and
https://github.com/NVlabs/GR00T-WholeBodyControl
into lerobot