Hardware-in-the-Loop / Software-in-the-Loop Simulation
硬件在环 / 软件在环仿真HIL / SILAdvancedConnecting a real controller or real control code to a simulated plant for testing — a standard validation step before deploying to a real robot.
These are two testing methods borrowed from automotive and aerospace embedded engineering. Software-in-the-loop (SIL): the control program runs directly on a computer and interfaces with a simulated robot and sensors. Hardware-in-the-loop (HIL): the control program runs on the actual controller board, connected through real I/O signals or a communication bus to a real-time simulated model, so the controller believes it's controlling the real machine. MathWorks places these alongside model-in-the-loop (MIL) and processor-in-the-loop (PIL) as a chain of tests that progressively approach the real hardware. The benefit is that dangerous conditions and edge cases can be tested repeatedly in simulation with no risk of damaging the real machine. A common robotics practice is to let the same control code connect to either simulation or the real robot by changing only the communication configuration, as with PX4 drones' SITL/HITL or Unitree's unitree_mujoco.
Exampleunitree_mujoco uses the same DDS communication as the real robot: a control program written with Unitree's SDK can be debugged in simulation using the local loopback network interface and domain ID 1, and switching to the network interface connected to the real robot with domain ID 0 drives the real robot directly.
- Also called
- HIL / SIL, HITL / SITL, Hardware-in-the-Loop Testing
- Related
- Sim-to-Real Transfer · Sim-to-Sim Transfer · Digital Twin · Real-Time Control · PX4 / ArduPilot · Unitree SDK2
- Sources
- MathWorks: What Is Hardware-in-the-Loop (HIL)?
PX4 User Guide: Simulation (SITL / HITL)
unitreerobotics/unitree_mujoco (GitHub)