Cleaning method and device of underwater robot and readable storage medium
By obtaining the direction and distance information of the underwater robot on the wall, determining the target reference wall, and using this as the reference line for vertical cleaning, the problem of head bias caused by inertial navigation errors in the underwater robot is solved, and the cleaning effect is improved.
Patent Information
- Application Number
- CN202510227920.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-05-27
AI Technical Summary
When cleaning the pool bottom, the existing underwater cleaning robots gradually shift the head to one side due to the accumulated error of the inertial navigation module, and cannot maintain a fixed posture, which affects the cleaning effect.
By obtaining the direction information and distance information of the underwater robot when passing through the wall, determining whether it is within the preset direction deviation range and when the distance is greater than the threshold, determining the wall as the target reference wall, and using this as the reference line to control the robot to clean the vertical direction.
It effectively reduces the accumulated error of the inertial navigation module during positioning, so that the underwater robot can maintain a fixed posture for cleaning, thereby improving the cleaning effect.
Smart Images

Figure CN120038791A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent robots, and in particular, to a cleaning method, device and readable storage medium for an underwater robot. Background Art
[0002] A swimming pool is a venue for people to engage in swimming activities. During long-term use, some garbage or bacteria will appear in the pool, so the pool needs to be cleaned regularly. At present, the pool is usually cleaned by a cleaning robot. The cleaning robot includes an above-water cleaning robot and an underwater cleaning robot, which are respectively used to clean the surrounding environment of the pool, the bottom and the walls of the pool. Among them, the underwater cleaning robot moves on the bottom and walls of the pool by carrying a cleaning mechanism to achieve the cleaning of the bottom and walls of the pool.
[0003] The existing underwater cleaning robot uses an inertial navigation module for positioning during cleaning. The inertial navigation module measures the acceleration and angular velocity of an object through internal inertial sensors (such as accelerometers and gyroscopes), and then calculates the position and direction of the object. However, this calculation process is based on initial conditions and integral operations, so errors will gradually accumulate over time, resulting in the head of the robot gradually tilting to one side when cleaning the bottom of the pool. As a result, the robot cannot maintain a bow-shaped or figure-eight movement, greatly reducing the cleaning effect. Summary of the Invention
[0004] Embodiments of the present invention provide a cleaning method, device and readable storage medium for an underwater robot, so as to solve the problem that when the existing underwater robot cleans the bottom of the pool, the head of the underwater robot will gradually tilt to one side due to the cumulative error of positioning, so that the underwater robot cannot maintain a fixed posture for cleaning work, and thus the cleaning effect is greatly reduced.
[0005] A cleaning method for an underwater robot includes: Obtaining direction information for characterizing the attitude change of the underwater robot and distance information for characterizing the distance of the underwater robot passing through the current wall during the running period when the underwater robot passes through the current wall; Judging the wall passed by the underwater robot according to the distance information and the direction information. When the judgment result is that the direction information is within a preset direction deviation range and the distance information is greater than a preset distance threshold, determining the current wall passed by the underwater robot as the target reference wall; Taking the target reference wall as the reference line, controlling the underwater robot to perform cleaning work in the vertical direction of the reference line.
[0006] A cleaning device for an underwater robot includes: An acquisition module, configured to acquire direction information for characterizing the attitude change of the underwater robot and distance information for characterizing the distance of the underwater robot passing through the current wall during the operation period of the underwater robot passing through the current wall; A screening module, configured to judge the wall passed by the underwater robot according to the distance information and the direction information. When the judgment result is that the direction information is within a preset direction deviation range and the distance information is greater than a preset distance threshold, it is determined that the current wall passed by the underwater robot is the target reference wall; A correction module, configured to control the underwater robot to perform cleaning work in the vertical direction of the reference line with the target reference wall as the reference line.
[0007] An underwater robot, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the cleaning method of the underwater robot is implemented.
[0008] A computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the cleaning method of the underwater robot is implemented.
[0009] The above-mentioned cleaning method, device and readable storage medium of an underwater robot include acquiring direction information for characterizing the attitude change of the underwater robot and distance information for characterizing the distance of the underwater robot passing through the current wall during the operation period of the underwater robot passing through the current wall; judging the wall passed by the underwater robot according to the distance information and the direction information. When the judgment result is that the direction information is within a preset direction deviation range and the distance information is greater than a preset distance threshold, it is determined that the current wall passed by the underwater robot is the target reference wall; controlling the underwater robot to perform cleaning work in the vertical direction of the reference line with the target reference wall as the reference line.
[0010] The present invention determines the target reference wall by comparing the distance information with a preset distance threshold and the direction information with a preset direction deviation range. Taking this target reference wall as the reference line, the attitude of the current underwater robot is corrected. This correction can effectively reduce the cumulative error generated by the inertial navigation module during the positioning process. Thus, it solves the problem that when the existing underwater robot performs bottom cleaning in a pool, due to the positioning cumulative error, the head gradually deflects, and it is impossible to maintain a fixed attitude to perform the cleaning work, thereby affecting the cleaning effect. Description of the Drawings
[0011] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments of the present invention. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0012] Figure 1 is a schematic diagram of an application environment of a cleaning method for an underwater robot in an embodiment of the present invention; Figure 2 is a flowchart of a cleaning method for an underwater robot in an embodiment of the present invention; Figure 3 is a schematic diagram of the structure of an underwater robot in a cleaning method for an underwater robot in an embodiment of the present invention; Figure 4 is a schematic diagram of finding a long straight wall in a cleaning method for an underwater robot in an embodiment of the present invention; Figure 5 is a schematic diagram of longitudinal bottom cleaning of a pool in a cleaning method for an underwater robot in an embodiment of the present invention; Figure 6 is a schematic diagram of transverse bottom cleaning of a pool in a cleaning method for an underwater robot in an embodiment of the present invention; Figure 7 is a schematic diagram of a cleaning device for an underwater robot in an embodiment of the present invention; Figure 8 is a schematic diagram of a computer device in an embodiment of the present invention; In the figure: 1, inertial measurement unit; 2, ultrasonic ranging sensor; 3, ultrasonic wave; 4, wall. Detailed implementation manners
[0013] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0014] A cleaning method for an underwater robot provided by an embodiment of the present invention can be applied to an application environment as Figure 1 shown. Specifically, the cleaning method for the underwater robot is applied in a cleaning system for the underwater robot. The cleaning system for the underwater robot includes as Figure 1The client and server shown, where the client communicates with the server via a network, are used to solve the problem that when existing underwater robots clean at the bottom of a pool, due to the cumulative error in positioning, the orientation of the head of the underwater robot will gradually deviate to one side, resulting in the underwater robot being unable to maintain a fixed posture for cleaning work, and thus the cleaning effect is greatly reduced. Among them, the client, also known as the user side, refers to a program that provides local services for clients corresponding to the server. The client can be installed on, but not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented by an independent server or a server cluster composed of multiple servers.
[0015] In one embodiment, as Figure 2 shown, a cleaning method for an underwater robot is provided. Taking the server in Figure 1 as an example, the method includes the following steps: S01: Obtain the direction information used to characterize the attitude change of the underwater robot during the running period when the underwater robot passes the current wall, and the distance information used to characterize the distance that the underwater robot passes the current wall.
[0016] In this embodiment, the underwater robot is equipped with an ultrasonic ranging sensor 2 and an inertial measurement unit 1. The ultrasonic ranging sensor 2 accurately measures the distance between the underwater robot and the obstacle by emitting ultrasonic waves and receiving their reflected echoes. The inertial measurement unit 1 integrates a three-axis accelerometer, a gyroscope, and a magnetometer, and can measure the acceleration, angular velocity, and earth's magnetic field in real time, and calculate the position, speed, and attitude information of the robot based on this.
[0017] As Figure 3 shown, the ultrasonic ranging sensor 2 is installed around the shell of the underwater robot to accurately measure the distances to the pool boundary, walls, steps, and obstacles, so as to plan the optimal cleaning path. The inertial measurement unit (abbreviated as IMU) 1 is installed near the center of gravity of the robot body to ensure accurate capture and reflection of the overall motion state and attitude information.
[0018] In this embodiment, the direction information used to characterize the attitude change of the underwater robot is obtained through the inertial measurement unit 1. The direction information characterizing the attitude change of the underwater robot mainly includes the pitch angle, roll angle, and heading angle. The pitch angle refers to the angle by which an object rotates around its transverse axis (usually consistent with the front-rear direction of the object). In the up-and-down movement of the underwater robot, the pitch angle reflects the inclination of the robot's head or tail relative to the horizontal plane. The roll angle refers to the angle by which an object rotates around its longitudinal axis (usually consistent with the left-right direction of the object). In the left-right rolling of the underwater robot, the roll angle reflects the inclination of the left and right sides of the robot relative to the vertical plane. The heading angle refers to the angle by which an object rotates around its vertical axis (usually consistent with the up-down direction of the object). In the forward direction of the underwater robot, the heading angle reflects the degree of deflection of the robot's head or tail relative to a certain fixed direction (such as the due north direction).
[0019] In this implementation, a gyroscope is used to measure the angular velocity (i.e., the speed at which the robot rotates around each axis), and the attitude change of the robot can be calculated through integration. An accelerometer is used to measure the linear acceleration, which can be used to detect the direction of gravity, thereby assisting in determining the pitch angle and roll angle of the robot. A magnetometer is used to measure the Earth's magnetic field to determine the heading angle of the robot, especially in an underwater environment without other external references (such as GPS).
[0020] In this embodiment, the distance information used to characterize the underwater robot passing through the current wall is obtained through an odometer installed near the drive wheel. An odometer is a device installed on the underwater robot that can measure its travel distance. It mainly estimates the travel distance of an object by measuring the displacement of the moving parts and combining corresponding parameters (such as wheel diameter, encoder pulse count, etc.). Its basic principle is to use sensors to detect the motion state of the object and calculate the travel distance. Specifically as follows: First, the odometer measures the number of revolutions N of the wheel when the robot passes through the current wall through an encoder installed on the robot's wheel or motor.
[0021] Combined with the diameter of the underwater robot's wheel, calculate the distance traveled per revolution and multiply it by the number of revolutions N of the above wheel to obtain the distance information of the underwater robot passing through the current wall.
[0022] S02: According to the distance information and direction information, judge the wall passed by the underwater robot. When the judgment result is that the direction information is within the preset direction deviation range and the distance information is greater than the preset distance threshold, determine that the current wall passed by the underwater robot is the target reference wall.
[0023] In this embodiment, the judgment methods for the direction information and the preset direction deviation range mainly include the overall deviation judgment method and the local deviation judgment method. Among them, the steps of the local deviation judgment are as follows: Calculate the deviation between the current direction information of the underwater robot and the expected orientation of the target wall.
[0024] Judge whether the deviation is within the preset direction deviation range: Among them, is the current direction information of the underwater robot; is the expected orientation of the target wall; is the preset direction deviation range.
[0025] For example, the expected orientation of the target wall is 90 degrees (due east), the preset direction deviation range is ±10 degrees, and the current direction information of the robot is 95 degrees. Direction judgment: Then the direction condition is satisfied.
[0026] In this embodiment, the overall deviation judgment method is to obtain an overall direction deviation value by calculating the standard deviation (mean square deviation) of all direction information, and then compare it with the preset direction deviation range to obtain the judgment result.
[0027] In this embodiment, if the current distance information obtained in judgment step S01 exceeds the preset distance threshold, it is regarded as satisfying the distance condition. When both the direction condition and the distance condition are satisfied, the currently passed wall is determined as the target reference wall.
[0028] S03: Taking the target reference wall as the reference line, control the underwater robot to perform cleaning work in the vertical direction of the reference line.
[0029] Specifically, in this embodiment, the vertical direction of the reference line is calculated by rotating the direction of the target reference wall clockwise or counterclockwise by 90 degrees. The specific calculation formula is: Among them, the choice of +90° or -90° depends on the planned direction of the cleaning path.
[0030] In this embodiment, the steps of controlling the robot to move in the vertical direction include: 1) Obtain the current direction information of the robot through the inertial measurement unit (IMU) , and calculate the angle that needs to be adjusted: 2) Control the robot to rotate angle to control the robot to move linearly along the direction, and at the same time turn on the cleaning device (such as a brush or a sewage suction device). Among them, after the underwater robot finds the target reference wall, it needs to rotate by an angle, for example, turn left by 90 degrees. At the end of the rotation, due to inertia, the angle of the machine's self-rotation will be greater than 90 degrees. At this time, make the machine rotate in the reverse direction by a very small angle, and repeat this reverse and then reverse action several times. Because of the damping effect of water, finally make the orientation of the machine approach the target angle.
[0031] 3) Move a certain distance (such as the width of the pool) in a direction perpendicular to the wall, and then move in the reverse direction to form a reciprocating cleaning path. Each time it moves to the end of the path, adjust the position of the robot so that it maintains a fixed distance from the wall. Through multiple reciprocating movements, the entire cleaning area is covered. After each reciprocating movement, move a certain distance (such as the width of the cleaning device) in a direction parallel to the target reference wall to ensure that there are no missed areas.
[0032] In this embodiment, the underwater robot needs to maintain a certain distance from the right wall (left wall) at all times during the forward movement, and the distance from the wall is monitored in real time by the ultrasonic sensor on the right. When the distance becomes smaller, appropriately reduce the speed of the left wheel to make the robot gradually move away from the wall surface and increase the distance from the wall; when the distance becomes larger, then appropriately reduce the speed of the right wheel to make the robot gradually approach the wall surface and reduce the distance from the wall.
[0033] The cleaning method of the underwater robot in this embodiment determines the target reference wall by comparing the distance information with the preset distance threshold and the direction information with the preset direction deviation range. Taking this target reference wall as the reference line, the attitude of the current underwater robot is corrected. This correction can effectively reduce the cumulative error generated by the inertial navigation module during the positioning process. Thus, it solves the problem that when the existing underwater robot cleans the bottom of the pool, due to the positioning cumulative error, the head gradually deflects, and it cannot maintain a fixed attitude to perform the cleaning work, thereby affecting the cleaning effect.
[0034] In one embodiment, in the above step S02, that is, the specific steps of judging the wall passed by the underwater robot according to the distance information and direction information include: S201: If the distance information of the currently passed wall is greater than the preset distance threshold, then the currently passed wall is a long wall.
[0035] Specifically, as Figure 4 shown, during the process of the robot running along the current wall, the distance information of the currently passed wall will be compared with the preset distance threshold. If , it means that the currently passed wall is a long wall. Otherwise, the currently passed wall is not a long wall. is the distance information of the currently passed wall, is the preset distance threshold.
[0036] S202: If the direction information of the current wall is less than the preset direction deviation threshold, then the currently passed wall is a straight wall.
[0037] Specifically, as Figure 4 shown, during the process of the robot running along the current wall, the local deviation of the direction information of the currently passed wall will be calculated, and the local deviation of the current direction information will be compared with the preset direction deviation threshold. If the local deviations of the current direction information are all less than the preset direction deviation threshold, it indicates that the currently passed wall is a straight wall.
[0038] S203: If it is determined that the currently passed wall is both a long wall and a straight wall, then the currently passed wall is used as the target reference wall.
[0039] Specifically, according to the determination methods of the above steps S201 and S202, the length and direction information of the currently passed wall are judged. If the currently passed wall is both a long wall and a straight wall, then the currently passed wall is used as the target reference wall.
[0040] The distance threshold is less than the length of the longest wall and greater than the length of the second-longest wall; the second-longest wall refers to the wall whose length is less than the length of the longest wall and greater than the lengths of the remaining other walls; the remaining other walls refer to all walls except the longest wall and the second-longest wall.
[0041] In this embodiment, in order to screen out the longest wall among all the walls, a distance threshold needs to be set. This threshold should be less than the length of the longest wall and greater than the length of the second-longest wall to ensure that only the longest wall is screened out. Here, the second-longest wall refers to the wall that is second only to the longest wall in length but longer than all other walls; the remaining walls refer to all walls except the longest and second-longest walls.
[0042] The underwater robot cleaning method in this embodiment plans the optimal cleaning path by screening out the longest wall, thereby covering the entire cleaning area more efficiently and improving the cleaning effect.
[0043] In one embodiment, in the above step S203, the judgment method of the target reference wall further includes: S301: Obtain the direction information and distance information of the underwater robot during the running periods of all the walls.
[0044] In this embodiment, after the underwater robot enters the water, it will run around all the walls of the swimming pool. Using the same method as in step S01, obtain the direction information for characterizing the attitude change of the underwater robot during the running period when passing through all the walls, and the distance information for characterizing the distance of the underwater robot passing through the current wall.
[0045] S302: According to the distance information and the direction information, determine whether each wall is both a long wall and a straight wall.
[0046] In this embodiment, based on the direction and distance information of all the walls obtained in step S301, and combined with the determination criteria of long walls and straight walls defined in steps S201 and S202, analyze the distance information and direction information of each wall to determine whether it meets the conditions of both a long wall and a straight wall at the same time.
[0047] S303: If the number of walls that are both long walls and straight walls is greater than two, compare the distance information of the walls that are both long walls and straight walls.
[0048] In this embodiment, if the analysis result of step S302 shows that the number of walls that are both long walls and straight walls exceeds two, further screening is required to determine the optimal target reference wall.
[0049] S304: Select the wall with the longest distance information that is both a long wall and a straight wall as the target reference wall.
[0050] In this embodiment, the final target reference wall is determined by further screening the distance information. Specifically, first sort the distance information of the walls that are both long walls and straight walls from largest to smallest, and then select the wall with the longest distance as the final target reference wall.
[0051] In this embodiment, the cleaning method of the underwater robot can more accurately select the most suitable wall as the target reference by comprehensively analyzing the distance and direction information of the walls. This improvement not only improves the efficiency and accuracy of the cleaning task, but also enhances the autonomous navigation and decision-making ability of the robot.
[0052] In one embodiment, in step S202 above, that is, the step of determining that the current wall is a straight wall if the direction information of the current wall is less than the preset direction deviation threshold includes: S401: The direction information includes the yaw angle for characterizing the direction change of the underwater robot on the horizontal plane; according to the difference between each yaw angle of the underwater robot when passing through the current wall and the average value of all yaw angles, obtain the deviation of the yaw angle.
[0053] In this embodiment, the direction information refers to the yaw angle used to characterize the direction change of the underwater robot on the horizontal plane. By summing all the recorded yaw angle data and dividing by the total number of data, the average value of the yaw angle can be obtained, and this average value represents the average heading of the robot when passing by the wall. For each recorded yaw angle, calculate the difference between it and the average value of the yaw angle, and this difference is the yaw angle deviation at this point. The yaw angle deviation can be positive or negative, where a positive value indicates that the robot deviates to the right relative to the average heading, and a negative value indicates a deviation to the left.
[0054] S402: Obtain the squared difference of the yaw angle according to the square of the deviation of the yaw angle.
[0055] In this embodiment, for each calculated yaw angle deviation, square it. This step is to eliminate the influence of the positive and negative signs of the deviation and make large deviations statistically carry more weight. The squared value is the squared difference of the yaw angle.
[0056] S403: Obtain the overall deviation of the yaw angle of the current wall according to the square root of the average value of the squared differences of all the yaw angles.
[0057] In this embodiment, add up the squared differences of each yaw angle, and then divide by the total number of collected yaw angles to obtain the average value of the squared differences of all the yaw angles. This average value reflects the average level of the yaw angle deviation of the robot during the entire movement process. Finally, take the square root of the average value of the squared differences of all the yaw angles to obtain the overall deviation of the yaw angle of the current wall. This value is a scalar, representing the overall magnitude of the yaw angle deviation of the robot, and the unit is the same as that of the yaw angle. The specific calculation formula is as follows: Wherein, represents the i-th yaw angle, represents the average value of the yaw angles of n yaw angles, and n is the total number of samples of the yaw angle. is the overall deviation of the yaw angle.
[0058] S404: If the overall deviation of the yaw angle of the current wall is less than the preset direction deviation threshold, the current wall passed by is a straight wall.
[0059] In this embodiment, compare the calculated overall deviation of the yaw angle with the preset direction deviation threshold. If the deviation is less than the direction deviation threshold, it is considered that the current wall passed by is a straight wall; if the deviation is greater than or equal to the direction deviation threshold, it can be considered that the wall has a certain curvature or irregularity.
[0060] The cleaning method of the underwater robot in this embodiment judges whether the current passed wall is a straight wall by calculating the overall deviation of the yaw angle of the direction information and comparing it with a preset direction deviation threshold. Accurate judgment of the wall linearity helps the robot adopt a more appropriate cleaning path, thereby improving the cleaning efficiency. This method not only improves the automation degree and adaptability of the robot, but also helps to improve the cleaning efficiency and quality.
[0061] In one embodiment, in the above step S03, that is, the step of controlling the underwater robot to perform cleaning work in the vertical direction of the reference line with the target reference wall as the reference line includes: S501: Control the underwater robot to start from the reference line and perform cleaning work along the vertical direction of the reference line in a zigzag route.
[0062] In this embodiment, after the underwater robot finds the target reference wall, as Figure 5 shown, with the target reference wall as the reference line, starting from the reference line, the robot will move a certain distance in its vertical direction to start the first cleaning path. After reaching the predetermined cleaning distance, the robot will turn and move in the opposite direction to form the upper half of the zigzag. Then, the robot will turn again and move a certain distance along the direction parallel to the reference line to return to the vicinity of the reference line to form the lower half of the zigzag. Repeating this process, the robot will continuously advance along the reference line while covering the entire cleaning area in a zigzag route.
[0063] S502: When the underwater robot returns to the target reference wall each time, control the underwater robot to turn 180 degrees so that the tail of the underwater robot is tightly attached to the target reference wall vertically to correct the underwater robot.
[0064] In this embodiment, when the robot approaches the target reference wall, through its propulsion system or rotating mechanism, the robot will rotate 180 degrees around the vertical axis. The purpose of this step is to align the tail of the robot with the target reference wall to prepare for the subsequent tight attachment operation. After completing the 180-degree turn, the robot will adjust its attitude and position to ensure that the tail is closely attached to the target reference wall. This process can be achieved through mechanisms such as the propulsion system, attitude control system or robotic arm. Finally, through the tight attachment of the tail to the wall, the robot can maintain a vertical attitude with the target reference wall, thus completing the attitude correction.
[0065] In the cleaning method of the underwater robot in this embodiment, when the tail of the robot is closely attached to the target reference wall, its body naturally forms a perpendicular relationship with the target reference wall. This perpendicular relationship not only provides a stable support point for the robot but also helps to correct its attitude parameters such as heading and depth. Thus, the underwater robot can maintain a fixed attitude for cleaning work, thereby improving the cleaning effect of the underwater robot.
[0066] In one embodiment, the cleaning method of the underwater robot further includes: S601: After the underwater robot has completed all cleaning along the direction perpendicular to the target reference wall, control the underwater robot to move to the adjacent wall of the target reference wall, and make the underwater robot clean along the direction parallel to the target reference wall.
[0067] In this embodiment, after the robot has completed cleaning in the vertical direction, it needs to identify and locate the wall adjacent to the target reference wall. This process can be achieved through the robot's navigation system, sensor data, or preset map information. Specifically, after perceiving the environment, the robot uses algorithms (such as laser positioning or visual positioning) to determine its position path on the map. As Figure 6 shown, according to the optimal path, control the robot to move to the adjacent wall of the target reference wall. After successfully turning to the adjacent wall, the robot starts cleaning along the direction parallel to the target reference wall.
[0068] In the cleaning method of the underwater robot in this embodiment, by controlling the underwater robot to move to the adjacent wall of the target reference wall and making the underwater robot clean along the direction parallel to the target reference wall, it can ensure that all walls in the target area are fully processed, thereby further improving the cleaning effect of the underwater robot.
[0069] In one embodiment, in the above step S01, before obtaining the direction information and distance information during the running period of the underwater robot passing through the first wall, the steps of first reaching the wall closest to the underwater robot's launching position include: S701: Obtain the wall distances and orientation angles from the underwater robot's launching position to each surrounding wall.
[0070] In this embodiment, after the underwater robot is launched, it starts to rotate itself, and uses the front ultrasonic sensor 2 to record the wall distances from the launching position to each surrounding wall. At the same time, the inertial measurement unit 1 cooperates to record the wall orientation angles from the launching position to each surrounding wall, and stops after rotating 360 degrees.
[0071] S702: According to the wall distances, obtain the wall closest to the current position of the underwater robot.
[0072] In this embodiment, the distances from the obtained underwater position to each surrounding wall are sorted from smallest to largest to determine the wall closest to the current position of the underwater robot.
[0073] S703: Control the underwater robot to run towards the closest wall according to the orientation angle of the closest wall.
[0074] In this embodiment, the robot adjusts its rotation according to the orientation angle of the closest wall determined in step S702. After completing the angle adjustment, the robot will move forward in this direction.
[0075] S704: Determine that when the distance from the current position to the closest wall is within the preset anti-collision safety distance range, the underwater robot has reached the closest wall.
[0076] In this embodiment, when the distance data detected by the front ultrasonic sensor 2 enters the preset anti-collision safety range, it indicates that the robot is approaching the closest wall. At this time, the left wheel of the robot retreats and the right wheel advances, causing it to rotate counterclockwise. During this process, the robot will switch to the forward mode in a short time, so as to ensure that the right side is close to the wall while rotating.
[0077] In this embodiment, by finding the closest wall, the underwater robot can quickly determine its relative position in the underwater environment, thereby accelerating the progress of task execution. By controlling the distance between the robot and the wall within the preset anti-collision safety range, unnecessary collisions between the robot and the wall can be prevented. This method not only protects the robot itself from damage, but also ensures the safe execution of the task and the accuracy of data collection.
[0078] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The order of execution of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
[0079] In one embodiment, a cleaning device for an underwater robot is provided, and the cleaning device of the underwater robot corresponds one-to-one with the cleaning method of the underwater robot in the above embodiment. As Figure 7 shown, the cleaning device of the underwater robot includes an acquisition module 101, a screening module 102, and a calibration module 103. The detailed descriptions of each functional module are as follows: The acquisition module 101 is used to acquire the direction information for characterizing the attitude change of the underwater robot and the distance information for characterizing the underwater robot passing through the current wall during the running period of the underwater robot passing through the current wall.
[0080] The screening module 102 is configured to judge the walls passed by the underwater robot according to the distance information and the direction information. When the judgment result is that the direction information is within a preset direction deviation range and the distance information is greater than a preset distance threshold, it is determined that the current wall passed by the underwater robot is the target reference wall.
[0081] The calibration module 103 is configured to use the target reference wall as the reference line and control the underwater robot to perform the cleaning work in the vertical direction of the reference line.
[0082] Optionally, the above screening module includes: The long wall judgment sub-module is configured to determine that the currently passed wall is a long wall if the distance information of the currently passed wall is greater than a preset distance threshold.
[0083] The straight wall judgment sub-module is configured to determine that the currently passed wall is a straight wall if the direction information of the current wall is less than a preset direction deviation threshold.
[0084] The target reference wall judgment sub-module is configured to use the currently passed wall as the target reference wall if it is determined that the currently passed wall is both a long wall and a straight wall.
[0085] The condition sub-module is configured such that the distance threshold is less than the length of the longest wall and greater than the length of the second-longest wall; the second-longest wall refers to a wall whose length is less than the length of the longest wall and greater than the lengths of the remaining other walls; the remaining other walls refer to all walls other than the longest wall and the second-longest wall.
[0086] Optionally, the above target reference wall judgment sub-module includes: The acquisition unit is configured to acquire the direction information and the distance information of the underwater robot during the running period on all walls.
[0087] The judgment unit is configured to judge whether each wall is both a long wall and a straight wall according to the distance information and the direction information.
[0088] The condition judgment unit is configured to compare the distance information of the walls that are both long walls and straight walls if the number of walls that are both long walls and straight walls is greater than two.
[0089] The screening sub-unit is configured to select the wall with the longest distance information that is both a long wall and a straight wall as the target reference wall.
[0090] Optionally, the above straight wall judgment sub-module includes: The yaw angle unit is configured such that the direction information includes a yaw angle used to characterize the direction change of the underwater robot on the horizontal plane.
[0091] The course angle deviation calculation unit is used to obtain the deviation of the yaw angle according to the difference between each yaw angle of the underwater robot when passing through the current wall and the average value of all yaw angles.
[0092] The squared difference calculation unit of the yaw angle is used to obtain the squared difference of the yaw angle according to the square of the deviation of the yaw angle.
[0093] The overall deviation calculation unit is used to obtain the overall deviation of the yaw angle of the current wall according to the square root of the average value of the squared differences of all yaw angles.
[0094] The straight wall determination unit is used to determine that the currently passed wall is a straight wall if the overall deviation of the yaw angle of the current wall is less than a preset direction deviation threshold.
[0095] Optionally, the above correction module includes: The cleaning sub-module is used to control the underwater robot to start from the reference line and perform cleaning work along a zigzag route in the vertical direction of the reference line.
[0096] The correction sub-module is used to control the underwater robot to turn 180 degrees every time the underwater robot returns to the target reference wall, so that the tail of the underwater robot is tightly attached to the target reference wall vertically to correct the underwater robot.
[0097] Optionally, the above cleaning sub-module includes: The cleaning unit is used to control the underwater robot to run to the adjacent wall of the target reference wall after the underwater robot has completed all cleaning along the direction perpendicular to the target reference wall, so that the underwater robot performs cleaning along the direction parallel to the target reference wall.
[0098] Optionally, the above acquisition module includes: The nearest wall acquisition sub-module is used to acquire the wall distance and orientation angle from the underwater robot's launching position to each surrounding wall.
[0099] The nearest wall screening sub-module is used to obtain the wall closest to the current position of the underwater robot according to the wall distance.
[0100] The running sub-module is used to control the underwater robot to run towards the nearest wall according to the orientation angle of the nearest wall.
[0101] The nearest wall determination sub-module is used to determine that the underwater robot has reached the nearest wall when the distance from the current position to the nearest wall is within the preset anti-collision safety distance range.
[0102] For the specific limitations of the cleaning device of the underwater robot, reference can be made to the limitations of the cleaning method of the underwater robot in the foregoing text, which will not be elaborated herein. Each module in the cleaning device of the underwater robot described above can be implemented in whole or in part by software, hardware, and their combination. Each of the above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.
[0103] In one embodiment, Figure 8 is a schematic structural diagram of a computer device provided by the present invention. As Figure 8 shown, the computer device of this embodiment includes: at least one processor ( Figure 8 only one is shown in the figure), a memory, and a computer program stored in the memory and executable on at least one processor. When the processor executes the computer program, the steps in any of the above-described embodiments of the health prediction method are implemented.
[0104] The computer device may include, but is not limited to, a processor and a memory. Those skilled in the art can understand that Figure 8 merely examples of the computer device are given and do not constitute a limitation on the computer device. The computer device may include more or fewer components than those shown in the figure, or combine some components, or different components. For example, it may also include a network interface, a display screen, and an input device, etc.
[0105] The so-called processor may be a CPU, and the processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0106] The memory includes a readable storage medium, an internal memory, etc. Among them, the internal memory can be the memory of a computer device, and the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the readable storage medium. The readable storage medium can be the hard disk of a computer device, and in some other embodiments, it can also be an external storage device of the computer device. For example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. equipped on the computer device. Further, the memory can also include both the internal storage unit of the computer device and the external storage device. The memory is used to store the operating system, application programs, a BootLoader, data, and other programs, etc. The other programs such as the program code of a computer program, etc. The memory can also be used to temporarily store the data that has been output or will be output.
[0107] Those skilled in the art can clearly understand that, for the convenience and conciseness of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of the functional units and modules are only for the convenience of mutual distinction and do not limit the protection scope of the present invention. The specific working processes of the units and modules in the above-mentioned device can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above-mentioned method embodiments of the present invention, a computer program can be used to instruct the relevant hardware to complete. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can at least include: any entity or device capable of carrying the computer program code, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disc, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium cannot be an electrical carrier signal and a telecommunication signal.
[0108] All or part of the processes in the above-mentioned method embodiments of the present invention can also be completed by a computer program product. When the computer program product runs on a computer device, it enables the computer device to execute the steps in the above-mentioned method embodiments.
[0109] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0110] In one embodiment, a computer-readable storage medium is provided. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the cleaning method of the underwater robot in the above embodiment is implemented, for exampleFigure 2 As shown, to avoid repetition, it will not be elaborated here. Alternatively, when the computer program is executed by a processor, it realizes the functions of each module / unit in the above-described embodiment of the cleaning device of the underwater robot. For example Figure 7 the functions of the acquisition module, the screening module, and the calibration module shown, to avoid repetition, it will not be elaborated here.
[0111] Those of ordinary skill in the art can understand that all or part of the processes in the above-described method embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-described method embodiments. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or an external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0112] All or part of the processes in the above-described method embodiments of the present invention can also be completed by a computer program product. When the computer program product runs on a computer device, it causes the computer device to execute and realize the steps in the above-described method embodiments.
[0113] In the above embodiments, the descriptions of the various embodiments have their own emphases. For parts not elaborated or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0114] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0115] In the embodiments provided by the present invention, it should be understood that the disclosed device / computer device and method can be implemented in other ways. For example, the device / computer device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in electrical, mechanical or other forms.
[0116] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0117] The above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features. And these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A cleaning method for an underwater robot, characterized in that: include: Acquire direction information used to characterize the change of the underwater robot's posture during the operation period when the underwater robot passes the current wall, and obtain distance information used to characterize the underwater robot passing the current wall; According to the distance information and the direction information, the wall passed by the underwater robot is judged, and when the judgment result is that the direction information is within a preset direction deviation range and the distance information is greater than a preset distance threshold, the current wall passed by the underwater robot is determined to be a target reference wall; Taking the target reference wall as a reference line, the underwater robot is controlled to perform cleaning work in a direction perpendicular to the reference line.
2. The cleaning method of the underwater robot according to claim 1, characterized in that: The determining, based on the distance information and the direction information, of the wall passed by the underwater robot includes: If the distance information of the wall currently passed is greater than the preset distance threshold, the wall currently passed is a long wall; If the direction information of the current wall is less than the preset direction deviation threshold, the wall currently passed is a straight wall; If it is determined that the wall currently passed is both a long wall and a straight wall, the wall currently passed is used as the target reference wall; The distance threshold is less than the length of the longest wall and greater than the length of the second longest wall; the second longest wall refers to a wall whose length is less than the length of the longest wall and greater than the lengths of the remaining other walls; the remaining other walls refer to all walls except the longest wall and the second longest wall.
3. The cleaning method of the underwater robot according to claim 2, characterized in that: The method for determining the target reference wall also includes: Obtaining direction information and distance information of the underwater robot during the operation period of all walls; According to the distance information and the direction information, determining whether each wall is both a long wall and a straight wall; If the number of walls that are both long and straight is greater than two, compare the distance information of the long and straight walls; A wall with the longest distance information which is both a long wall and a straight wall is selected as the target reference wall.
4. The cleaning method of the underwater robot according to claim 2, characterized in that: If the direction information of the current wall is less than a preset direction deviation threshold, then the wall currently passed is a straight wall, including: The direction information includes a yaw angle used to characterize the change in direction of the underwater robot on a horizontal plane; Obtaining a deviation of the yaw angle according to a difference between each yaw angle of the underwater robot when passing through a current wall and an average value of all yaw angles; Obtaining a square difference of the yaw angle according to the square of the deviation of the yaw angle; Obtaining the overall deviation of the yaw angle of the current wall according to the square root of the average value of the square differences of all the yaw angles; If the overall deviation of the yaw angle of the current wall is less than a preset direction deviation threshold, the wall currently passed is a straight wall.
5. The cleaning method of an underwater robot according to claim 1, characterized in that: The method of taking the target reference wall as a reference line and controlling the underwater robot to perform cleaning work in a direction perpendicular to the reference line includes: Control the underwater robot to take the reference line as a starting point and perform cleaning work along a line in a figure-on-line in a vertical direction of the reference line; Each time the underwater robot returns to the target reference wall, the underwater robot is controlled to turn 180 degrees so that the tail of the underwater robot is vertically attached to the target reference wall, and the underwater robot is calibrated.
6. The cleaning method of the underwater robot according to claim 5, characterized in that: The cleaning method of the underwater robot also includes: When the underwater robot completes all cleaning along the direction perpendicular to the target reference wall, the underwater robot is controlled to move to an adjacent wall of the target reference wall, so that the underwater robot cleans along the direction parallel to the target reference wall.
7. The cleaning method of an underwater robot according to claim 1, characterized in that: Before obtaining the direction information and distance information of the underwater robot during the operation period when the underwater robot passes through the first wall, it is necessary to first reach the wall closest to the underwater robot's entry position, including: Obtaining the wall distance and orientation angle from the underwater robot's launching position to each surrounding wall; According to the wall distance, obtaining the wall closest to the current position of the underwater robot; According to the orientation angle of the nearest wall, controlling the underwater robot to move toward the nearest wall; When it is determined that the distance from the current position to the nearest wall is within a preset anti-collision safety distance range, the underwater robot has reached the nearest wall.
8. A cleaning device for an underwater robot, characterized in that: include: An acquisition module, used to acquire direction information used to characterize the change of the underwater robot's posture during the operation period when the underwater robot passes the current wall, and distance information used to characterize the underwater robot passing the current wall; A screening module, configured to judge the wall passed by the underwater robot according to the distance information and the direction information, and when the judgment result is that the direction information is within a preset direction deviation range and the distance information is greater than a preset distance threshold, determine that the current wall passed by the underwater robot is a target reference wall; The correction module is used to control the underwater robot to perform cleaning work in a direction perpendicular to the reference line with the target reference wall as the reference line.
9. An underwater robot comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the cleaning method of the underwater robot according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the cleaning method of the underwater robot according to any one of claims 1 to 7 is implemented.