The invention discloses a roadway stacking machine with an adjustable machine body width and a control method of the roadway stacking machine. The roadway stacking machine comprises screw rod drive motors, screw rod sleeves, screw rods, lifting rods, lifting mechanisms, bases, rails, walking motors, a cargo tray and infrared distance sensors. The roadway stacking machine with the adjustable machine body width and the control method of the roadway stacking machine have the beneficial effects that the stacking machine with the adjustable machine body width can adapt to roadways with different widths, the expensive cost needed in purchasing different types of stacking machines due to different roadway widths is saved, the effective utilization rate of a warehousing plant is increased, the stacking machine body width is automatically completed by adjusting a PLC and the infrared distance sensors, the labor cost is saved, the work efficiency is improved, the machine body width can be reduced by adjusting the stacking machine body width, and the stacking machine body can enter a narrow roadway; and in addition, when the width of the roadway is larger than the machine body width, the machine body width can be properly enlarged through the stacking machine, and the cargo carrying capacity and safety are improved.