$ show ccrpRepo/wbc_fsm
This repository implements a Whole-Body Control (WBS) deployment system for Unitree G1 humanoid robots. It uses a finite state machine (FSM) architecture with multiple control states including Passive, FixedStand, Loco (locomotion), AMP, MJAMP, and WBC (Whole-Body Control). The system processes real-time sensor data from the robot's IMU and joint encoders, runs inference on ONNX models to generate joint position commands, and accepts gamepad input to switch between control states. The application is designed for real-time operation with proper scheduling and safety considerations.
The LLM identified 3 files worth highlighting for reuse:
Provides robust mathematical utilities including quaternion operations, saturation functions, and coordinate transformations. Implements correct quaternion multiplication, inversion, and application functions that are essential for 3D robotics applications. The code is header-only, has minimal dependencies, and can be easily extracted for use in other robotics or graphics projects.
Implements a BinaryArrayReader for reading numpy-style binary files with metadata (shape, dtype). Handles endianness, data type verification, and shape extraction properly. This self-contained component solves the common problem of reading scientific binary data formats and could be reused in any project needing to parse similar binary files with minimal adaptation.
Provides a complete gamepad interface with button state tracking (press/release detection), input smoothing, and dead zone handling. Implements proper debouncing and state management for gamepad inputs. This component is decoupled from the robot-specific code and could be used in any application requiring gamepad input with minimal modification.