The invention discloses a
robot for automatically cleaning water surface garbage, which comprises the following steps: S1, collecting water surface garbage distribution and obstacle data by using an active optical detection technology and a
CMOS (Complementary
Metal Oxide Semiconductor) photosensitive device, and constructing a water surface environment
data model; s2, performing path planning based on an A * path planning
algorithm in combination with a GBFS
algorithm and a Dijkstra
algorithm, and generating a candidate path set; s3, optimizing a path by using a particle swarm
hybrid Poisson jump algorithm, and outputting an optimal path; s4, transmitting the optimal path to an STM32 single-
chip microcomputer, and controlling the
robot to move through a PWM motor driving module; s5, monitoring and adjusting a path in real time through an ultrasonic
obstacle avoidance system; s6, a
garbage collection device is started, garbage and oil
dirt are collected through a double-roller adsorption
system, and water is filtered; s7, detecting the storage amount based on a
pressure sensor, and triggering an automatic return path; and S8, the operation report is fed back through the remote monitoring module. Intelligent and automatic water surface garbage cleaning is achieved, and the cleaning efficiency and the environmental adaptability are effectively improved.