The invention relates to the technical field of vibratory hammers, in particular to a
pile driver with a self-righting function, which comprises a fixing frame, a shell, a first rotating shaft, a second rotating shaft, an adjusting
assembly, a
pendulum bob and a driving
assembly, the shell is slidably arranged on the fixing frame, the first rotating shaft and the second rotating shaft are rotatably arranged on the shell, and the second rotating shaft rotates around the first rotating shaft on the shell; the first rotating shaft and the second rotating shaft generate
resultant force perpendicular to the connecting line direction of the two rotating shafts during autorotation and drive the shell to slide on the fixing frame. The adjusting
assembly is used for driving the second rotating shaft to rotate around the first rotating shaft; the
pendulum bob is rotationally arranged on the fixing frame, and the
gravity center of the
pendulum bob is located below the rotating axis of the pendulum bob; the driving assembly is used for driving the shell to rotate when the
gravity center of the pendulum bob is located on the axis of the foundation
pile. The adjusting assembly is arranged to change the position of the second rotating shaft relative to the first rotating shaft, so that the direction of
resultant force generated by rotation of the first rotating shaft and the second rotating shaft is changed, and the inclined foundation
pile can be straightened.