Virtual obstacle avoidance methods, devices, electronic equipment, and readable storage media for robotic vacuum cleaners
By acquiring and converting obstacle coordinate information through sensors, calculating distance and angle, and triggering virtual collision or obstacle avoidance, the problem of slow response and insufficient smoothness of obstacle avoidance algorithm in traditional robot vacuums when encountering low obstacles is solved, and more efficient obstacle avoidance control is achieved.
Patent Information
- Application Number
- CN202411678232.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-11-20
AI Technical Summary
Traditional robotic vacuum cleaners are slow to react when encountering low obstacles, and existing obstacle avoidance algorithms have poor path following performance and lack smoothness.
The system acquires the first coordinate information of the obstacle in the map coordinate system through sensors, converts it into the second coordinate information in the robot vacuum's coordinate system, calculates the distance and angle between the obstacle and the origin of the robot vacuum's coordinate system, sets the detection radius and angle range, and triggers virtual collision or obstacle avoidance.
It improves the obstacle avoidance smoothness and control of the robot vacuum cleaner, reduces collisions with obstacles, and optimizes the cleaning path.
Smart Images

Figure CN119575967B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of virtual obstacle avoidance control, and more particularly to a virtual obstacle avoidance method, device, electronic device, and readable storage medium for a sweeping robot. Background Technology
[0002] Traditional robotic vacuum cleaners primarily rely on front collision sensors for mechanical obstacle avoidance, reacting only after a collision with low obstacles during cleaning. Increasingly, robotic vacuum cleaners are incorporating infrared, line laser, and area laser sensors to identify obstacles, then using obstacle avoidance algorithms for collision-free cleaning. Mainstream obstacle avoidance methods include virtual path following; however, because path following is path-dependent, its following effect and smoothness are not ideal. Summary of the Invention
[0003] To address the aforementioned technical problems, embodiments of this application provide a virtual obstacle avoidance method, apparatus, electronic device, and readable storage medium for a sweeping robot.
[0004] In a first aspect, embodiments of this application provide a virtual obstacle avoidance method for a robotic vacuum cleaner, the method comprising:
[0005] The sensors acquire the first coordinate information of each obstacle in the map coordinate system;
[0006] The first coordinate information of each obstacle is converted into the second coordinate information of the sweeper coordinate system;
[0007] Calculate the distance between the second coordinate information of each obstacle and the origin of the sweeper's coordinate system, as well as the angle of the obstacle;
[0008] Determine whether the distance is less than or equal to the first detection radius. If the distance is less than or equal to the first detection radius, determine whether the angle of the obstacle is within the first angle range. If the angle of the obstacle is within the first angle range, trigger a virtual collision.
[0009] If no virtual collision is triggered, it is determined whether the distance is greater than or equal to the second detection radius. If the distance is greater than or equal to the second detection radius, it is determined whether the angle of the obstacle is within the second angle range. If the angle of the obstacle is within the second angle range, virtual obstacle avoidance is triggered.
[0010] In one embodiment, the method further includes: if the distance is greater than the first detection radius and the distance is less than the second detection radius, then the sweeper operates at normal speed;
[0011] If the distance is greater than the first detection radius and the angle of the obstacle is not within the second angle range, the sweeper will operate at normal speed.
[0012] If the angle of the obstacle is not within the first angle range and the distance is less than the second detection radius, the sweeper will operate at normal speed.
[0013] If the angle of the obstacle is not in the first angle range and the angle of the obstacle is not in the second angle range, the sweeper will operate at normal speed.
[0014] In one embodiment, converting the first coordinate information of each obstacle into second coordinate information of the sweeper coordinate system includes:
[0015] The first coordinate information of each obstacle is organized into an accessible array;
[0016] The first coordinate information of each obstacle is obtained by polling from the accessible array, and the first coordinate information of each obstacle is converted into second coordinate information according to the robot vacuum coordinate system.
[0017] In one embodiment, before converting the first coordinate information of each obstacle into second coordinate information of the sweeper coordinate system, the method further includes:
[0018] Confirm the center of the sweeper;
[0019] A coordinate system for the sweeper is established with the center of the sweeper as the origin, the X-axis pointing to the right, and the Y-axis pointing upwards.
[0020] In one embodiment, triggering the virtual collision includes:
[0021] Control the sweeper to stop moving;
[0022] Based on the second coordinate information of the obstacle and the direction of movement of the sweeper, calculate the rotation direction and rotation angle;
[0023] The sweeper moves according to the rotation direction and the rotation angle.
[0024] In one embodiment, triggering virtual obstacle avoidance includes:
[0025] Obtain the initial speeds of the left and right wheels of the sweeper;
[0026] Calculate the output value of the PID controller based on the distance, turning speed, and desired obstacle avoidance path;
[0027] If the obstacle is on the right side of the sweeper, then the left wheel is determined to be the initial speed minus the output value of the PID controller, and the right wheel is determined to be the initial speed plus the output value of the PID controller;
[0028] If the obstacle is on the left side of the sweeper, then the left wheel is determined to be the initial speed plus the output value of the PID controller, and the right wheel is determined to be the initial speed minus the output value of the PID controller.
[0029] In one embodiment, acquiring the first coordinate information of each obstacle in the map coordinate system via a sensor includes:
[0030] The first coordinate information of obstacles within a fixed distance in front of the sweeper is obtained by the forward obstacle avoidance sensor;
[0031] The first coordinate information of obstacles within a fixed distance to the side of the sweeper is obtained by the lateral obstacle avoidance sensor;
[0032] The first coordinate information of obstacles within a fixed distance above the sweeping machine is obtained by using lidar.
[0033] Secondly, embodiments of this application provide a virtual obstacle avoidance device for a sweeping robot, the virtual obstacle avoidance device for the sweeping robot comprising:
[0034] The acquisition module is used to acquire the first coordinate information of each obstacle in the map coordinate system through sensors;
[0035] The conversion module is used to convert the first coordinate information of each obstacle into the second coordinate information of the sweeper coordinate system;
[0036] The calculation module is used to calculate the distance between the second coordinate information of each obstacle and the origin of the sweeper's coordinate system, as well as the angle of the obstacle;
[0037] The judgment module is used to determine whether the distance is less than or equal to a first detection radius. If the distance is less than or equal to the first detection radius, it determines whether the angle of the obstacle is within a first angle range. If the angle of the obstacle is within the first angle range, it triggers a virtual collision. If no virtual collision is triggered, it determines whether the distance is greater than or equal to a second detection radius. If the distance is greater than or equal to the second detection radius, it determines whether the angle of the obstacle is within a second angle range. If the angle of the obstacle is within the second angle range, it triggers a virtual obstacle avoidance.
[0038] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the computer program executes the virtual obstacle avoidance method for a sweeping robot provided in the first aspect when the processor is running.
[0039] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a processor, executes the virtual obstacle avoidance method for a sweeping robot provided in the first aspect.
[0040] The virtual obstacle avoidance method for a robotic vacuum cleaner provided in this application obtains the first coordinate information of each obstacle in a map coordinate system through sensors; converts the first coordinate information of each obstacle into second coordinate information in the robotic vacuum cleaner coordinate system; calculates the distance between the second coordinate information of each obstacle and the origin of the robotic vacuum cleaner coordinate system, as well as the angle of the obstacle; determines whether the distance is less than or equal to a first detection radius; if the distance is less than or equal to the first detection radius, determines whether the angle of the obstacle is within a first angle range; if the angle of the obstacle is within the first angle range, triggers a virtual collision; if no virtual collision is triggered, determines whether the distance is greater than or equal to a second detection radius; if the distance is greater than or equal to the second detection radius, determines whether the angle of the obstacle is within a second angle range; if the angle of the obstacle is within the second angle range, triggers virtual obstacle avoidance. This application improves the smooth control effect of the robotic vacuum cleaner by calculating the distance between the obstacle and the origin of the robotic vacuum cleaner coordinate system and setting different detection radii and angle ranges to select virtual collision or virtual obstacle avoidance as the obstacle avoidance method. Attached Figure Description
[0041] To more clearly illustrate the technical solutions of this application, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of this application and should not be considered as a limitation on the scope of protection of this application. In the various drawings, similar components are numbered similarly.
[0042] Figure 1 A flowchart illustrating a virtual obstacle avoidance method for a sweeping robot provided in an embodiment of this application is shown.
[0043] Figure 2 A schematic diagram showing the robot vacuum sensor and its location provided in an embodiment of this application is illustrated.
[0044] Figure 3 This illustration shows a schematic diagram of an obstacle and its first coordinate information provided in an embodiment of this application.
[0045] Figure 4 This paper shows another schematic flowchart of the virtual obstacle avoidance method for a sweeping robot provided in an embodiment of this application;
[0046] Figure 5 A schematic diagram of the virtual obstacle avoidance range and virtual collision range provided in the embodiments of this application is shown;
[0047] Figure 6 A schematic diagram showing the rotation angle of a sweeper under virtual collision provided in an embodiment of this application is shown;
[0048] Figure 7This illustration shows another flowchart of the virtual obstacle avoidance method for a sweeping robot provided in an embodiment of this application;
[0049] Figure 8 This invention illustrates a schematic diagram of the speed control of the left and right wheels of a sweeper provided in an embodiment of this application.
[0050] Figure 9 A schematic diagram of the virtual obstacle avoidance device for a sweeping machine provided in an embodiment of this application is shown.
[0051] Icons: 900 - Virtual obstacle avoidance device for robot vacuum cleaner, 901 - Acquisition module, 902 - Conversion module, 903 - Calculation module, 904 - Judgment module. Detailed Implementation
[0052] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.
[0053] The components of the embodiments of this application described and illustrated in the accompanying drawings can be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of this application provided in the drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0054] In the following, the terms “comprising,” “having,” and their cognates, which may be used in various embodiments of this application, are intended only to indicate a particular feature, number, step, operation, element, component, or combination thereof, and should not be construed as excluding, firstly, the presence of one or more other features, numbers, steps, operations, elements, components, or combinations thereof, or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations thereof.
[0055] Furthermore, the terms "first," "second," and "third" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.
[0056] Unless otherwise specified, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments of this application pertain. Terms (such as those defined in commonly used dictionaries) shall be interpreted as having the same meaning as in their contextual meaning in the relevant technical field and shall not be construed as having an idealized or overly formal meaning, unless clearly defined in the various embodiments of this application.
[0057] Example 1
[0058] This application provides a virtual obstacle avoidance method for a robot vacuum cleaner.
[0059] See Figure 1 The virtual obstacle avoidance method for robot vacuum cleaners includes steps S101-S105:
[0060] S101: Obtain the first coordinate information of each obstacle in the map coordinate system through the sensor.
[0061] In this embodiment, the map coordinate system is a fixed global coordinate system used to mark the position coordinates of all fixed obstacles on the map. In this map coordinate system, the positions of the obstacles remain constant, facilitating global path planning and navigation for the robot vacuum. See also... Figure 2 The robot vacuum is equipped with multiple sensors that detect obstacles in different directions, including forward obstacle avoidance sensors, lateral obstacle avoidance sensors, and LiDAR. The robot vacuum system periodically triggers a task to acquire information about obstacles within a preset distance. Based on real-time requirements, such as setting it to trigger 30 times per second, each trigger acquires and updates the position information of surrounding obstacles and stores this information in an accessible array. This array is then used for subsequent path planning and obstacle avoidance strategies.
[0062] For example, see Figure 3 For the sensor to detect and mark each obstacle, and the first coordinate information of the obstacle obtained by the sensor is (X, Y), the obstacle that is more than a certain threshold (e.g., 50cm) away from the sweeper is filtered out to reduce unnecessary calculation. The first coordinate information of all obstacles that meet the conditions is stored in an array, with the array format [(X1,Y1),(X2,Y2),...,(XN,YN)].
[0063] In one embodiment, S101 includes: acquiring first coordinate information of obstacles within a fixed distance in front of the sweeper using a forward obstacle avoidance sensor; acquiring first coordinate information of obstacles within a fixed distance to the side of the sweeper using a lateral obstacle avoidance sensor; and acquiring first coordinate information of obstacles within a fixed distance above the sweeper using a lidar.
[0064] In this embodiment, obstacles within a certain angle range in front of the sweeper are acquired by a forward obstacle avoidance sensor; obstacles within a certain angle range to the side of the sweeper are acquired by a lateral obstacle avoidance sensor; and the lidar calculates the distance by emitting a laser beam and measuring the time it takes for it to reflect back, thereby acquiring the two-dimensional coordinate information of obstacles within a fixed height above the sweeper.
[0065] S102: Convert the first coordinate information of each obstacle into the second coordinate information of the sweeper coordinate system.
[0066] In this embodiment, the map coordinate system provides a unified and standardized way to determine obstacle information. In the map coordinate system, each obstacle has a unique two-dimensional coordinate (X, Y). However, robotic vacuum cleaners usually cannot directly use map coordinates (first coordinate information) to calculate the distance to obstacles. Therefore, it is necessary to transform the obstacle coordinates in the map coordinate system to the robotic vacuum cleaner's own coordinate system. The coordinates in the robotic vacuum cleaner's coordinate system (second coordinate information) directly reflect the position of the obstacle currently facing the robotic vacuum cleaner, making it easier to calculate the distance and direction between it and the obstacle, thereby formulating a more accurate and efficient obstacle avoidance strategy.
[0067] See Figure 4 In one embodiment, S102 includes S1021-S1022:
[0068] S1021: The first coordinate information of each obstacle is arranged into an accessible array.
[0069] In this embodiment, after obtaining the first coordinate information of the obstacle in the map coordinate system, the first coordinate information is stored in an accessible array in the format [(X1,Y1),(X2,Y2),...,(XN,YN)].
[0070] S1022: Poll from the accessible array to obtain the first coordinate information of each obstacle, and convert the first coordinate information of each obstacle into second coordinate information according to the robot vacuum coordinate system.
[0071] In this embodiment, as the robot vacuum moves, its coordinate system also moves and rotates. Since the robot vacuum's coordinate system is a dynamic coordinate system, when converting the first coordinates of each obstacle to the second coordinates, it is necessary to determine the robot vacuum's current position information in the map coordinate system, i.e., the coordinates (Xx, Yx) of the robot vacuum's center. In addition to the position information, it is also necessary to determine the robot vacuum's current orientation, i.e., the rotation angle of the robot vacuum's coordinate system relative to the map coordinate system. Based on the robot vacuum's position and orientation information, a coordinate transformation formula is applied to convert the map coordinates (Xi, Yi) of each obstacle obtained from the accessed array to the coordinates (Xis, Yis) in the robot vacuum's coordinate system.
[0072] Specifically, the first coordinate information (Xi, Yi) of the obstacle is subtracted from the position coordinates (Xx, Yx) of the sweeper to obtain the offset relative to the position of the sweeper. Based on the orientation angle of the sweeper, the offset is rotated to obtain the second coordinate information (Xis, Yis) in the sweeper coordinate system, that is, transformed from [(X1,Y1),(X2,Y2),...,(XN,YN)] to [(X1s,Y1s),(X2s,Y2s),...,(XNs,YNs)].
[0073] In one embodiment, before converting the first coordinate information of each obstacle into second coordinate information according to the sweeper coordinate system, the method further includes: confirming the center of the sweeper; establishing the sweeper coordinate system with the center of the sweeper as the origin, the X-axis to the right, and the Y-axis upward.
[0074] In this embodiment, the robot vacuum cleaner body is generally a circular area with a certain radius. The geometric center of the robot vacuum cleaner is determined by design parameters. A coordinate system for the robot vacuum cleaner is established with the geometric center of the robot vacuum cleaner as the origin, extending to the right as the X-axis and upward as the Y-axis. Optionally, the construction of the robot vacuum cleaner coordinate system also includes establishing a coordinate system with the geometric center of the robot vacuum cleaner as the origin, extending to the left as the X-axis and upward as the Y-axis. By constructing the robot vacuum cleaner coordinate system, the robot vacuum cleaner can more easily determine how to avoid obstacles and how to plan the most efficient cleaning path based on its own position and orientation.
[0075] S103: Calculate the distance between the second coordinate information of each obstacle and the origin of the sweeper's coordinate system, as well as the angle of the obstacle.
[0076] In this embodiment, the distance between the second coordinate information of each obstacle and the origin of the sweeper's coordinate system is calculated according to formula (1): Where L is the distance, (X ks Y ks ) represents the second coordinate information of each obstacle, and the origin of the sweeper's coordinate system is (0,0).
[0077] Optionally, the angle of each obstacle can be calculated based on the second coordinate information of each obstacle according to formula (2): θ = tan -1 2(Y ks ,X ks ); where θ is the angle of each of the obstacles, (X ks Y ks ) represents the second coordinate information of each obstacle.
[0078] S104: Determine whether the distance is less than or equal to the first detection radius. If the distance is less than or equal to the first detection radius, determine whether the angle of the obstacle is within the first angle range. If the angle of the obstacle is within the first angle range, trigger a virtual collision.
[0079] In this embodiment, see Figure 5 This is a schematic diagram of the virtual obstacle avoidance range and the virtual collision range. The virtual collision range is the range from right to left within an angle B (i.e., the first angle interval) starting from the right side of the sweeper. The virtual obstacle avoidance range is the range from left to right within an angle A (i.e., the second angle interval) in front of the sweeper. The coordinates (Xk, Yk) of each obstacle are retrieved from the accessible array in a loop. The first information coordinates are transformed into the sweeper coordinate system with the center of the sweeper as the origin to obtain the second coordinate information (Xks, Yks). The distance from the obstacle to the center of the sweeper is calculated using formula (1). If the distance is less than or equal to the first detection radius of the virtual collision, the angle of the obstacle is calculated according to formula (2). It is determined whether the angle of the obstacle is within the first angle interval. If the angle of the obstacle is within the first angle interval, a virtual collision is triggered. It should be noted that the first detection radius and the second detection radius are less than or equal to the radius of the circular area of the sweeper body.
[0080] In one embodiment, triggering the virtual collision includes: controlling the sweeper to stop moving; calculating the rotation direction and rotation angle based on the second coordinate information of the obstacle and the moving direction of the sweeper; and moving the sweeper according to the rotation direction and the rotation angle.
[0081] In this embodiment, when the robot vacuum detects an obstacle ahead and triggers a virtual collision, it will stop its left and right wheels from moving. It will then continue to determine the obstacle's second coordinate information and the robot vacuum's current direction of movement. If the obstacle is on the robot vacuum's path and to its right, the robot vacuum will rotate to the left to avoid it; conversely, if the obstacle is to the left, it will rotate to the right. Furthermore, based on the angle between the obstacle's second coordinate information and the robot vacuum's current path (direction of movement), the robot vacuum uses its built-in algorithm module to calculate the minimum rotation angle required to completely avoid the obstacle. See also... Figure 6 This is a schematic diagram of the rotation angle C of the sweeper.
[0082] S105: If no virtual collision is triggered, determine whether the distance is greater than or equal to the second detection radius. If the distance is greater than or equal to the second detection radius, determine whether the angle of the obstacle is within the second angle range. If the angle of the obstacle is within the second angle range, trigger virtual obstacle avoidance.
[0083] In this embodiment, if the distance from the obstacle to the center of the sweeping machine calculated in step S104 is greater than or equal to the second detection radius of virtual obstacle avoidance, then the angle of the obstacle calculated in step S104 is used to determine whether the angle of the obstacle is within the second angle range. If the angle of the obstacle is within the second angle range, then virtual obstacle avoidance is triggered.
[0084] See Figure 7 In one embodiment, triggering virtual obstacle avoidance includes steps S701-S704:
[0085] S701: Obtain the initial speeds of the left and right wheels of the sweeper.
[0086] In this embodiment, the sweeper's control system reads the current speed of the left and right wheels through sensors or encoders. The initial speed value Vo is used as the base speed for subsequent PID controller speed adjustment.
[0087] S702: Calculate the output value of the PID controller based on the distance, turning speed, and desired obstacle avoidance path.
[0088] In this embodiment, the PID (Proportional-Integral-Derivative) controller is a commonly used feedback controller. Through the method in step S103, the distance between the second coordinate information of the obstacle and the position information of the sweeper itself is calculated. The output value Vpid is adjusted according to the error between the current distance, turning speed and the expected obstacle avoidance path. This output value will be used to adjust the speed of the left wheel and the right wheel.
[0089] S703: If the obstacle is on the right side of the sweeper, then the left wheel is determined to be the initial speed minus the output value of the PID controller, and the right wheel is determined to be the initial speed plus the output value of the PID controller.
[0090] In this embodiment, see Figure 8 This diagram illustrates the speed control of the left and right wheels of a robotic vacuum cleaner. If an obstacle is located on the right side of the vacuum cleaner, the control system will reduce the speed of the left wheel to generate a counter-clockwise angular velocity. Specifically, the new speed of the left wheel will be equal to the initial speed minus the output value of the PID controller (Vleft = Vo - Vpid). Simultaneously, to maintain the stability of the vacuum cleaner and increase its ability to bypass obstacles, the control system will increase the speed of the right wheel. The new speed of the right wheel will be equal to the initial speed plus the output value of the PID controller (Vright = Vo + Vpid).
[0091] S704: If the obstacle is on the left side of the sweeper, then the left wheel is determined to be the initial speed plus the output value of the PID controller, and the right wheel is determined to be the initial speed minus the output value of the PID controller.
[0092] In this embodiment, if the obstacle is located on the left side of the sweeper, in order to generate a clockwise angular velocity, the control system will increase the speed of the left wheel; the new speed of the left wheel will be equal to the initial speed plus the output value of the PID controller, i.e., Vleft = Vo + Vpid; at the same time, the control system will reduce the speed of the right wheel to Vright = Vo - Vpid.
[0093] In one embodiment, the method further includes: if the distance is greater than the first detection radius and the distance is less than the second detection radius, then the sweeper operates at normal speed; if the distance is greater than the first detection radius and the angle of the obstacle is not within the second angle range, then the sweeper operates at normal speed; if the angle of the obstacle is not within the first angle range and the distance is less than the second detection radius, then the sweeper operates at normal speed; if the angle of the obstacle is not within the first angle range and the angle of the obstacle is not within the second angle range, then the sweeper operates at normal speed.
[0094] In this embodiment, the distance-based conditions include: if the distance is greater than the first detection radius and less than the second detection radius, the robot vacuum maintains normal speed control regardless of the angle; the angle-based conditions include: if the distance is greater than the first detection radius and the angle of the obstacle is not within the second angle range, the robot vacuum maintains normal speed control; if the angle of the obstacle is not within the first angle range and the distance is less than the second detection radius, the robot vacuum maintains normal speed control; if the angle of the obstacle is not within the first angle range and the angle of the obstacle is not within the second angle range, the robot vacuum maintains normal speed control.
[0095] The virtual obstacle avoidance method for a robotic vacuum cleaner provided in this embodiment acquires the first coordinate information of each obstacle in a map coordinate system using sensors; converts the first coordinate information of each obstacle into second coordinate information in the robotic vacuum cleaner's coordinate system; calculates the distance between the second coordinate information of each obstacle and the origin of the robotic vacuum cleaner's coordinate system, as well as the angle of the obstacle; determines whether the distance is less than or equal to a first detection radius; if the distance is less than or equal to the first detection radius, determines whether the angle of the obstacle is within a first angle range; if the angle of the obstacle is within the first angle range, a virtual collision is triggered; if no virtual collision is triggered, determines whether the distance is greater than or equal to a second detection radius; if the distance is greater than or equal to the second detection radius, determines whether the angle of the obstacle is within a second angle range; if the angle of the obstacle is within the second angle range, virtual obstacle avoidance is triggered. This application improves the smooth control effect of the robotic vacuum cleaner by calculating the distance between the obstacle and the origin of the robotic vacuum cleaner's coordinate system and setting different detection radii and angle ranges to select virtual collision or virtual obstacle avoidance as the obstacle avoidance method.
[0096] Example 2
[0097] In addition, this application provides a virtual obstacle avoidance device 900 for a sweeping robot, which is applied to electronic devices.
[0098] like Figure 9 As shown, the virtual obstacle avoidance device 900 of the robot vacuum cleaner includes:
[0099] The acquisition module 901 is used to acquire the first coordinate information of each obstacle in the map coordinate system through the sensor;
[0100] The conversion module 902 is used to convert the first coordinate information of each obstacle into the second coordinate information of the sweeper coordinate system;
[0101] The calculation module 903 is used to calculate the distance between the second coordinate information of each obstacle and the origin of the sweeper's coordinate system, as well as the angle of the obstacle;
[0102] The judgment module 904 is used to determine whether the distance is less than or equal to the first detection radius. If the distance is less than or equal to the first detection radius, it determines whether the angle of the obstacle is within the first angle range. If the angle of the obstacle is within the first angle range, it triggers a virtual collision. If no virtual collision is triggered, it determines whether the distance is greater than or equal to the second detection radius. If the distance is greater than or equal to the second detection radius, it determines whether the angle of the obstacle is within the second angle range. If the angle of the obstacle is within the second angle range, it triggers a virtual obstacle avoidance.
[0103] Optionally, the determination module 904 shown is further configured to determine whether the robot vacuum is operating normally if the distance is greater than the first detection radius and the distance is less than the second detection radius; whether the robot vacuum is operating normally if the distance is greater than the first detection radius and the angle of the obstacle is not within the second angle range; whether the robot vacuum is operating normally if the angle of the obstacle is not within the first angle range and the distance is less than the second detection radius; and whether the robot vacuum is operating normally if the angle of the obstacle is not within the first angle range and the angle of the obstacle is not within the second angle range.
[0104] Optionally, the conversion module 902 shown is further configured to form an accessible array of the first coordinate information of each obstacle; to poll from the accessible array to obtain the first coordinate information of each obstacle; and to convert the first coordinate information of each obstacle into second coordinate information according to the sweeper coordinate system.
[0105] Optionally, the conversion module 902 shown is also used to confirm the center of the sweeper; and to establish the sweeper coordinate system with the center of the sweeper as the origin, the X-axis to the right and the Y-axis upward.
[0106] Optionally, the calculation module 903 shown is also used to control the sweeper to stop moving; calculate the rotation direction and rotation angle according to the second coordinate information of the obstacle and the moving direction of the sweeper; and move the sweeper according to the rotation direction and the rotation angle.
[0107] Optionally, the calculation module 903 shown is further configured to obtain the initial speeds of the left and right wheels of the sweeper; calculate the output value of the PID controller based on the distance, turning speed, and desired obstacle avoidance path; if the obstacle is on the right side of the sweeper, then the left wheel's speed is determined to be the initial speed minus the output value of the PID controller, and the right wheel's speed is determined to be the initial speed plus the output value of the PID controller; if the obstacle is on the left side of the sweeper, then the left wheel's speed is determined to be the initial speed plus the output value of the PID controller, and the right wheel's speed is determined to be the initial speed minus the output value of the PID controller.
[0108] Optionally, the acquisition module 901 shown is further configured to acquire the first coordinate information of obstacles within a fixed distance in front of the sweeper via a forward obstacle avoidance sensor; acquire the first coordinate information of obstacles within a fixed distance to the side of the sweeper via a lateral obstacle avoidance sensor; and acquire the first coordinate information of obstacles within a fixed distance above the sweeper via a lidar.
[0109] The virtual obstacle avoidance device 900 for the sweeping machine provided in this embodiment can implement the virtual obstacle avoidance method for the sweeping machine provided in Embodiment 1. To avoid repetition, it will not be described again here.
[0110] The virtual obstacle avoidance device for a robotic vacuum cleaner provided in this embodiment acquires the first coordinate information of each obstacle in a map coordinate system through sensors; converts the first coordinate information of each obstacle into second coordinate information in the robotic vacuum cleaner's coordinate system; calculates the distance between the second coordinate information of each obstacle and the origin of the robotic vacuum cleaner's coordinate system, as well as the angle of the obstacle; determines whether the distance is less than or equal to a first detection radius; if the distance is less than or equal to the first detection radius, determines whether the angle of the obstacle is within a first angle range; if the angle of the obstacle is within the first angle range, a virtual collision is triggered; if no virtual collision is triggered, determines whether the distance is greater than or equal to a second detection radius; if the distance is greater than or equal to the second detection radius, determines whether the angle of the obstacle is within a second angle range; if the angle of the obstacle is within the second angle range, virtual obstacle avoidance is triggered. This application improves the smooth control effect of the robotic vacuum cleaner by calculating the distance between the obstacle and the origin of the robotic vacuum cleaner's coordinate system and setting different detection radii and angle ranges to select virtual collision or virtual obstacle avoidance as the obstacle avoidance method.
[0111] Example 3
[0112] Furthermore, this application provides an electronic device, including a memory and a processor. The memory stores a computer program, and the computer program executes the virtual obstacle avoidance method for the sweeping robot provided in Embodiment 1 when it runs on the processor.
[0113] The electronic device provided in this embodiment of the invention can execute the steps of the virtual obstacle avoidance method for the sweeping machine provided in the above method embodiment 1. To avoid repetition, it will not be described again here.
[0114] Example 4
[0115] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the virtual obstacle avoidance method for the sweeping robot provided in Embodiment 1.
[0116] In this embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0117] The computer-readable storage medium provided in this embodiment can implement the virtual obstacle avoidance method of the sweeping robot provided in Embodiment 1. To avoid repetition, it will not be described again here.
[0118] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal that includes that element.
[0119] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0120] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A virtual obstacle avoidance method for a sweeping robot, characterized in that, The method includes: The sensors acquire the first coordinate information of each obstacle in the map coordinate system; The first coordinate information of each obstacle is converted into the second coordinate information of the sweeper coordinate system; Calculate the distance between the second coordinate information of each obstacle and the origin of the sweeper's coordinate system, as well as the angle of the obstacle; Determine whether the distance is less than or equal to the first detection radius. If the distance is less than or equal to the first detection radius, determine whether the angle of the obstacle is within the first angle range. If the angle of the obstacle is within the first angle range, trigger a virtual collision. If no virtual collision is triggered, it is determined whether the distance is greater than or equal to the second detection radius. If the distance is greater than or equal to the second detection radius, it is determined whether the angle of the obstacle is within the second angle range. If the angle of the obstacle is within the second angle range, virtual obstacle avoidance is triggered.
2. The method according to claim 1, characterized in that, The method further includes: If the distance is greater than the first detection radius and the distance is less than the second detection radius, the sweeper will operate at normal speed. If the distance is greater than the first detection radius and the angle of the obstacle is not within the second angle range, the sweeper will operate at normal speed. If the angle of the obstacle is not within the first angle range and the distance is less than the second detection radius, the sweeper will operate at normal speed. If the angle of the obstacle is not in the first angle range and the angle of the obstacle is not in the second angle range, the sweeper will operate at normal speed.
3. The method according to claim 1, characterized in that, The step of converting the first coordinate information of each obstacle into the second coordinate information of the sweeper coordinate system includes: The first coordinate information of each obstacle is organized into an accessible array; The first coordinate information of each obstacle is obtained by polling from the accessible array, and the first coordinate information of each obstacle is converted into second coordinate information according to the robot vacuum coordinate system.
4. The method according to claim 3, characterized in that, Before converting the first coordinate information of each obstacle into the second coordinate information of the sweeper coordinate system, the method further includes: Confirm the center of the sweeper; A coordinate system for the sweeper is established with the center of the sweeper as the origin, the X-axis pointing to the right, and the Y-axis pointing upwards.
5. The method according to claim 1, characterized in that, The triggering of the virtual collision includes: Control the sweeper to stop moving; Based on the second coordinate information of the obstacle and the direction of movement of the sweeper, calculate the rotation direction and rotation angle; The sweeper moves according to the rotation direction and the rotation angle.
6. The method according to claim 1, characterized in that, The triggering of virtual obstacle avoidance includes: Obtain the initial speeds of the left and right wheels of the sweeper; Calculate the output value of the PID controller based on the distance, turning speed, and desired obstacle avoidance path; If the obstacle is on the right side of the sweeper, then the left wheel is determined to be the initial speed minus the output value of the PID controller, and the right wheel is determined to be the initial speed plus the output value of the PID controller; If the obstacle is on the left side of the sweeper, then the left wheel is determined to be the initial speed plus the output value of the PID controller, and the right wheel is determined to be the initial speed minus the output value of the PID controller.
7. The method according to claim 1, characterized in that, The step of acquiring the first coordinate information of each obstacle in the map coordinate system through sensors includes: The first coordinate information of obstacles within a fixed distance in front of the sweeper is obtained by the forward obstacle avoidance sensor; The first coordinate information of obstacles within a fixed distance to the side of the sweeper is obtained by the lateral obstacle avoidance sensor; The first coordinate information of obstacles within a fixed distance above the sweeping machine is obtained by using lidar.
8. A virtual obstacle avoidance device for a sweeping robot, characterized in that, The device includes: The acquisition module is used to acquire the first coordinate information of each obstacle in the map coordinate system through sensors; The conversion module is used to convert the first coordinate information of each obstacle into the second coordinate information of the sweeper coordinate system; The calculation module is used to calculate the distance between the second coordinate information of each obstacle and the origin of the sweeper's coordinate system, as well as the angle of the obstacle; The judgment module is used to determine whether the distance is less than or equal to a first detection radius. If the distance is less than or equal to the first detection radius, it determines whether the angle of the obstacle is within a first angle range. If the angle of the obstacle is within the first angle range, it triggers a virtual collision. If no virtual collision is triggered, it determines whether the distance is greater than or equal to a second detection radius. If the distance is greater than or equal to the second detection radius, it determines whether the angle of the obstacle is within a second angle range. If the angle of the obstacle is within the second angle range, it triggers a virtual obstacle avoidance.
9. An electronic device, characterized in that, The system includes a memory and a processor, wherein the memory stores a computer program that executes the virtual obstacle avoidance method of the sweeping machine according to any one of claims 1 to 7 when the processor is running.
10. A computer-readable storage medium, characterized in that, It stores a computer program that, when run on a processor, executes the virtual obstacle avoidance method of the sweeping machine according to any one of claims 1 to 7.
Citation Information
Patent Citations
Navigation vehicle obstacle detection method based on laser radars
CN112596074A
Obstacle avoidance method and system of mobile robot, terminal equipment and storage medium
CN114815809A