A robot control method, a robot vacuum cleaner and a computer program product
Patent Information
- Application Number
- CN202610994242.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-03
- Publication Date
- 2026-09-25
AI Technical Summary
[0004]本申请实施例提供了一种机器人控制方法、扫地机器人和计算机程序产品,能够解决现有技术中扫地机器人使用传统 DWA 算法存在路径代价评估不合理的技术问题
[0008]本实施例的技术效果在于:通过引入角速度变化率惩罚项和数字低通滤波器,削减转向抖动;通过航向与速度解耦策略,消除大角速度下的离心力干扰,修正沿墙走位的“蛇形”偏差,提升运动平滑性。
Smart Images

Figure CN122805155A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of robotic vacuum cleaner technology, and in particular relates to a robot control method, a robotic vacuum cleaner, and a computer program product. Background Technology
[0002] With the rapid popularization of robotic vacuum cleaners, intelligent and efficient cleaning and obstacle avoidance have become core requirements. The Dynamic Window Approach (DWA), which comprehensively considers the kinematic constraints of the robot, is widely used in local path planning and obstacle avoidance.
[0003] However, in actual engineering implementation and prototype verification (such as complex environment testing), the traditional DWA algorithm has a technical problem of unreasonable path cost evaluation. That is, the target cost calculation of traditional DWA often relies on "predicting the distance between the end point of the path and the target point". When facing large obstacles or high curvature paths, it is easy for the robot to "rotate in place" or be unable to smoothly bypass the target point. Summary of the Invention
[0004] This application provides a robot control method, a sweeping robot, and a computer program product, which can solve the technical problem of unreasonable path cost evaluation in the use of traditional DWA algorithm in sweeping robots in the prior art.
[0005] In a first aspect, this application provides a robot control method applied to a robotic vacuum cleaner, the robotic vacuum cleaner including at least a controller, the method being executed by the controller, the method comprising: Step S11: The controller acquires the current pose of the sweeping robot; Step S12: Based on the current pose of the sweeping robot, kinematic constraints, and several sets of candidate velocity commands generated by the DWA algorithm; Step S13: Predict the future predicted path corresponding to each group of candidate speed commands; wherein each group of future predicted paths is represented by a path point set P, which contains n discrete path points. Step S14: The controller calculates the Euclidean distance between each path point pi in the path point set of each group of future predicted paths and the local target point T, and takes the minimum value among all calculated Euclidean distances as the target cost of that group of predicted paths. .
[0006] The technical effect of this embodiment is that by replacing the traditional single endpoint distance with the minimum Euclidean distance between the predicted path's fully discrete point set and the target point as the target cost, the algorithm can predict high curvature bypass paths, enabling the machine to smoothly bypass large obstacles and completely eliminate positioning oscillations near the target point.
[0007] In one embodiment, step S1, which involves using the minimum value among all calculated Euclidean distances as the target cost of the predicted path set, is a step that... Subsequently, the method further includes: Step S21: The controller will set the target cost The evaluation function is then weighted and summed with the obstacle distance cost and the velocity cost, and a penalty term for the rate of change of angular velocity is introduced. Together, they construct an overall path evaluation function, in which, Let ω be the angular velocity at the current moment. The actual angular velocity executed in the previous control cycle. For dynamic smoothing coefficients; Step S22: The controller calculates the comprehensive cost of each group of predicted paths according to the overall path evaluation function, and selects the speed command corresponding to the predicted path with the smallest comprehensive cost as the output speed command. Step S23: The controller uses a digital low-pass filter to measure the angular velocity at the current moment. Filtering is performed, and the heading angle is calculated based on the difference between the current heading angle and the target heading angle of the sweeping robot. ; Step S24: at the heading angle If the angle exceeds a preset threshold, an adaptive linear velocity decay function is executed. The linear velocity in the output speed command is attenuated and corrected, and the corrected speed command is output to the drive wheel motor of the sweeping robot.
[0008] The technical effects of this embodiment are as follows: by introducing a penalty term for the rate of change of angular velocity and a digital low-pass filter, steering jitter is reduced; by using a decoupling strategy between heading and speed, centrifugal force interference at high angular velocities is eliminated, the "snake-like" deviation of the movement along the wall is corrected, and the smoothness of the movement is improved.
[0009] In one embodiment, the robotic vacuum cleaner further includes a sensing module; the method further includes: Step S31: During the process of the drive wheel motor driving the sweeping robot to move according to the corrected speed command, the controller acquires the perception data collected by the perception module in real time to construct a two-dimensional cost map; wherein, the two-dimensional cost map includes an expansion layer, which is used to represent the danger zone around the obstacle after it expands according to a preset radius; the perception data includes at least relevant information about the obstacles around the sweeping robot. Step S32: The controller calculates the spatial occupancy rate of the inflated layer within the local map area and calculates the environmental complexity factor based on the spatial occupancy rate. ; Step S33: In the environmental complexity factor If the preset dense environment threshold is exceeded, the controller determines that the robotic vacuum cleaner has entered a narrow or obstacle-dense area and performs the following adjustment operation: adjusts the prediction duration parameter in the DWA algorithm. The prediction time is shortened to a preset threshold for dense environment prediction time, resulting in the shortened prediction time parameter. The velocity space sampling step size in the DWA algorithm is increased to a preset dense environment sampling step size threshold to obtain the increased sampling step size. Step S34: The controller uses the shortened prediction duration parameter Using the time window length of the future predicted path as the time interval between two adjacent path points, and using the increased sampling step size as the time interval between two adjacent path points, step S13 is re-executed to generate the path point set of the new future predicted path corresponding to each group of candidate speed commands. The target cost used in step S14 of the subsequent control cycle. The recalculation and the reselection of the output speed command in step S22.
[0010] The technical effect of this embodiment is that by establishing an environmental complexity factor and dynamically adjusting the prediction time and sampling step size according to it, the problem of wandering and planning failure caused by excessive long-term path costs in narrow spaces is solved.
[0011] In one embodiment, the method further includes: Step S41: The shortened prediction duration parameter obtained in step S3 The controller continuously monitors The following state parameters within each control cycle include the combined cost of each predicted path group. Real-time linear velocity of the robot vacuum cleaner and the variance of real-time angular velocity ; Step S42: In the continuous Within each control cycle, if the comprehensive cost Greater than the preset cost threshold And the real-time linear velocity Less than the preset linear velocity threshold And the variance of the real-time angular velocity Greater than the preset variance threshold In the event that the robot vacuum cleaner is trapped in a logical dead zone, the controller will determine that the robot vacuum cleaner is trapped in a logical dead zone and trigger a safety stop or retreat obstacle avoidance command.
[0012] The technical effect of this embodiment is that by establishing a multi-dimensional parameter motion state monitoring model based on time series, it can accurately identify insurmountable dead zones and actively trigger safe shutdown or rollback strategies to avoid the machine spinning in place.
[0013] Secondly, this application also provides a robotic vacuum cleaner, including a memory, a controller, and a computer program stored in the memory and executable on the controller. When the controller executes the computer program, it implements the robotic vacuum cleaner control method steps described in the first aspect above.
[0014] Thirdly, this application also provides a computer program product storing a computer program that, when executed by a processor, implements the steps of the method described in the first aspect above. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a schematic flowchart of the first embodiment of the robot control method provided in this application; Figure 2 This is a schematic flowchart of a second embodiment of the robot control method provided in this application. Figure 3 This is a schematic flowchart of the third embodiment of the robot control method provided in this application; Figure 4 This is a flowchart illustrating the fourth embodiment of the robot control method provided in this application. Figure 5 This is a structural schematic diagram of a sweeping robot provided in an embodiment of this application. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0018] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments of this application, unless otherwise stated, "a plurality of" means two or more.
[0019] In the description of this invention, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0020] Understandably, the rapid popularization of robotic vacuum cleaners in recent years has made intelligent and efficient cleaning and obstacle avoidance core requirements. Dynamic Window (DWA) is widely used in local path planning and obstacle avoidance because it comprehensively considers the robot's kinematic constraints. However, in actual engineering implementation and prototype verification (such as complex environment testing), the traditional DWA algorithm has the following obvious defects and technical problems: 1. Inappropriate path cost assessment: Traditional DWA often relies on "predicting the distance between the end point of the path and the target point" to calculate the target cost. When facing large obstacles or paths with high curvature, this can easily cause the robot to "rotate in place" near the target point or be unable to smoothly bypass it.
[0021] 2. Complex and narrow spaces are prone to jamming or inefficiency: In narrow and complex environments such as those with dense table and chair legs, the machine often "lingers in place" due to excessive obstacles and high local path costs; redundant detour logic leads to a significant increase in cleaning time.
[0022] 3. Poor smoothness of movement: The sweeper experiences momentary vibration when turning; when moving along a wall in a straight line, it is prone to "snake-like" deviation, first deviating and then closing; at high angular velocities, the smoothness of movement is poor due to centrifugal interference.
[0023] 4. Lack of dead zone protection mechanism: When faced with insurmountable obstacles, due to the lack of advance judgment logic, the machine often gets stuck in a dead loop of "spinning in place" and cannot stop safely in time.
[0024] To address the aforementioned technical problems, this application provides a robot control method applied to a sweeping robot. The sweeping robot includes at least a controller, and the method is executed by the controller through steps S1→S2→S3→S4. It may also include a drive wheel motor, a sensing module, and a pose acquisition module. The controller is electrically connected to the drive wheel motor, the sensing module, and the pose acquisition module, respectively.
[0025] Example 1 like Figure 1 As shown, Figure 1 This is a flowchart illustrating a first embodiment of a robot control method according to this application. The controller executes major step S1, which mainly includes steps S11 to S14: Step S11: Obtain the current pose of the robotic vacuum cleaner; As an example, the robotic vacuum cleaner is equipped with a pose acquisition module; the pose acquisition module may be an odometer and an inertial measurement unit, installed in the body of the robotic vacuum cleaner, and is used to measure the pose, linear velocity and angular velocity of the robotic vacuum cleaner to obtain the current pose of the robotic vacuum cleaner.
[0026] Step S12: Based on the current pose of the sweeping robot, kinematic constraints, and several sets of candidate velocity commands generated by the DWA algorithm; Step S13: Predict the future predicted path corresponding to each group of candidate speed commands; wherein each group of future predicted paths is represented by a path point set P, the path point set P containing n discrete path points, i.e., path point set P ; In practical implementation, based on the kinematic model of the robotic vacuum cleaner, within a preset prediction time... Within, at preset time intervals (i.e., sampling step size) The velocity command is integrated and recursively calculated to obtain the pose coordinates at each discrete moment, forming a discrete set of path points. .
[0027] As an example, let's assume the predicted duration seconds, sampling step size If the predicted path for each group of candidate velocity commands is within seconds, then the predicted path for each group of candidate velocity commands includes... A discrete path point.
[0028] Step S14: The controller calculates each path point in the path point set of each group of future predicted paths. p i The Euclidean distance between the target point T and the local target point is used, and the minimum value among all calculated Euclidean distances is taken as the target cost of the predicted path. .
[0029] As an example, the target cost of the predicted path in this group Calculated using the following predefined objective cost function: ,in, These are the coordinates of the local target point; It is understandable that we assume a set of predicted paths contains 3 discrete points: Distance from target point It is 0.8 meters. Distance from target point It is 0.3 meters. Distance from target point If the distance is 0.6 meters, then the target cost of this set of predicted paths is... The value indicates that the path reached the closest point to the target during its movement, which was only 0.3 meters.
[0030] Furthermore, the controller will set the target cost As a cost term in the overall path evaluation function, it is weighted and summed with obstacle distance cost, speed cost, and the subsequently defined angular velocity change rate penalty term to calculate the comprehensive cost of each predicted path. The speed command corresponding to the predicted path with the minimum comprehensive cost is then output to the drive wheel motor of the sweeping robot.
[0031] The technical effect of this embodiment is that traditional DWA only focuses on the distance between the predicted path endpoint and the target point. When the robot vacuum cleaner faces a large obstacle, its optimal mathematical path often manifests as: first rushing straight towards the target point, hitting the obstacle, and then turning around. At this time, the endpoint is close to the target point, but the middle section of the path is blocked by the obstacle. The algorithm misjudges it as a "good path", causing the robot to repeatedly try and rotate in place near the target point.
[0032] This embodiment uses the minimum distance of all path points instead of the destination distance for target cost evaluation, fundamentally changing the evaluation logic: whether the path "passes" near the target point (i.e., whether it smoothly approaches the target during movement) becomes the core evaluation indicator, rather than simply "whether it eventually stops near the target point." When the path detours around large obstacles, the path points of the detour segment are farther from the target point, resulting in a larger minimum distance value and a worse target cost, which is then reasonably downweighted by the algorithm. Through this mechanism, the algorithm can predict and filter out "detour-like" paths that require moving away from the target before approaching it during the planning stage, and select those paths that always smoothly approach the target, ultimately eliminating positioning oscillations near the target point.
[0033] Example 2 refer to Figure 2 Based on the above-described robot control method, in Embodiment 1, after step S1 (i.e., after step S14), a method from Embodiment 2 is proposed to address the technical problem of poor motion smoothness in existing sweeping robots using the traditional DWA algorithm. The controller executes the major step S2, which mainly includes steps S21 to S24: Step S21: The controller will set the target cost The evaluation function is then weighted and summed with the obstacle distance cost and the velocity cost, and a penalty term for the rate of change of angular velocity is introduced. Together, they construct an overall path evaluation function, in which, Let ω be the angular velocity at the current moment. The actual angular velocity executed in the previous control cycle. For dynamic smoothing coefficients; It is understood that this embodiment, based on embodiment one, further defines the composition of the overall path evaluation function and the method of correcting the speed command; The overall path evaluation function also includes a penalty term for the rate of change of angular velocity:
[0034] in, Let ω be the angular velocity at the current moment. The actual angular velocity executed in the previous control cycle. For dynamic smoothing coefficients; It should be noted that the dynamic smoothing coefficient... It is negatively correlated with the rate of change of the current angular velocity. When When it increases, The corresponding increase is to enhance the suppression of sudden changes in angular velocity; conversely, when the change in angular velocity is small, The size should be reduced accordingly to avoid excessively restricting the robot's mobility.
[0035] Step S22: The controller calculates the comprehensive cost of each group of predicted paths according to the overall path evaluation function, and selects the speed command corresponding to the predicted path with the smallest comprehensive cost as the output speed command. It is understandable that by adding this penalty term to the overall path evaluation function, the controller will consider the smoothness of angular velocity when evaluating the overall path cost, thereby suppressing sudden changes in angular velocity at the source.
[0036] Step S23: The controller uses a digital low-pass filter to measure the angular velocity at the current moment. Filtering is performed, and the heading angle is calculated based on the difference between the current heading angle and the target heading angle of the sweeping robot. ; As an example, the controller uses a digital low-pass filter to filter the current angular velocity. Filtering is performed; the transfer function of the digital low-pass filter is:
[0037] in, These are the filter coefficients, and their values range from [value range missing]. Low-pass filtering can further eliminate high-frequency noise and transient jumps in the angular velocity signal.
[0038] Step S24: When the heading angle When the angle exceeds a preset threshold, an adaptive linear velocity decay function is executed. The linear velocity in the output speed command is attenuated and corrected, and the corrected speed command is output to the drive wheel motor of the sweeping robot.
[0039] As an example, this embodiment sets the preset angle threshold to be... ,when At that time, the adaptive linear velocity decay function is executed:
[0040] in, The maximum linear speed allowed for a robot vacuum cleaner (e.g.) ), This is the absolute value of the current angular velocity. This is the attenuation coefficient (the range of values for the attenuation coefficient is positively correlated with the maximum braking capacity of the robotic vacuum cleaner). And when... If the angle does not exceed a preset threshold, the original linear velocity in the output speed command remains unchanged.
[0041] It's understandable that when a robot vacuum needs to make a sharp turn ( If the robot continues to travel at its maximum linear velocity, centrifugal force will cause it to sideslip or become unstable. By using an exponential decay function, the linear velocity decreases exponentially with increasing angular velocity, automatically reducing speed during sharp turns to ensure smooth driving. For example, when... , , hour, .
[0042] The controller will adjust the attenuated linear velocity. The smoothed angular velocity is used as the final control command output to the drive wheel motor of the robot vacuum cleaner. Through three smoothing mechanisms—evaluation function penalty term, low-pass filtering, and heading decoupling attenuation—steering jitter is effectively reduced, centrifugal force interference at high angular velocities is eliminated, and the "snake-like" deviation of the robot vacuum cleaner's movement along the wall is corrected.
[0043] Example 3 refer to Figure 3 Based on the robot control method of Embodiment 2 above, after step S2 (i.e., after step S24), a related method of Embodiment 3 is proposed to solve the technical problem in the prior art that the traditional DWA algorithm used by sweeping robots is prone to getting stuck or is inefficient in complex and narrow spaces. The controller executes the major step S3, which mainly includes steps S31 to S34: Step S31: During the process of the drive wheel motor driving the sweeping robot to move according to the corrected speed command, the controller acquires the perception data collected by the perception module in real time to construct a two-dimensional cost map; wherein, the two-dimensional cost map includes an expansion layer, which is used to represent the danger zone around the obstacle after it expands according to a preset radius; the perception data includes at least relevant information about the obstacles around the sweeping robot. In a specific implementation, the sensing module can be a lidar or a depth camera, installed on the body of the sweeping robot, for sensing environmental obstacle information; It is understood that during the process of the sweeping robot moving according to the corrected speed command output in step S24 of Embodiment 2, the controller acquires perception data from the LiDAR or depth camera in real time to construct a two-dimensional cost map. The cost map includes an expansion layer, which is used to represent the danger zone around the obstacle after it has expanded according to a preset radius (e.g., the robot radius plus a safety margin).
[0044] Step S32: The controller calculates the spatial occupancy rate of the inflated layer within the local map area and calculates the environmental complexity factor based on the spatial occupancy rate. ; In a specific implementation, the controller calculates the spatial occupancy rate of the inflated layer within the local map area and calculates the environmental complexity factor based on the occupancy rate. :
[0045] in The area of a local region centered on the current position of the robot vacuum cleaner, for example, the area of a square local region centered on the current position of the robot vacuum cleaner with a side length of a preset length (2 meters); This refers to the area occupied by the expansion layer within the local region.
[0046] Step S33: In the environmental complexity factor If the preset dense environment threshold is exceeded, the controller determines that the robotic vacuum cleaner has entered a narrow or obstacle-dense area and performs the following adjustment operation: adjusts the prediction duration parameter in the DWA algorithm. The prediction time is shortened to a preset threshold for dense environment prediction time, resulting in the shortened prediction time parameter. The velocity space sampling step size in the DWA algorithm is increased to a preset dense environment sampling step size threshold to obtain the increased sampling step size. As an example, this embodiment takes a preset dense environment threshold of 0.6 as an example, assuming the local area area square meters, if the expansion layer occupies an area of square meters, then ,when This is then identified as a dense environment (such as an area with densely packed table and chair legs); As an example, when When the controller determines that the robotic vacuum cleaner has entered a narrow or obstacle-filled area, it performs the following adjustment operations: Predict duration parameters From default value seconds shortened to Instant The second (threshold for prediction duration in dense environments) is used to obtain the shortened prediction duration parameter. ; The velocity space sampling step size in the DWA algorithm is changed from the default value. Increase to (Sampling step size threshold for dense environments), which is the increased sampling step size; The cost weights of the expansion layer are dynamically optimized, and the weights of obstacle costs are appropriately reduced in dense environments.
[0047] Step S34: The controller uses the shortened prediction duration parameter Using the time window length of the future predicted path as the time interval between two adjacent path points, and using the increased sampling step size as the time interval between two adjacent path points, step S13 is re-executed to generate the path point set of the new future predicted path corresponding to each group of candidate speed commands. The target cost used in step S14 of the subsequent control cycle. The recalculation and the reselection of the output speed command in step S22.
[0048] Specifically, following the example above, the controller uses the shortened prediction duration parameter. Using the time window length for future path prediction and the increased sampling step size as the time interval between two adjacent path points, a new discrete point set for the new future path prediction corresponding to each group of candidate speed commands is regenerated. Used for target cost in subsequent control cycles The calculation and speed command reselection.
[0049] The technical effect of the adjustment operation in this application embodiment is as follows: In dense environments, due to the high density of obstacles, there are a large number of obstacles on the long-term path. If the prediction time is too long, the obstacle cost of almost all candidate paths will be too high, causing the algorithm to be unable to select a feasible path and resulting in "standing still". By shortening the prediction time, the algorithm only evaluates the recent path, reducing the cumulative effect of obstacle cost, so that feasible paths can be selected. At the same time, increasing the sampling step size can reduce the number of path points, reduce the amount of computation, and ensure the real-time performance of control. Furthermore, the adjusted This feedback is sent to the path prediction generation stage, i.e., in subsequent control cycles, where the path prediction in step S1 will be based on the new... The value is applied continuously, rather than just within the current cycle. This gives the dynamic window adjustment continuous and closed-loop characteristics; once the robot vacuum leaves the densely populated area, It can be restored to the default value.
[0050] Example 4 refer to Figure 4 Based on the robot control method of Embodiment 3 above, after step S3 (i.e., after step S34), a related method of Embodiment 3 is proposed to solve the technical problem that the traditional DWA algorithm used in existing sweeping robots lacks a dead zone protection mechanism. The controller executes the major step S4, which mainly includes steps S41 to S42: Step S41: The shortened prediction duration parameter obtained in step S3 The controller continuously monitors The following state parameters within each control cycle include the combined cost of each predicted path group. Real-time linear velocity of the robot vacuum cleaner and the variance of real-time angular velocity ; The real-time linear velocity of the robotic vacuum cleaner in this embodiment variance of real-time angular velocity It can be obtained by the pose acquisition module; in the specific implementation, the real-time linear velocity... Specifically, this can be obtained from an odometer, specifically the variance of the real-time angular velocity. Specifically, this can be provided by an inertial measurement unit.
[0051] Step S42: In the continuous Within each control cycle, if the comprehensive cost Greater than the preset cost threshold And the real-time linear velocity Less than the preset linear velocity threshold And the variance of the real-time angular velocity Greater than the preset variance threshold In the event that the robot vacuum cleaner is trapped in a logical dead zone, the controller will determine that the robot vacuum cleaner is trapped in a logical dead zone and trigger a safety stop or retreat obstacle avoidance command.
[0052] In one example, a preset linear velocity threshold is used. = Preset variance threshold , For example, when consecutive When the following three conditions are met simultaneously within one control cycle (control frequency is 25Hz, i.e., continuously for 1 second): If the combined cost of all candidate paths exceeds the preset threshold, it means that all paths are blocked by obstacles and there are no feasible paths. The robot vacuum cleaner was almost stationary and unable to move forward. The drastic fluctuations in angular velocity indicate that the robot is repeatedly turning in place.
[0053] Understandably, the three conditions of the above-mentioned judgment logic comprehensively determine whether the robot is trapped in a dead zone from three dimensions: "path feasibility," "movement capability," and "movement pattern." Meeting any one of these conditions individually may be normal obstacle avoidance behavior (e.g., a brief pause to wait for the obstacle to move), but meeting all three conditions simultaneously indicates that the robot is trapped in an insurmountable predicament. Once a logical dead zone is determined, the controller immediately terminates the operation and performs the following actions: The method described in Example 2 is used to filter the angular velocity and control the attenuation of the linear velocity; the method described in Example 3 is used to monitor the environmental complexity factor and adjust the prediction duration parameter and sampling step size; and a safety stop command or a back-off obstacle avoidance command is triggered.
[0054] In one embodiment, the specific implementation of the safe shutdown can be as follows: the controller sends a control command to the drive wheel motor, in which both the linear velocity and angular velocity are zero, causing the robot vacuum to stop in place. The obstacle avoidance command then causes the robot to retreat a short distance (e.g., 0.3 meters) at a low speed, and then retry planning its path.
[0055] The technical effect of this embodiment is that by monitoring the time series of multi-dimensional parameters, the "unbreakable dead zone" can be accurately identified, and a safe shutdown or rollback strategy can be actively triggered to avoid the machine spinning in place, causing motor overload or collision damage.
[0056] Example 5 Secondly, this application also provides a sweeping robot, including a memory, a controller, and a computer program stored in the memory and executable on the controller. When the controller executes the computer program, it implements the steps of the sweeping robot control method described in Embodiments 1, 2, 3, and 4 above.
[0057] like Figure 5 As shown, the robotic vacuum cleaner 700 includes a processor 701, a memory 702, a communication interface 703, and a bus 704. The processor 701, memory 702, and communication interface 703 communicate via the bus 704, or via wireless transmission or other means. The memory 702 stores instructions, and the processor 701 executes the instructions stored in the memory 702. The memory 702 stores computer programs, and the processor 701 can call and execute the computer program 7021 stored in the memory 702. Figures 1 to 4 The robot control method shown.
[0058] It should be understood that in the embodiments of this application, processor 701 may be a CPU, or it may 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. General-purpose processors may be microprocessors or any conventional processors, etc.
[0059] The memory 702 may include read-only memory and random access memory, and provides instructions and data to the processor 701. The memory 702 may also include non-volatile random access memory. The memory 702 may be volatile memory or non-volatile memory, or may include both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory may be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0060] In addition to the data bus, the 704 bus may also include a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 5 The general designated all buses as Bus 704.
[0061] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive (SSD).
[0062] Furthermore, the sweeping robot of this embodiment also includes a drive wheel motor, a sensing module 703, and a pose acquisition module 705; the controller is electrically connected to the drive wheel motor, the sensing module, and the pose acquisition module respectively; A drive wheel motor is installed at the bottom of the machine body and is used to drive the machine body to move. The pose acquisition module is used to measure the pose, linear velocity, and angular velocity of the sweeping robot to obtain the current pose of the sweeping robot; the pose acquisition module may be an odometer and an inertial measurement unit, installed in the body of the machine, and used to measure the pose, linear velocity, and angular velocity of the sweeping robot. The sensing module is used to collect sensing data while the robot vacuum is in motion. The sensing data includes, but is not limited to, information about obstacles around the robot vacuum. The sensing module can be a lidar sensor or a depth camera, mounted on the robot body, for sensing environmental obstacle information. It should be noted that the above-described embodiments of this application have been described in the foregoing embodiments one to four, and will not be repeated here.
[0063] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A robot control method, characterized in that, The method is applied to a robotic vacuum cleaner, which at least includes a controller, and the method is executed by the controller, the method comprising: Step S11: The controller acquires the current pose of the sweeping robot; Step S12: Based on the current pose of the sweeping robot, kinematic constraints, and several sets of candidate velocity commands generated by the DWA algorithm; Step S13: Predict the future predicted path corresponding to each group of candidate speed commands; wherein each group of future predicted paths is represented by a path point set P, which contains n discrete path points. Step S14: The controller calculates each path point in the path point set of each group of future predicted paths. p i The Euclidean distance between the target point T and the local target point is used, and the minimum value among all calculated Euclidean distances is taken as the target cost of the predicted path. .
2. The method as described in claim 1, characterized in that, The minimum value among all calculated Euclidean distances is used as the target cost of the predicted path set. Subsequently, the method further includes: Step S21: The controller will set the target cost The evaluation function is then weighted and summed with the obstacle distance cost and the velocity cost, and a penalty term for the rate of change of angular velocity is introduced. Together, they construct an overall path evaluation function, in which, Let ω be the angular velocity at the current moment. The actual angular velocity executed in the previous control cycle. For dynamic smoothing coefficients; Step S22: The controller calculates the comprehensive cost of each group of predicted paths according to the overall path evaluation function, and selects the speed command corresponding to the predicted path with the smallest comprehensive cost as the output speed command. Step S23: The controller uses a digital low-pass filter to measure the angular velocity at the current moment. Filtering is performed, and the heading angle is calculated based on the difference between the current heading angle and the target heading angle of the sweeping robot. ; Step S24: at the heading angle If the angle exceeds a preset threshold, an adaptive linear velocity decay function is executed. The linear velocity in the output speed command is attenuated and corrected, and the corrected speed command is output to the drive wheel motor of the sweeping robot.
3. The method as described in claim 2, characterized in that, The robotic vacuum cleaner also includes a sensing module; the method further includes: Step S31: During the process of the drive wheel motor driving the sweeping robot to move according to the corrected speed command, the controller acquires the perception data collected by the perception module in real time to construct a two-dimensional cost map; wherein, the two-dimensional cost map includes an expansion layer, which is used to represent the danger zone around the obstacle after it expands according to a preset radius; the perception data includes at least relevant information about the obstacles around the sweeping robot. Step S32: The controller calculates the spatial occupancy rate of the inflated layer within the local map area and calculates the environmental complexity factor based on the spatial occupancy rate. ; Step S33: In the environmental complexity factor If the preset dense environment threshold is exceeded, the controller determines that the robotic vacuum cleaner has entered a narrow or obstacle-dense area and performs the following adjustment operation: adjusts the prediction duration parameter in the DWA algorithm. The prediction time is shortened to a preset threshold for dense environment prediction, resulting in the shortened prediction time parameter. The velocity space sampling step size in the DWA algorithm is increased to a preset dense environment sampling step size threshold to obtain the increased sampling step size. Step S34: The controller uses the shortened prediction duration parameter Using the time window length of the future predicted path as the time interval between two adjacent path points, and using the increased sampling step size as the time interval between two adjacent path points, step S13 is re-executed to generate the path point set of the new future predicted path corresponding to each group of candidate speed commands. The target cost used in step S14 of the subsequent control cycle. The recalculation and the reselection of the output speed command in step S22.
4. The method as described in claim 3, characterized in that, The method further includes: The shortened prediction duration parameter The controller continuously monitors The following state parameters within each control cycle include the combined cost of each predicted path group. Real-time linear velocity of the robot vacuum cleaner and the variance of real-time angular velocity ; In continuous Within each control cycle, if the comprehensive cost Greater than the preset cost threshold And the real-time linear velocity Less than the preset linear velocity threshold And the variance of the real-time angular velocity Greater than the preset variance threshold In the event that the robot vacuum cleaner is trapped in a logical dead zone, the controller will determine that the robot vacuum cleaner is trapped in a logical dead zone and trigger a safety stop or retreat obstacle avoidance command.
5. The method according to any one of claims 2 to 4, characterized in that, The adaptive linear velocity decay function is expressed by the following formula. ; in, The maximum allowable linear speed of the robotic vacuum cleaner. This is the absolute value of the current angular velocity. The attenuation coefficient; The value of is positively correlated with the maximum braking capacity of the robotic vacuum cleaner.
6. The method as described in claim 3, characterized in that, The environmental complexity factor Calculate using the following formula: in The area is defined as the local region centered on the current position of the robotic vacuum cleaner. This refers to the area occupied by the expansion layer within the local region.
7. The method according to any one of claims 2 to 4, characterized in that, The method further includes: The heading angle Without exceeding the preset angle threshold, the linear velocity in the output speed command remains unchanged.
8. A robotic vacuum cleaner, comprising a memory, a controller, and a computer program stored in the memory and executable on the controller, characterized in that, When the controller executes the computer program, it implements the steps of the sweeping robot control method as described in any one of claims 1 to 7.
9. The sweeping robot as described in claim 1, characterized in that, The robotic vacuum cleaner also includes a drive wheel motor, a sensing module, and a pose acquisition module; the controller is electrically connected to the drive wheel motor, the sensing module, and the pose acquisition module respectively. The pose acquisition module is used to measure the pose, linear velocity, and angular velocity of the sweeping robot to obtain the current pose of the sweeping robot. The sensing module is used to collect sensing data while the sweeping robot is moving. The sensing data includes, but is not limited to, information about obstacles around the sweeping robot.
10. A computer program product, characterized in that, The computer program product stores processor-executable computer program instructions, which, when invoked by the processor, cause the sweeping robot to perform the steps of the robot control method according to any one of claims 1 to 7.