With the acceleration of global aging and the rising incidence of stroke, the demand for lower limb rehabilitation has been steadily increasing. Traditional therapeutic methods can no longer meet the growing needs, which has led to the widespread application of robotic solutions to address labor shortages. In this context, this paper presents a hierarchical and distributed control system based on ROS 2 and Micro-ROS. The distributed architecture decouples functional modules, improving system maintainability and supporting modular upgrades. The control system consists of a three-layer structure, including a high-level controller, Jetson Nano, for gait data processing and advanced command generation; a middle-layer controller, ESP32-S3, for sensor data fusion and inter-layer communication bridging; and a low-level controller, STM32F405, for field-oriented control to drive the motors along a predefined trajectory. Experimental validation in both early and late rehabilitation stages demonstrates the system’s ability to achieve accurate trajectory tracking. In the early rehabilitation stage, the maximum root mean square error of the joint motors is 1.143°; in the later rehabilitation stage, the maximum root mean square error of the joint motors is 1.833°, confirming the robustness of the control system. Additionally, the hierarchical and distributed architecture ensures maintainability and facilitates future upgrades. This paper provides a feasible control scheme for the next generation of lower limb rehabilitation robots.