A method for determining whether a robot moves straightly on a sloping plane, comprising: step S1) defining a three-dimensional coordinate system on the robot, defining a moving direction of the robot as a positive Y-axis direction, defining a direction perpendicular to the sloping plane as a Z-axis direction, wherein a plane on which an X-axis and the Y-axis are located parallels the sloping plane; step S2) defining the moving direction of the robot as Tm, while standard sub vectors of gravity acceleration g along three directions of the three-dimensional coordinate system are defined as g xm0, g ym0, g zm0; step S3) generating a standard direction parameter library; step S4) driving the robot on the sloping plane to move straightly toward a moving direction Tm along a predetermined straight path; step S5) extracting data of the standard sub vectors g xm0, g ym0, g zm0 corresponding to the moving direction Tm from the standard direction parameter library; step S6) acquiring a set of real-time direction parameters from the standard direction parameter library in real-time at time intervals t, wherein the real-time direction parameters comprise real-time sub vectors g xm1, g ym1, g zm1 of the gravity acceleration g along three directions of the three-dimensional coordinate system; the method being characterized in that it comprises the steps of: step S7) calculating a sub vector difference g xd =g xm1 -g xm0 between the real-time sub vector g xm1 of the gravity acceleration g along the X-axis and the standard sub vector; and step S8) determining whether the robot moves along the predetermined straight path, wherein when g xd is equal to 0, it is determined that the robot moves along the predetermined straight path, and the method returns to step S6), and wherein when g xd is unequal to 0, it is determined that the robot deflects from the predetermined straight path; wherein the method is further characterized in that the step S3) generating a standard direction parameter library comprises: step S31) controlling the robot to implement uniform circular motion on the sloping plane along a predetermined circular path; step S32) acquiring and recording at least one set of standard direction parameters in real-time at time intervals t 0 during the circular motion of the robot, wherein each set of the standard direction parameters includes the moving direction Tm of the robot acquired by a magnetic sensor and standard sub vectors g xm0, g ym0, g zm0 corresponding to moving direction; and step S33) generating a standard direction parameter library according to the at least one set of the standard direction parameters. step S1) defining a three-dimensional coordinate system on the robot, defining a moving direction of the robot as a positive Y-axis direction, defining a direction perpendicular to the sloping plane as a Z-axis direction, wherein a plane on which an X-axis and the Y-axis are located parallels the sloping plane; step S2) defining the moving direction of the robot as Tm, while standard sub vectors of gravity acceleration g along three directions of the three-dimensional coordinate system are defined as g xm0, g ym0, g zm0; step S3) generating a standard direction parameter library; step S4) driving the robot on the sloping plane to move straightly toward a moving direction Tm along a predetermined straight path; step S5) extracting data of the standard sub vectors g xm0, g ym0, g zm0 corresponding to the moving direction Tm from the standard direction parameter library; step S6) acquiring a set of real-time direction parameters from the standard direction parameter library in real-time at time intervals t, wherein the real-time direction parameters comprise real-time sub vectors g xm1, g ym1, g zm1 of the gravity acceleration g along three directions of the three-dimensional coordinate system; step S7) calculating a sub vector difference g xd =g xm1 -g xm0 between the real-time sub vector g xm1 of the gravity acceleration g along the X-axis and the standard sub vector; and step S8) determining whether the robot moves along the predetermined straight path, wherein when g xd is equal to 0, it is determined that the robot moves along the predetermined straight path, and the method returns to step S6), and wherein when g xd is unequal to 0, it is determined that the robot deflects from the predetermined straight path; step S31) controlling the robot to implement uniform circular motion on the sloping plane along a predetermined circular path; step S32) acquiring and recording at least one set of standard direction parameters in real-time at time intervals t 0 during the circular motion of the robot, wherein each set of the standard direction parameters includes the moving direction Tm of the robot acquired by a magnetic sensor and standard sub vectors g xm0, g ym0, g zm0 corresponding to moving direction; and step S33) generating a standard direction parameter library according to the at least one set of the standard direction parameters.