A MATLAB/Simulink-Based Sim2Real Control Framework for the Unitree G1 Using ROS 2 and MuJoCo
Leffer Trochez, Nicanor Quijano, Jorge Lopez-Jimenez, Carlos Francisco Rodriguez Herrera
AI summary
Problem
Humanoid robot control development is typically fragmented across disconnected tools for modeling, simulation, middleware, and deployment, which increases implementation effort, slows iteration, and complicates debugging during the simulation-to-reality transition.
Approach
The authors implement a modular Variant Subsystem in MATLAB/Simulink that seamlessly switches between a MuJoCo simulation backend and a ROS 2 real-robot backend while maintaining identical input/output interfaces.
Key results
- Unified MATLAB/Simulink environment integrating MuJoCo simulation and ROS 2 deployment
- Backend-switching architecture preserving interface compatibility across simulation and hardware
- Reusable research base with standardized signal buses, constraints, and communication files
- Validated Sim2Real transition demonstrated via a standard ankle-motion command task
Why it matters
Provides control researchers and roboticists with a structured, extensible foundation for rapid prototyping and debugging, significantly reducing the friction of deploying humanoid controllers from simulation to physical hardware.
Abstract
Humanoid robot control research requires develop- ment environments in which control strategies can be designed, organized, debugged, validated, and transferred to real hardware with minimal friction. In practice, however, this workflow is often fragmented across separate tools for dynamic modeling, sim- ulation, middleware communication, visualization, and deploy- ment. Such fragmentation increases implementation effort, slows down controller iteration, complicates closed-loop debugging, and makes it difficult to preserve a consistent architecture when transitioning from simulation to the real robot. This limitation is especially relevant for commercial humanoid platforms such as the Unitree G1, where practical research often requires combining multiple software layers and execution environments. This work presents a MATLAB/Simulink-based Sim2Real control framework for the Unitree G1 that integrates MuJoCo and ROS 2 into a unified and control-oriented workflow. The framework is organized around a modular Variant Subsystem that switches between a MuJoCo simulation backend and a ROS 2 real-robot backend while preserving compatible interfaces across both domains. This enables reuse of the same high-level control organization for simulation-based validation and hard- ware execution without redesigning the overall implementation structure. As a representative example, a standard ankle-motion command task was validated in simulation and executed on the real Unitree G1 through the same workflow. The resulting framework can be understood as a research-oriented integration layer that supports rapid prototyping, structured debugging, modular controller development, and future extensions toward estimation, stabilization, perception, and higher-level humanoid autonomy. I. MOTIVATION AND OBJECTIVE Humanoid robots are complex systems whose control devel- opment rarely takes place in a single environment. In many practical cases, controller logic is designed in one tool, tested in another, connected to middleware through separate scripts, and then adapted again for real-robot deployment. Although this fragmented process is common in robotics research, it introduces substantial friction. The most immediate conse- quences are duplicated implementation effort, poor traceability between simulation and hardware versions, and additional difficulty when debugging closed-loop behavior across the full system. This issue becomes particularly relevant for the Unitree G1, a platform with strong research potential but for which practical controller development still benefits from a clean and organized integration workflow. From a control-engineering perspective, researchers need more than a simulator or a com- munication interface in isolation. They need an environment in which controllers, signals, interfaces, and execution backends can be structured in a modular and reusable way. The main ob- jective of this work is therefore to provide a unified Sim2Real framework that reduces fragmentation and offers a clearer path from controller design to simulation-based validation and real-robot execution. Rather than proposing a new low-level control law, this work focuses on the integration layer needed to accelerate experimentation. In that sense, the contribution is architectural and methodological: the framework provides a reusable MATLAB/Simulink-based environment for imple- menting, testing, monitoring, and extending humanoid control strategies on the Unitree G1. II. FRAMEWORK PURPOSE AND ARCHITECTURE The purpose of the framework is to unify the principal stages of a control-oriented humanoid robotics workflow inside a single development environment. More specifically, it is intended to support: i) modular controller implementation in Simulink, ii) simulation-based validation using MuJoCo, iii) communication with the real Unitree G1 through ROS 2, iv) structured monitoring and debugging of relevant signals, and v) reuse of the same high-level organization across simulation and real-robot execution. These capabilities are especially valuable in robotics control because they reduce the amount of rework usually required when a controller moves from concept to experiment. The central architectural element is a Sim2Real Variant Sub- system implemented in MATLAB/Simulink. This subsystem switches between two execution backends: a MuJoCo-based simulation backend and a ROS 2-based real-robot backend. A key design decision is that both backends preserve compatible input/output interfaces, allowing the same high-level control logic, signal flow, and monitoring structure to be reused when moving from simulation to hardware. This reduces the need to reorganize or rewrite the controller when changing the execution layer. As summarized in Fig. 1, modeling in Simulink, validation in MuJoCo, and deployment through ICRA2026 Late Breaking Results Poster presented at 2026 IEEE International Conference on Robotics and Automation (ICRA 2026) June 1-5, 2026. Vienna, Austria