Disclosure of Invention
The invention aims to provide a floor sweeping robot control method and a floor sweeping robot, which can identify a wall body without a special control chip, and solve the technical problems of complex cleaning control mode and high cost based on wall body identification execution.
In order to solve the technical problems, the invention adopts the following technical scheme:
a control method of a sweeping robot is provided, which comprises the following steps: when an obstacle is detected in the initial traveling direction, controlling the sweeping robot to turn to a first direction, and triggering a distance sensor on the sweeping robot; the distance sensor is arranged on the side part of the sweeping robot; controlling the sweeping robot to travel along the obstacle based on a detection signal of the distance sensor; acquiring a traveling angle of the sweeping robot in real time in the traveling process of the sweeping robot along the obstacle, and identifying the obstacle as a wall if the traveling angle is not changed within a set time; and controlling the sweeping robot to execute sweeping control based on the identified wall.
Further, controlling the floor sweeping robot to execute the floor sweeping control based on the identified wall body specifically includes: controlling the sweeping robot to turn to the first direction again; controlling the sweeping robot to move straight, and controlling the sweeping robot to turn to a second direction after detecting the obstacle; the second direction is opposite to the first direction; after the sweeping robot is controlled to move straight for a set distance, the sweeping robot is controlled to turn to the second direction again and move straight; after the obstacle is detected, controlling the sweeping robot to turn to the first direction and move straight for the set distance, and then turning to the first direction again; and repeating the steps until the cleaning is finished.
Further, the method further comprises: if the traveling angle of the sweeping robot changes within the set time, recognizing that the obstacle is a non-wall body, controlling the sweeping robot to continue traveling, still acquiring the traveling angle of the sweeping robot in real time in the traveling process, and judging whether the traveling angle changes within the set time.
Further, the method further comprises: and when the sweeping robot is controlled to continue to move, if the obstacle is detected again, the sweeping robot is controlled to turn to the first direction, so that the distance sensor is triggered again.
A sweeping robot is proposed, comprising: the travel angle detection unit is used for acquiring a travel angle of the sweeping robot during travel; the obstacle detection unit is arranged at the front end of the sweeping robot and used for generating an obstacle detection signal when an obstacle is detected in the traveling direction of the sweeping robot; further comprising: the distance sensor is arranged on the side part of the sweeping robot; the distance sensor triggering unit is used for controlling the sweeping robot to turn to a first direction and triggering the distance sensor when the sweeping robot travels in the initial traveling direction and receives the obstacle signal; a travel control unit for controlling the sweeping robot to travel along the obstacle based on a detection signal of the distance sensor; the wall body identification unit is used for judging whether the travelling angle of the sweeping robot changes within set time or not based on the travelling angle output by the travelling angle detection unit, and identifying the obstacle as a wall body when the travelling angle does not change within the set time; and a cleaning control unit for controlling the cleaning robot to execute cleaning control based on the identified wall.
Further, the cleaning control unit is specifically configured to: after the sweeping robot is controlled to turn to the first direction again, the sweeping robot is controlled to move straight, and after an obstacle is detected, the sweeping robot is controlled to turn to the second direction; after the sweeping robot is controlled to move straight for a set distance, the sweeping robot is controlled to turn to the second direction again and move straight; after the obstacle is detected, controlling the sweeping robot to turn to the first direction and move straight for the set distance, and then turning to the first direction again; repeating the steps until the cleaning is finished; wherein the second direction is opposite to the first direction.
Further, the sweeping robot further comprises: and the non-wall body identification unit is used for identifying that the obstacle is a non-wall body if the travelling angle of the sweeping robot changes within the set time, controlling the sweeping robot to continue travelling, acquiring the travelling angle of the sweeping robot in real time in the travelling process, and judging whether the travelling angle changes.
Further, the non-wall identification unit is further configured to: and when the obstacle is recognized to be a non-wall body, controlling the sweeping robot to continue to travel, and if the obstacle is detected again, controlling the sweeping robot to turn to the first direction so as to trigger the distance sensor again.
Compared with the prior art, the invention has the advantages and positive effects that: according to the sweeping robot control method and the sweeping robot, when an obstacle is detected in the initial traveling direction of the sweeping robot, the sweeping robot is controlled to turn to the first direction at first, and the distance sensor arranged on the side of the sweeping robot is triggered; and then, controlling the sweeping robot to move along the obstacle according to a detection signal of the distance sensor, acquiring the moving angle information of the sweeping robot during the moving period, if the moving angle of the sweeping robot is not changed within a set time, indicating that the obstacle meets the wall body characteristics, identifying that the obstacle is the wall body, and further executing the sweeping control based on the identified wall body. In the wall body identification process, the obstacle detection and the advancing angle detection can be conveniently realized by utilizing the existing structure of the sweeping robot, the wall body identification can be realized by combining the detection result of the distance sensor and a corresponding control method, a special control chip is not required to be additionally configured, the realization mode is simple, the cost is low, and the technical problems of complex cleaning control mode and high cost based on the wall body identification execution are effectively solved.
Other features and advantages of the present invention will become more apparent from the detailed description of the embodiments of the present invention when taken in conjunction with the accompanying drawings.
Detailed Description
The following describes embodiments of the present invention in further detail with reference to the accompanying drawings.
The invention provides a sweeping robot control method, which aims to realize a wall body identification function of a sweeping robot under the condition of not increasing an additional control chip, so that the sweeping robot can execute sweeping control based on an identified wall body, for example, arch-shaped route sweeping control based on the identified wall body. Specifically, as shown in fig. 1, an embodiment of the control method of the sweeping robot provided by the present invention includes the following steps:
step S1: and when the obstacle is detected in the initial traveling direction, controlling the sweeping robot to turn to the first direction and triggering a distance sensor on the sweeping robot.
The sweeping robot in the embodiment of the invention is provided with an obstacle detection unit such as an infrared sensor and a collision sensor at the front end, and is used for detecting whether an obstacle exists in the advancing process and generating an obstacle detection signal when the obstacle is detected; a distance sensor is arranged on the side (left side or right side) of the sweeping robot, and the sweeping robot can be controlled to travel at a set distance from the obstacle based on the detection signal of the distance sensor; the inside of the body of the sweeping robot is also provided with an angle detection unit such as a gyroscope, an accelerometer and the like, and the angle detection unit is used for detecting the travelling angle of the sweeping robot in the travelling process.
The sweeping robot is started at the initial stage and runs according to an initial running direction, wherein the initial running direction can be a random direction or a set direction, for example, the direction of the front end of the sweeping robot perpendicular to a wall body; as shown in fig. 2, the initial traveling direction is marked as 1, if an obstacle a exists in the initial traveling direction, or the obstacle a is an indoor facility such as a desk or a floor air conditioner, or a wall, the obstacle detection unit at the front end of the sweeping robot is triggered to generate an obstacle detection signal, and after receiving the obstacle detection signal, the sweeping robot controls the sweeping robot to turn to a first direction, which is a direction of self-rotation of the sweeping robot and is left or right.
In fig. 2, the first direction is taken as the left side as an example, after the sweeping robot turns to the left side, the distance sensor arranged on the right side part of the sweeping robot detects a signal and is triggered.
When the first direction is the right direction, the distance sensor is arranged on the left side body of the sweeping robot, and when the first direction is the left direction, the distance sensor is arranged on the right side body of the sweeping robot; that is, if the coordinate system is established with the center of the sweeping robot as the origin, the obstacle detecting unit and the distance sensor are installed in the mutually perpendicular detecting directions, and when the sweeping robot is not steered in the first direction, the detecting direction of the distance sensor is exactly opposite to the first direction.
Step S2: and controlling the sweeping robot to travel along the obstacle based on the detection signal of the distance sensor.
After the distance sensor is triggered, the sweeping robot controls the sweeping robot to keep a set distance from the obstacle to travel based on the detection signal of the sweeping robot, namely, the sweeping robot starts to travel along the obstacle.
Step S3: the method comprises the steps of acquiring the traveling angle of the sweeping robot in real time in the traveling process of the sweeping robot along the obstacle.
The method comprises the following steps that in the process that the sweeping robot travels along an obstacle, a travel angle detection unit detects the travel angle of the sweeping robot in real time; if the obstacle is a wall body, the sweeping robot moves straight relative to the obstacle, and the moving angle of the sweeping robot cannot be changed. If the obstacle is a non-wall body, the traveling angle of the sweeping robot changes in the traveling process relative to the obstacle.
Step S4: judging whether the travel angle changes within a set time; and if the change does not occur, judging the barrier to be a wall body.
In some embodiments of the present invention, to eliminate the non-wall obstacle, a set time T is defined, for example, 2 seconds, and if the traveling angle of the sweeping robot is not changed within the set time, it is determined that the obstacle is a wall, and step S5 is executed.
Step S5: and controlling the sweeping robot to execute sweeping control based on the identified wall.
Through the steps, the wall body can be identified by utilizing the existing structure of the sweeping robot and combining the detection result of the distance sensor and the corresponding control method under the condition that the control chip is not configured, the implementation mode is simple, the cost is low, and the technical problems that the cleaning control mode based on the wall body identification execution is complex and the cost is high are solved.
In some embodiments of the present invention, if the obstacle is not a wall, for example, a chair, the sweeping robot detours along the obstacle, as shown in fig. 4, and during the detouring period, the traveling angle of the sweeping robot changes within the set time, it is determined that the obstacle is a non-wall body, as shown in fig. 7, step S6 is executed: and controlling the sweeping robot to continue to move.
Acquiring the travel angle of the sweeping robot in real time during the travel, and returning to the step S4: judging whether the travel angle changes within a set time; when the travel around the obstacle is finished, the robot can travel along the wall again or randomly after other obstacles are not detected; when the robot moves along the wall again, as shown in fig. 4, the robot determines that the wall is recognized until the condition that the moving angle is not changed within the set time is satisfied, and then the robot performs step S5 to control the floor sweeping robot to perform cleaning control based on the recognized wall.
In some embodiments of the present invention, if an obstacle is detected again during the control of the sweeping robot to continue traveling, as shown in fig. 8, step S7 is executed: and controlling the sweeping robot to turn to the first direction so as to trigger the distance sensor again, and starting to execute subsequent control from the step S2 until the wall is identified.
In some embodiments of the present invention, the cleaning control performed based on wall recognition is shown in FIG. 9 and includes the following controls:
step S21: and controlling the sweeping robot to turn to the first direction again.
After the sweeping robot recognizes the wall, the sweeping robot controls itself to turn to the first direction again, and then the left direction is taken as the first direction in the above embodiment, at this time, the sweeping robot is already perpendicular to the wall, as shown in fig. 3.
Step S22: and controlling the sweeping robot to move straight, and controlling the sweeping robot to turn to the second direction after detecting the obstacle.
The second direction is opposite to the first direction, and when the first direction is left-hand steering, the second direction is right-hand steering, and vice versa.
As shown in fig. 5, after the sweeping robot is perpendicular to the wall, the sweeping robot is controlled to move straight, and when the obstacle detection unit detects the obstacle again, the sweeping robot is controlled to turn to the second direction, that is, the right direction, as shown in fig. 5.
The detected obstacle, which is either the opposite wall or another obstacle, and is often the opposite wall, even if it is another obstacle, will not affect the sweeping robot in this embodiment to perform the arcuate cleaning, which will be described in the embodiment shown in fig. 6.
Step S23: and after the sweeping robot is controlled to move straight for a set distance, the sweeping robot is controlled to turn to the second direction again and move straight.
As shown in fig. 5, after the sweeping robot turns right, the sweeping robot is controlled to travel a set distance D in a straight line, that is, to travel a set distance D along a wall or other obstacles, where the set distance D is determined by a coverage area and a cleaning degree required for the sweeping in a zigzag manner, and may be 1/2 fuselage distances, 1 fuselage distance, and the like.
After the straight movement is carried out for the set distance D, the sweeping robot turns to the right again, and at the moment, the sweeping robot is perpendicular to the opposite wall body, so that a half bow-shaped sweeping period is realized.
And after the right-hand steering, controlling the steering to continue to move straight.
Step S24: and after the obstacle is detected, controlling the sweeping robot to turn to the first direction and move straight for a set distance, and then turning to the first direction again.
As shown in fig. 5, after the robot is straight again, when the obstacle is detected again, or the robot is a wall or other obstacle, the robot is controlled to turn left, and after the robot is straight for a set distance D, the robot is controlled to turn left again; at this point, a complete arcuate sweeping cycle is completed.
Next, steps S21 to S24 are repeated until the cleaning ends.
In the period of performing the arcuate cleaning after the wall search is completed, even if the detected obstacle is not the wall, as shown in fig. 6, when the obstacle is detected as another obstacle during the arcuate course, the arcuate cleaning is performed by defaulting the obstacle to the wall in steps S21 to S24.
Based on the proposed sweeping robot control method, the invention further provides a sweeping robot, as shown in fig. 10, the sweeping robot includes a traveling angle detection unit 1, an obstacle detection unit 2, a distance sensor 3, a distance sensor trigger unit 4, a traveling control unit 5, a wall body recognition unit 6 and a sweeping control unit 7.
The travel angle detection unit 1 is used for acquiring a travel angle of the sweeping robot during travel, such as a gyroscope, an acceleration sensor and the like; the obstacle detection unit 2 is installed at the front end of the sweeping robot and used for generating an obstacle detection signal when detecting an obstacle in the traveling direction of the sweeping robot, such as an infrared sensor, a laser radar, a camera and the like; the distance sensor 3 is arranged at the side part of the sweeping robot.
The distance sensor triggering unit 4 is used for controlling the sweeping robot to turn to the first direction and triggering the distance sensor 3 when the sweeping robot travels in the initial traveling direction and receives an obstacle signal; the traveling control unit 5 is used for controlling the sweeping robot to travel along the obstacle based on the detection signal of the distance sensor 3; the wall body identification unit 6 is used for judging whether the travel angle of the sweeping robot changes within the set time based on the travel angle output by the travel angle detection unit 1, and identifying the obstacle as a wall body when the travel angle does not change within the set time; the cleaning control unit 7 is configured to control the cleaning robot to perform cleaning control based on the identified wall.
In some embodiments of the present invention, the sweeping control unit 7 is specifically configured to: after the sweeping robot turns to the first direction again, the sweeping robot is controlled to go straight, and after the obstacle is detected, the sweeping robot is controlled to turn to the second direction; after the sweeping robot is controlled to move straight for a set distance, the sweeping robot is controlled to turn to the second direction again and move straight; after the obstacle is detected, the sweeping robot is controlled to turn to the first direction and move straight for a set distance, and then the sweeping robot is controlled to turn to the first direction again; repeating the steps until the cleaning is finished; wherein the second direction is opposite to the first direction.
In some embodiments of the present invention, the sweeping robot further includes a non-wall body recognition unit 8, configured to recognize that the obstacle is a non-wall body if the traveling angle of the sweeping robot changes within a set time, control the sweeping robot to continue traveling, and still obtain the traveling angle of the sweeping robot in real time during the traveling process, and determine whether the traveling angle changes.
In some embodiments of the invention, the non-wall identification unit 8 is further configured to: and when the obstacle is recognized to be a non-wall body, and the sweeping robot is controlled to continue to move, if the obstacle is detected again, the sweeping robot is controlled to turn to the first direction, so that the distance sensor is triggered again.
The control method of the cleaning robot for recognizing the wall and the control method of the cleaning robot for the zigzag shape after recognizing the wall are already described in detail in the control method, and are not repeated herein.
It should be noted that the above description is not intended to limit the present invention, and the present invention is not limited to the above examples, and those skilled in the art should also make changes, modifications, additions or substitutions within the spirit and scope of the present invention.