Skip to content

Conversation

@nepyope
Copy link
Collaborator

@nepyope nepyope commented Nov 21, 2025

-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

Copilot AI review requested due to automatic review settings November 21, 2025 10:07
Copy link
Contributor

Copilot AI left a 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.

Comment on lines 1 to 4
"""
Utility functions for working with Mujoco models.
copied from https://github.com/kevinzakka/mink/blob/main/mink/utils.py
"""
Copy link

Copilot AI Nov 21, 2025

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.

Copilot uses AI. Check for mistakes.

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
Copy link

Copilot AI Nov 21, 2025

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'.

Suggested change
# 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

Copilot uses AI. Check for mistakes.
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:
Copy link

Copilot AI Nov 21, 2025

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.

Copilot uses AI. Check for mistakes.

return np.concatenate([f, torque])

def MujuocoKeyCallback(self, key):
Copy link

Copilot AI Nov 21, 2025

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.

Suggested change
def MujuocoKeyCallback(self, key):
def MuJoCoKeyCallback(self, key):

Copilot uses AI. Check for mistakes.
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!"
Copy link

Copilot AI Nov 21, 2025

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.

Suggested change
# 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!"

Copilot uses AI. Check for mistakes.

def replay_main():

#damp needs to be on? do i start the robot as well
Copy link

Copilot AI Nov 21, 2025

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.

Suggested change
#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.

Copilot uses AI. Check for mistakes.
@nepyope nepyope force-pushed the feat/unitree_g1 branch 2 times, most recently from ee774b5 to 3e204cd Compare November 21, 2025 12:54
@jadechoghari jadechoghari added the robots Issues concerning robots HW interfaces label Nov 21, 2025
@imstevenpmwork imstevenpmwork marked this pull request as draft November 25, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

robots Issues concerning robots HW interfaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants