A control method for carpet drift in robot motion, wherein the robot begins to linearly move on a carpet surface from an initial position, coordinates sensed by the robot are required to be converted into a global coordinate system, and the control method comprises: S1, determining a preset direction in which the robot linearly moves on the carpet surface, wherein the preset direction is a positive direction of a preset coordinate axis of the global coordinate system, and recording an initial position coordinate and an initial moment of the robot simultaneously, and entering S2, characterized in that the control method further comprises: S2, performing, every a first preset time, fusion calculation on data sensed by an optical flow sensor and data sensed by code disks at the same time, to obtain a current position coordinate of the robot, which corresponds to an actual advancing distance of drive wheels of the robot, and entering S3; S3, calculating amount of drift, relative to a preset direction, of the robot, according to a relative position relationship between the current position coordinate and the initial position coordinate of the robot, then accumulating to obtain a drift statistical value, and entering S4, wherein the amount of drift refers to a vertical distance between a current position of the robot and a straight line where the preset direction lies in; S4, determining whether a difference between a current moment and the initial moment is greater than a second preset time or not, if yes, entering S5, otherwise, returning to S2; S5, based on a time interval of data sensing at the first preset time, calculating the number of acquisitions of position coordinates within the second preset time, and using the drift statistical value to average the number of acquisitions to obtain a drift average value as a amount of carpet drift, wherein a positive and a negative of the drift average value is related to a coordinate axis direction from which the robot deviates in the global coordinate system, and the drift average value determines a magnitude of a current motion direction of the robot deviates from the preset direction; after that, entering S6; and S6, according to a difference value corresponding to an absolute value of the drift average value, setting a corresponding PID proportionality coefficient to synchronously adjust a speeds of left drive wheel of the robot and a speed of right drive wheel of the robot, so that the robot is corrected from the current motion direction to the preset direction to continue to linearly move, wherein the amount of drift, the drift statistical value, and the number of acquisitions are all initialized to be zero at the initial moment; the first preset time refers to a time for each fusion calculation; the second preset time refers to a detection time to determine carpet drift occurred to the robot; and both the coordinates of the initial position and the current position of the robot are global coordinates. S2, performing, every a first preset time, fusion calculation on data sensed by an optical flow sensor and data sensed by code disks at the same time, to obtain a current position coordinate of the robot, which corresponds to an actual advancing distance of drive wheels of the robot, and entering S3; S3, calculating amount of drift, relative to a preset direction, of the robot, according to a relative position relationship between the current position coordinate and the initial position coordinate of the robot, then accumulating to obtain a drift statistical value, and entering S4, wherein the amount of drift refers to a vertical distance between a current position of the robot and a straight line where the preset direction lies in; S4, determining whether a difference between a current moment and the initial moment is greater than a second preset time or not, if yes, entering S5, otherwise, returning to S2; S5, based on a time interval of data sensing at the first preset time, calculating the number of acquisitions of position coordinates within the second preset time, and using the drift statistical value to average the number of acquisitions to obtain a drift average value as a amount of carpet drift, wherein a positive and a negative of the drift average value is related to a coordinate axis direction from which the robot deviates in the global coordinate system, and the drift average value determines a magnitude of a current motion direction of the robot deviates from the preset direction; after that, entering S6; and S6, according to a difference value corresponding to an absolute value of the drift average value, setting a corresponding PID proportionality coefficient to synchronously adjust a speeds of left drive wheel of the robot and a speed of right drive wheel of the robot, so that the robot is corrected from the current motion direction to the preset direction to continue to linearly move, wherein the amount of drift, the drift statistical value, and the number of acquisitions are all initialized to be zero at the initial moment; the first preset time refers to a time for each fusion calculation; the second preset time refers to a detection time to determine carpet drift occurred to the robot; and both the coordinates of the initial position and the current position of the robot are global coordinates.