The invention relates to the technical field of smart home, and discloses a cleaning
robot control method and
system. The method comprises the steps of respectively carrying out the global position distance obtaining, local
obstacle avoidance information collection and self angle collection, building a
global coordinate system, obtaining the position information of each obstacle, carrying out thepreprocessing of obstacle data, and obtaining the position information of each obstacle; representing the indoor environment map through a grid method, matching and designing the sizes of sub grids, obtaining a global total path and splitting the global total path into a continuous grid
point set, establishing a local coordinate
system, obtaining local obstacle position information, controlling and adjusting the advancing direction of the
robot, and executing sequential traversal of the grid points according to the global total path. The cleaning
robot can be controlled to carry out full-coverage sweeping, obstacles can be found in real time, the
obstacle avoidance capacity is high, computing resources can be saved, the actual working interval can be traversed efficiently at low
energy consumption, collision-free and low-path-repetition-rate efficient sweeping is achieved, and high practical value and wide application prospects are achieved.