The invention discloses a hydraulic-drive four-leg robot. The modular hydraulic-drive four-leg robot has the advantages that the hydraulic-drive four-leg robot is good in dynamic balance and high in topographical adaptability, loading capacity and cost performance, and is in a modular and bionic structural design, four leg shapes can be switched over by means of quickly assembling and disassembling subassemblies, the modular hydraulic-drive four-leg robot is multipurpose, and merits and shortcomings of various leg shapes are verified by experiments at a physical prototype stage; each single leg is provided with two leg sections, has three degrees of freedom and comprises a hip joint and thigh assembly, a knee joint and shank assembly and a side sway assembly; a side sway and connecting block combining form is adopted for each thigh portion according to a bionic principle, so that sufficient rigidity and strength are guaranteed, the hydraulic-drive four-leg robot can bear a load stably while the weight of the robot is reduced to the greatest extent, and sufficient activity space for hydraulic cylinders is guaranteed; shank portions comprise foot-end rubber pads and passive retractable bidirectional spring shock absorption mechanisms, and instant impact force generated when the robot is in contact with the ground can be effectively buffered and absorbed under multiple shock absorption actions; problems of limited service lives of components and vulnerability of electronic elements such as foot-end force sensors due to the fact that impact force disappears and springs are rebounded quickly when an existing robot leaves the ground can be solved by the aid of the bidirectional spring mechanisms.