The invention provides a positioning method and equipment for a cleaning
robot. The method comprises the following steps of: calculating a relative angle value and a relative travel distance of a current moment relative to a previous moment according to data acquired from an
encoder; acquiring absolute direction and
magnetic field strength of the current moment from an electronic
compass; taking the absolute direction and the relative travel distance as positioning data if the
magnetic field strength is in a preset strength range; and taking the relative angle value and the relative travel distance as the positioning data if the
magnetic field strength is not in the preset strength range. In the positioning method for the cleaning
robot, the magnetic
field strength of the electronic
compass is acquired as confidence of the absolute direction of the current moment of the electronic
compass, so that accumulated error caused by positioning of the
encoder can be avoided to a certain extent, the influence of interference of an external magnetic field on the positioning data of the
robot can also be avoided, and the positioning accuracy is greatly improved at a lower hardware cost.