Cleaning robot cleaning path acquisition and generation method, device, equipment and medium
By performing real-time sampling, identification, erasing of backward movements, interpolation, and noise reduction on the cleaning robot during the teaching process, the problem of inaccurate path planning in manual teaching of cleaning robots was solved, thus improving cleaning efficiency and quality.
Patent Information
- Application Number
- CN202411349287.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2024-11-12
AI Technical Summary
Existing cleaning robots suffer from problems with the accuracy of cleaning routes due to non-standard teaching paths during the manual teaching and route planning process, resulting in repeated cleaning or missed areas.
By sampling the robot's pose in real time during the teaching walking process based on a preset sampling period and sampling distance, a teaching path point queue is generated, the sampling points corresponding to the backward movement are identified and erased, and interpolation and noise reduction processing is performed to generate the final cleaning path.
It improves the cleaning efficiency and quality of cleaning robots, ensures the continuity and smoothness of the path, reduces unnecessary energy consumption, and extends the service life of robots.
Smart Images

Figure CN118924204A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of cleaning robots, and more specifically, to a method, device, equipment and medium for collecting and generating cleaning paths of cleaning robots. Background Art
[0002] With the development of science and technology and the progress of society, people have higher and higher requirements for the living environment, especially the cleanliness of the indoor environment. Therefore, cleaning robots, as a new type of smart home appliance, have received extensive attention and development in the market. At present, various types of cleaning robots have appeared on the market, such as sweeping robots, mopping robots, air purification robots, etc. The emergence of these products has greatly improved people's quality of life and work efficiency;
[0003] Generally, the path planning of cleaning robots can be achieved in two ways: one is pre-programmed path planning, and the other is the process of manually guiding the robot to learn specific tasks. During the manual teaching process, if the path planning algorithm is not accurate enough, the unnecessary route walking path generated during the manual operation teaching process, such as the back-off operation, may cause the subsequent robot to repeatedly clean certain wrong areas or miss certain areas during the automatic operation, affecting the robot's cleaning effect.
[0004] Therefore, how to reduce the impact of non-standard teaching paths on the generated cleaning routes during manual teaching route planning and improve the accuracy of the cleaning routes needs to be solved urgently. Summary of the invention
[0005] The main purpose of this application is to provide a cleaning robot cleaning path collection and generation method, device, equipment and medium, aiming to solve the technical problem of how to reduce the impact of non-standard teaching paths on the generation of cleaning routes during manual teaching route planning, and improve the accuracy of the cleaning routes.
[0006] The first aspect of the present application proposes a cleaning path collection and generation method for a cleaning robot, comprising:
[0007] Based on the preset sampling period and sampling distance, the robot posture during the teaching walking process is sampled in real time;
[0008] Generate a teaching path point queue based on the sampling points;
[0009] If the robot moves backward, erase the sampling points corresponding to the backward path in the teaching path point queue;
[0010] Interpolation processing is performed based on the erased teaching path point queue;
[0011] The teaching path point queue after interpolation is subjected to noise reduction processing to obtain the final teaching path.
[0012] Furthermore, the step of performing real-time sampling of sampling points of the robot posture during the teaching walking process based on a preset sampling period and sampling distance includes:
[0013] Based on the teaching start instruction, load the preset sampling period and sampling distance;
[0014] Based on the sampling period and the sampling distance, the sampling points are generated by acquiring the positioning information of the robot in real time.
[0015] Furthermore, the step of generating a teaching path point queue based on the sampling points includes:
[0016] Determine whether the robot feedback speed at the current sampling point is less than 0;
[0017] If it is not less than 0, determine whether the vector angle of the current sampling point and the tangent angle interpolation of the teaching path point queue are less than the preset angle threshold;
[0018] If it is less than a preset angle threshold, the teaching path point queue is updated based on the sampling point.
[0019] Furthermore, if the robot moves backward, the step of erasing the sampling points corresponding to the backward path in the teaching path point queue includes:
[0020] If the feedback speed of the robot at the current sampling point is less than 0, it is judged that the robot is moving backward;
[0021] The sampling points corresponding to the backward action are regarded as invalid sampling points;
[0022] If after the invalid sampling point, it is recognized that the robot's feedback speed becomes greater than 0, and the teaching path point queue updates the specified number of sampling points, the sampling point Qm corresponding to the current position is identified;
[0023] Identify the sampling point Pn in the teaching path point queue before the invalid sampling point that is closest to the current sampling point Qm, where all sampling points between pn and Qm and the invalid sampling points are determined as sampling points corresponding to the backward path;
[0024] Erase the sampling points corresponding to the backward path.
[0025] Furthermore, the step of performing interpolation processing based on the erased teaching path point queue includes:
[0026] According to the preset interpolation algorithm, an interpolation function is constructed based on Pn and Qm in the erased teaching path point queue;
[0027] Based on the sampling distance, new sampling points are inserted equidistantly between Pn and Qm in the interpolation function to complete the interpolation process.
[0028] Furthermore, after the step of performing noise reduction processing on the teaching path point queue after interpolation to obtain the final teaching path, the method further comprises:
[0029] Gaussian smoothing is performed on the path points in the teaching path point queue after interpolation to filter out position noise and teaching sharp angles during the teaching process;
[0030] Perform precise interpolation on the path points after Gaussian smoothing;
[0031] The path after precise interpolation is smoothed twice to obtain the final teaching path.
[0032] The second aspect of the present application provides a cleaning robot cleaning path collection and generation device, comprising:
[0033] A real-time sampling unit is used to perform real-time sampling of sampling points of the robot posture during the teaching walking process based on a preset sampling period and sampling distance;
[0034] A queue generating unit, used for generating a teaching path point queue based on the sampling points;
[0035] A backward identification unit is used to erase the sampling points corresponding to the backward path in the teaching path point queue if the robot has a backward movement;
[0036] An interpolation unit, used for performing interpolation processing based on the erased teaching path point queue;
[0037] The noise reduction unit is used to perform noise reduction processing on the teaching path point queue after interpolation to obtain the final teaching path.
[0038] The third aspect of the present application provides a cleaning robot cleaning path collection and generation device, comprising:
[0039] processor;
[0040] Memory for storing computer programs;
[0041] Wherein, when the processor executes the computer program, the cleaning path acquisition and generation method of the cleaning robot described in any one of the above is implemented.
[0042] The fourth aspect of the present application proposes a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the cleaning path acquisition and generation method of the cleaning robot described in any one of the above-mentioned methods is implemented.
[0043] Beneficial effects:
[0044] This application can capture the actual motion trajectory of the robot precisely by sampling the robot's posture during the teaching walking process in real time, and combining the preset sampling period and sampling distance, avoiding the loss of path information caused by too low sampling frequency, identifying and erasing invalid sampling points in the teaching path point queue due to the backward action, and effectively avoiding the path deviation caused by improper human operation, ensuring that the generated path will not repeatedly clean the same area or miss the uncleaned area, thereby significantly improving the cleaning efficiency and quality of the robot. New sampling points are inserted into the teaching path point queue after removing invalid sampling points to maintain the continuity and coherence of the path. Through this method, even after removing some sampling points, the subsequent robot can still perform cleaning operations along a smooth and natural path. At the same time, the position noise and teaching sharp angles generated during the teaching process are filtered out through smoothing processing, the stability of the path is improved, and unnecessary energy consumption caused by path jitter is avoided, further improving the working performance and service life of the robot. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 This is a schematic diagram of the steps of a method for collecting and generating a cleaning path for a cleaning robot according to an embodiment of the present application;
[0046] Figure 2 It is a schematic diagram of a generation process of a cleaning robot cleaning path acquisition generation method according to an embodiment of the present application;
[0047] Figure 3 This is a schematic block diagram of the structure of a cleaning path acquisition and generation device for a cleaning robot according to an embodiment of the present application;
[0048] Figure 4 is a schematic block diagram of the structure of a computer device according to an embodiment of the present application;
[0049] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0051] It will be appreciated by those skilled in the art that, unless expressly stated, the singular forms "one", "above", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of features, integers, steps, operations, elements, modules, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, modules, components, and / or groups thereof. It should be understood that when an element is said to be "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may also be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any module and all combinations of one or more associated listed items.
[0052] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with those in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.
[0053] Reference Figure 1 - Figure 2 The present application embodiment provides a cleaning robot cleaning path collection and generation method, comprising the following steps S1-S5:
[0054] S1. Based on the preset sampling period and sampling distance, the robot posture during the teaching walking process is sampled in real time;
[0055] S2, generating a teaching path point queue based on the sampling points;
[0056] S3. If the robot moves backward, erase the sampling points corresponding to the backward path in the teaching path point queue;
[0057] S4, performing interpolation processing based on the erased teaching path point queue;
[0058] S5. Perform noise reduction processing on the teaching path point queue after interpolation to obtain the final teaching path.
[0059] In step S1, two key parameters, sampling period and sampling distance, need to be defined first. The sampling period means that the robot will record the current position coordinates as sampling points every time a certain period of time passes; while the sampling distance means that the robot will record a sampling point every time it moves a certain distance. In order to ensure the accuracy of sampling, these two parameters need to be adjusted according to the actual scenario. For example, the sampling period and distance can be reduced in areas that require fine control, while they can be appropriately increased in open areas to reduce the amount of data. When the user starts the teaching process, the robot will move according to the user's guidance. During this process, the sensors inside the robot (such as wheel encoders, gyroscopes, etc.) will continue to monitor its position changes. Whenever the preset sampling period or sampling distance is reached, the sensor will record the position coordinates of the robot at this time, and these coordinate information will be collected as sampling points. In order to facilitate subsequent processing, these sampling points will be organized into a queue structure in chronological order, namely the "teaching path point queue". The data collection of the teaching path point queue is completed by the sensor, and then transmitted to the central processing unit (CPU) through the data bus. The CPU is responsible for data storage and management. During the storage process, the sampling point information will be timestamped to facilitate tracking the position status of the robot at different time points. In addition, in order to ensure the consistency and integrity of the data, it is usually necessary to design corresponding data verification mechanisms, such as data compression and encryption, to ensure the safe transmission of data. By accurately collecting the robot's motion trajectory, the robot can be effectively guided to operate autonomously in a complex environment. By reasonably setting the sampling period and sampling distance, sampling points that do not meet the sampling rules can be actively removed, which can not only ensure the accuracy of path planning, but also reduce unnecessary data storage, thereby reducing the demand for computing resources.
[0060] In step S2, the sampling points need to be sorted first. Since the sampling points are generated in chronological order, the sorting can be achieved by comparing the timestamps of the sampling points. Secondly, in order to ensure data quality, some basic preprocessing of the sampling points may be required, such as removing invalid sampling points (such as data loss due to sensor failure), correcting abnormal values (such as sudden large jumps), etc. The purpose of this is to ensure the quality of the sampling point data, thereby providing a reliable basis for subsequent processing. For real-time sampling points that meet the judgment conditions, they are included in the teaching path point queue, and these sampling points can be stored in a list or array. Each sampling point will contain at least three pieces of information: timestamp, position coordinates (usually X and Y coordinates). If necessary, other information can be added, such as the robot's direction angle. Each element in the teaching path point queue represents the position information of the robot at a certain point in time. The generation of the teaching path point queue ensures the accuracy of path planning. By accurately recording the robot's motion trajectory, the accumulation of errors in path planning can be effectively avoided, thereby improving the robot's path tracking ability in complex environments. Through the teaching path point queue, all the key positions of the robot during the teaching process can be clearly understood, which provides a clear direction for subsequent path planning. For example, in the interpolation processing stage, a smooth path curve can be generated based on the sampling points in the teaching path point queue.
[0061] In step S3, since the robot may retreat during the teaching process, if not handled, these retreat actions will cause the final generated path to be redundant, and may even produce unreasonable loop paths. Therefore, the purpose of step S3 is to detect and remove the sampling points related to the retreat action in the teaching path point queue. First, the relative displacement between adjacent sampling points can be calculated by calculating the difference between the position coordinates of two consecutive sampling points. For example, if a Cartesian coordinate system is used, each sampling point can be expressed as (x, y), then the relative displacement vector between two consecutive sampling points Pi = (xi, yi)Pi = (xi, yi) and Pi + 1 = (xi + 1, yi + 1)Pi + 1 = (xi + 1, yi + 1) can be expressed as ΔP = (xi + 1-xi, yi + 1-yi)ΔP = (xi + 1-xi, yi + 1-yi). Determine whether a retreat action has occurred based on the direction of the relative displacement vector. Generally, if the relative displacement vector is opposite to the direction from the previous sampling point to the current sampling point, it is considered that a retreat action has occurred. The dot product or cross product of the vector can be used to determine the direction. To avoid misjudgment, a threshold can be set to distinguish between slight deviations and true retreat movements. For example, if the modulus of the relative displacement is less than a certain threshold, it can be assumed that no significant movement has occurred, and the change can be ignored. Once a retreat movement is detected, the sampling points associated with it need to be removed from the queue of taught path points. Removing the sampling points corresponding to the retreat movement can reduce the repetitive parts in the path and avoid unnecessary loops or repeated movements of the robot in actual work, thereby improving the simplicity and efficiency of the path. After removing the influence of the retreat movement, the path planning algorithm can more easily generate a straight line or curve without considering complex rotation paths, which greatly simplifies the path planning process.
[0062] In step S4, based on the fact that the backward action in the teaching path point queue has been processed, the sampling points related thereto are removed. At this point, the sampling point sequence in the teaching path point queue may no longer be continuous, and there may be jumps or missing. In order to generate a continuous and smooth path, the teaching path point queue needs to be interpolated to fill the gaps between the sampling points and ensure the continuity and smoothness of the path. You can choose to use linear interpolation, cubic spline interpolation, Bezier curve interpolation and other search methods. For example, the most computationally efficient method is to use linear interpolation. For two known sampling points, a straight line can be calculated based on the coordinates of the two points, and then new points are evenly distributed on the straight line to fill the blank area between the two sampling points. Through interpolation processing, the continuity of the path can be ensured, and a coherent path can be generated even if there are large jumps in the original teaching path point queue. Through the flexible selection of interpolation methods, it can adapt to different types of path requirements, so that it is suitable for a variety of different application scenarios.
[0063] In step S5, the path quality is further optimized, and the noise points in the path are reduced by noise reduction processing to improve the smoothness and accuracy of the path. The noise reduction method may include moving average method, Gaussian filter, median filter, bilateral filter and Kalman filter, etc. For example, a Gaussian filter may be used to perform weighted average processing on the sampling points in the path, wherein the weight varies with the distance from the center point, and the closer the sampling point to the center point, the greater the weight, thereby achieving the effect of smoothing the path. Noise reduction processing can effectively reduce the sharp turns and unnecessary fluctuations in the interpolated path, making the path smoother and conducive to the smooth operation of the robot. The path after noise reduction is closer to the ideal path, which helps to improve the robot's motion accuracy and make it more accurate when performing tasks.
[0064] In one embodiment, the step of performing real-time sampling of sampling points of the robot posture during the teaching walking process based on a preset sampling period and sampling distance includes:
[0065] S10, based on the teaching start instruction, loading the preset sampling period and sampling distance;
[0066] S11. Based on the sampling period and the sampling distance, the sampling points are generated by acquiring the positioning information of the robot in real time.
[0067] In this embodiment, after receiving the teaching start instruction, the system first loads the preset sampling period (i.e., how long is the interval for collecting a sample) and the sampling distance (i.e., how far the robot travels to collect a sample). These parameters are usually set by the user before the teaching mode starts, and they can be adjusted according to different application scenarios to adapt to specific task requirements. For example, in the case of highly precise control, a shorter sampling period and a smaller sampling distance may be set; while in the case of quickly recording a large range of moving paths, a longer sampling period and a larger sampling distance may be used. Once the sampling period and sampling distance are loaded, the system will monitor the position change of the robot in real time according to these two parameters. Whenever the distance traveled by the robot reaches the preset sampling distance or the time interval reaches the preset sampling period, the system will record the position information of the robot at this time, including but not limited to the coordinate position, posture angle, etc., and save it as a sampling point. In this process, the system will continuously detect the position information of the robot and dynamically generate new sampling points according to the above rules. By reasonably setting the sampling period and sampling distance, it can be ensured that the generated path can reflect the actual motion trajectory of the robot as accurately as possible, thereby improving the accuracy and flexibility of the path.
[0068] In one embodiment, the step of generating a teaching path point queue based on the sampling points includes:
[0069] S20, determining whether the robot feedback speed at the current sampling point is less than 0;
[0070] S21, if it is not less than 0, determine whether the vector angle of the current sampling point and the tangent angle interpolation of the teaching path point queue are less than a preset angle threshold;
[0071] S22: If the angle is less than a preset angle threshold, update the teaching path point queue based on the sampling point.
[0072] In this embodiment, the feedback speed of the robot at the current sampling point is first checked. If the feedback speed is less than 0, it means that the robot is decelerating or stopping, and in this case the sampling point will not be added to the teaching path. This judgment is to avoid including invalid or discontinuous actions, because the data in the deceleration or stop state is not helpful for building a smooth and continuous path. If the feedback speed of the current sampling point is not less than 0, the difference between the vector angle of the sampling point (i.e., the direction angle of the current position of the robot) and the tangent angle interpolation of the nearest sampling point in the teaching path point queue is further determined. The "tangent angle interpolation" here refers to the angle of the robot's travel direction predicted based on the nearest sampling point. If this difference is less than the preset angle threshold, it means that the current sampling point is basically consistent with the previous sampling point in direction, and such a sampling point helps to build a smoother and more coherent path. When it is determined that the difference between the vector angle of the current sampling point and the tangent angle interpolation of the nearest sampling point is less than the preset angle threshold, the sampling point will be incorporated into the teaching path point queue and the teaching path will be updated. This means that the sampling point maintains good consistency with the previous sampling point in direction, so it can be used to build a smooth and continuous path. This embodiment can exclude sampling points in the deceleration or stop state to prevent these invalid data from affecting the continuity and smoothness of the path. The sampling point is included in the teaching path only when the direction angle of the sampling point is close to the direction angle of the previous sampling point. This can ensure that the generated path is as smooth as possible, reduce unnecessary turns, backs and jitters, help optimize the path planning algorithm, reduce unnecessary computing overhead, and improve the quality of the teaching path finally generated.
[0073] In one embodiment, if the robot has a backward movement, the step of erasing the sampling points corresponding to the backward path in the teaching path point queue includes:
[0074] S30, if the feedback speed of the robot at the current sampling point is less than 0, it is determined that the robot is in a backward motion;
[0075] S31, considering the sampling points corresponding to the backward action as invalid sampling points;
[0076] S32, if after the invalid sampling point, it is recognized that the robot becomes a feedback speed greater than 0, and the teaching path point queue updates a specified number of sampling points, identify the sampling point Qm corresponding to the current position;
[0077] S33, identifying the sampling point Pn in the teaching path point queue before the invalid sampling point that is closest to the current sampling point Qm, wherein all sampling points between pn and Qm and the invalid sampling points are determined as sampling points corresponding to the backward path;
[0078] S34, erasing the sampling points corresponding to the backward path.
[0079] In this embodiment, the teaching path point queue (such as Figure 2 The system checks the feedback speed of the robot at the current sampling point. If the feedback speed is less than 0, the robot is considered to be in a backward motion. This judgment is based on the assumption that the feedback speed of the robot is positive when it is moving forward and negative when it is moving backward. Once it is confirmed that the current sampling point corresponds to a backward motion, the sampling point will be considered an invalid sampling point (such as Figure 2 This is because during the process of generating the teaching path, the teacher may go backwards, and the corresponding route is not within the demonstration range. After detecting the invalid sampling point, the system continues to monitor the change in the robot's feedback speed. When it is recognized that the robot's feedback speed becomes positive again (that is, it starts to move forward, and the point where it starts to move forward can be recorded as Qn), and the teaching path point queue has updated the specified number of sampling points (such as Figure 2(as shown in Qn to Qm in C), the sampling point corresponding to the current position is marked as Qm. This step is to find the first valid sampling point after the retreat action ends. After determining Qm, it is necessary to find the valid sampling point Pn closest to Qm. This sampling point is located before all invalid sampling points and has the smallest distance from Qm. The purpose of this operation is to determine the nearest sampling point Qm in the teaching path before the invalid sampling point based on the sampling point Qm that is readjusted to the normal direction after retreating, so as to determine where the previous teaching path is valid. Because in general, retreat is caused by the wrong direction movement during the teaching process, so before retreating, there will be a distance of sampling points that deviate from the correct teaching path. By identifying the sampling point closest to the distance, the sampling points that deviate from the correct teaching path can also be screened out, so as to achieve better path connection and accurate elimination of related failure points. The last step is to erase all sampling points between sampling points Pn and Qm. This means that all data points related to the backward motion are removed from the teaching path point queue (as shown in part C where the invalid sampling point is before the teaching direction), thereby ensuring that the generated teaching path does not contain any traces of the backward motion and the related erroneous sampling points (all identified as sampling points corresponding to the backward motion). This not only effectively identifies and removes the sampling points related to the backward motion, but also ensures that the generated teaching path is more concise, efficient and practical.
[0080] In one embodiment, the step of performing interpolation processing based on the erased teaching path point queue includes:
[0081] S40, constructing an interpolation function based on Pn and Qm in the erased teaching path point queue according to a preset interpolation algorithm;
[0082] S41, based on the sampling distance, insert new sampling points equidistantly between Pn and Qm in the interpolation function to complete the interpolation process.
[0083] In this embodiment, an interpolation algorithm (such as linear interpolation, spline interpolation, etc.) is first selected. Then, an interpolation function is constructed using the retained sampling points Pn (the last valid sampling point before the backward action) and Qm (the first valid sampling point after the backward action ends) as boundary conditions. The purpose of the interpolation function is to estimate the true path between two valid sampling points based on given boundary conditions. The purpose of this is to fill the gaps caused by removing invalid sampling points, making the path look more continuous and natural. Once the interpolation function is constructed, it is necessary to insert new sampling points equidistantly between Pn and Qm according to the pre-set sampling distance (such as Figure 2These new sampling points are calculated by the interpolation function, and they are evenly distributed to maintain the consistency and smoothness of the path. For example, if the sampling distance is set to 1 cm, a new sampling point will be inserted every 1 cm between Pn and Qm. This ensures that each point on the path is close enough to the true trajectory while maintaining the continuity and predictability of the path. By inserting new sampling points between Pn and Qm, the missing part of the path caused by removing invalid sampling points can be made up, making the path complete and continuous.
[0084] In one embodiment, the step of performing noise reduction processing on the teaching path point queue after interpolation to obtain the final teaching path includes:
[0085] S50, performing Gaussian smoothing on the path points in the teaching path point queue after interpolation to filter out position noise points and teaching sharp angles during the teaching process;
[0086] S51, performing precise interpolation on the path points after Gaussian smoothing;
[0087] S52, performing secondary smoothing on the path after precise interpolation to obtain a final teaching path.
[0088] In this embodiment, Gaussian smoothing technology is first used to process the teaching path point queue after interpolation. It can apply a Gaussian to weighted average the path points by convolution, so as to effectively filter out the noise points and sharp angles in the path. This processing method can significantly reduce the irregular changes on the path and make the path smoother. After completing the preliminary Gaussian smoothing, the next step is to accurately interpolate the path points. The fine interpolation here usually refers to the use of more advanced interpolation methods (such as cubic spline interpolation) to further improve the quality of the path. Compared with the original interpolation method, fine interpolation can better approximate the real motion trajectory and ensure that each point on the path has higher accuracy. The last step is to perform secondary smoothing. The purpose of this step is to further improve the smoothness and continuity of the path. Gaussian smoothing or other smoothing techniques can be used again to achieve this goal. Secondary smoothing helps to eliminate any small fluctuations that may be introduced by the interpolation process, ensuring that the final teaching path is both smooth and coherent. Through multiple rounds of smoothing and interpolation processing, the smoothness and continuity of the path can be significantly improved, thereby obtaining a higher quality teaching path. The denoised path can reduce unnecessary acceleration and deceleration in the robot's motion, thereby improving the smoothness and efficiency of the robot's subsequent motion.
[0089] In one embodiment, after the step of performing noise reduction processing on the teaching path point queue after interpolation to obtain the final teaching path, the method further comprises:
[0090] S60: Setting path curvature information and path speed limit information based on sampling points in the final teaching path.
[0091] In this embodiment, first, the path curvature at each sampling point needs to be calculated. Path curvature refers to the degree of curvature of the path at a certain point, which can be represented by the radius of curvature of the path at that point. The curvature can be estimated by calculating the angle change between adjacent sampling points. Specifically, the curvature k can be calculated by the following formula: k = |θ| / r, where |θ| is the angle change between adjacent sampling points (in radians), and r is the distance between the two points. The curvature k reflects the degree of curvature of the path at that point. Based on the path curvature information, the speed limit information on the path can be set. Generally speaking, the greater the path curvature, the sharper the curvature of the path at that point, and the robot needs to slow down when passing through to ensure safety. A relationship table between curvature and speed can be set to determine the maximum allowable speed of the robot passing through the point according to different curvature values. For example, for areas with higher curvature, a lower speed limit can be set, while for areas with lower curvature, a higher speed limit can be set. Path curvature information provides the robot with information about the degree of curvature of the path, which is crucial for optimizing the robot's motion control. At the same time, by setting the path speed limit information, it can ensure that the robot slows down when passing through high curvature areas, thereby improving safety and the robot's adaptability to different path conditions, enabling it to effectively perform tasks in a wider range of scenarios.
[0092] refer to Figure 3 , a cleaning robot cleaning path acquisition and generation device, comprising:
[0093] The real-time sampling unit 100 is used to perform real-time sampling of sampling points of the robot posture during the teaching walking process based on a preset sampling period and sampling distance;
[0094] A queue generation unit 200, configured to generate a teaching path point queue based on the sampling points;
[0095] The backward identification unit 300 is used to erase the sampling points corresponding to the backward path in the teaching path point queue if the robot has a backward movement;
[0096] An interpolation unit 400, configured to perform interpolation processing based on the erased teaching path point queue;
[0097] The noise reduction unit 500 is used to perform noise reduction processing on the teaching path point queue after interpolation to obtain a final teaching path.
[0098] Furthermore, the real-time sampling unit 100 includes:
[0099] A cycle loading unit, used to load a preset sampling cycle and sampling distance based on a teaching start instruction;
[0100] The positioning acquisition unit is used to generate sampling points by acquiring the positioning information of the robot in real time based on the sampling period and the sampling distance.
[0101] Furthermore, the queue generation unit 200 includes:
[0102] A speed judgment unit is used to judge whether the robot feedback speed at the current sampling point is less than 0;
[0103] An angle judgment unit, used to judge whether the vector angle of the current sampling point and the tangent angle interpolation of the teaching path point queue are less than a preset angle threshold if it is not less than 0;
[0104] The teaching update unit is used to update the teaching path point queue based on the sampling point if it is less than a preset angle threshold.
[0105] Furthermore, the back-off identification unit 300 includes:
[0106] A retreat judgment unit, used to judge that the robot has a retreat action if the feedback speed of the robot at the current sampling point is less than 0;
[0107] An invalidity determination unit, used for considering a sampling point corresponding to a backward motion as an invalid sampling point;
[0108] The backward change unit is used to identify the sampling point Qm corresponding to the current position if it is recognized that the robot has a feedback speed greater than 0 after the invalid sampling point and the teaching path point queue has updated a specified number of sampling points;
[0109] A backward sampling judgment unit is used to identify a sampling point Pn in the teaching path point queue before the invalid sampling point that is closest to the current sampling point Qm, wherein all sampling points between pn and Qm and the invalid sampling points are determined as sampling points corresponding to the backward path;
[0110] The erasing unit is used to erase the sampling points corresponding to the backward path.
[0111] Furthermore, the interpolation unit 400 includes:
[0112] A function construction unit, for constructing an interpolation function based on Pn and Qm in the erased teaching path point queue according to a preset interpolation algorithm;
[0113] The sampling point insertion unit is used to insert new sampling points equidistantly between Pn and Qm in the interpolation function based on the sampling distance to complete the interpolation process.
[0114] Furthermore, the noise reduction unit 500 includes:
[0115] The smoothing unit is used to perform Gaussian smoothing on the path points in the teaching path point queue after interpolation, and filter out the position noise and teaching sharp angles during the teaching process;
[0116] Fine interpolation unit, used for fine interpolation of path points after Gaussian smoothing;
[0117] The secondary smoothing unit is used to perform secondary smoothing on the path after precise interpolation to obtain the final teaching path.
[0118] In one embodiment, the above device further includes a speed limiting module, and the speed limiting module includes:
[0119] A speed limit setting unit is used to set path curvature information and path speed limit information based on sampling points in the final teaching path.
[0120] Reference Figure 4 In an embodiment of the present application, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected by a bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores operations, computer programs and databases. The memory provides an environment for the operation of the operations and computer programs in the non-volatile storage medium. The database of the computer device is used to store data such as a cleaning robot cleaning path acquisition generation method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a cleaning robot cleaning path acquisition generation method is implemented, including the steps of: based on a preset sampling period and sampling distance, sampling points are sampled in real time for the robot posture during the teaching walking process; based on the sampling points, a teaching path point queue is generated; if the robot has a backward action, the sampling points corresponding to the backward path in the teaching path point queue are erased; based on the erased teaching path point queue, interpolation processing is performed; the teaching path point queue after interpolation is subjected to noise reduction processing to obtain the final teaching path.
[0121] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, a method for collecting and generating a cleaning path for a cleaning robot is implemented, comprising the following steps: based on a preset sampling period and sampling distance, real-time sampling of sampling points of the robot posture during the teaching walking process; generating a teaching path point queue based on the sampling points; if the robot has a backward movement, erasing the sampling points corresponding to the backward path in the teaching path point queue; performing interpolation processing based on the erased teaching path point queue; and performing noise reduction processing on the teaching path point queue after interpolation to obtain a final teaching path.
[0122] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in the present application and used in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0123] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for collecting and generating a cleaning path of a cleaning robot, characterized in that: include: Based on the preset sampling period and sampling distance, the robot posture during the teaching walking process is sampled in real time; Generate a teaching path point queue based on the sampling points; If the robot moves backward, erase the sampling points corresponding to the backward path in the teaching path point queue; Interpolation processing is performed based on the erased teaching path point queue; The teaching path point queue after interpolation is subjected to noise reduction processing to obtain the final teaching path.
2. The cleaning path collection and generation method of the cleaning robot according to claim 1, characterized in that: The step of performing real-time sampling of sampling points of the robot posture during the teaching walking process based on a preset sampling period and sampling distance includes: Based on the teaching start instruction, load the preset sampling period and sampling distance; Based on the sampling period and the sampling distance, the sampling points are generated by acquiring the positioning information of the robot in real time.
3. The cleaning path collection and generation method of the cleaning robot according to claim 1, characterized in that: The step of generating a teaching path point queue based on the sampling points comprises: Determine whether the robot feedback speed at the current sampling point is less than 0; If it is not less than 0, determine whether the vector angle of the current sampling point and the tangent angle interpolation of the teaching path point queue are less than the preset angle threshold; If it is less than a preset angle threshold, the teaching path point queue is updated based on the sampling point.
4. The cleaning path collection and generation method of the cleaning robot according to claim 1, characterized in that: If the robot moves backward, the step of erasing the sampling points corresponding to the backward path in the teaching path point queue includes: If the feedback speed of the robot at the current sampling point is less than 0, it is judged that the robot is moving backward; The sampling points corresponding to the backward action are regarded as invalid sampling points; If after the invalid sampling point, it is recognized that the robot's feedback speed becomes greater than 0, and the teaching path point queue updates the specified number of sampling points, the sampling point Qm corresponding to the current position is identified; Identify the sampling point Pn in the teaching path point queue before the invalid sampling point that is closest to the current sampling point Qm, where all sampling points between pn and Qm and the invalid sampling points are determined as sampling points corresponding to the backward path; Erase the sampling points corresponding to the backward path.
5. The cleaning path collection and generation method of the cleaning robot according to claim 4, characterized in that: The step of performing interpolation processing based on the erased teaching path point queue includes: According to the preset interpolation algorithm, an interpolation function is constructed based on Pn and Qm in the erased teaching path point queue; Based on the sampling distance, new sampling points are inserted equidistantly between Pn and Qm in the interpolation function to complete the interpolation process.
6. The cleaning path collection and generation method of the cleaning robot according to claim 1, characterized in that: The step of performing noise reduction processing on the teaching path point queue after interpolation to obtain the final teaching path includes: Gaussian smoothing is performed on the path points in the teaching path point queue after interpolation to filter out position noise and teaching sharp angles during the teaching process; Perform precise interpolation on the path points after Gaussian smoothing; The path after precise interpolation is smoothed twice to obtain the final teaching path.
7. The cleaning path collection and generation method of the cleaning robot according to claim 1, characterized in that: After the step of performing noise reduction processing on the teaching path point queue after interpolation to obtain the final teaching path, the method further comprises: Path curvature information and path speed limit information are set based on the sampling points in the final teaching path.
8. A cleaning robot cleaning path collection and generation device, characterized in that: include: A real-time sampling unit is used to perform real-time sampling of sampling points of the robot posture during the teaching walking process based on a preset sampling period and sampling distance; A queue generating unit, used for generating a teaching path point queue based on the sampling points; A backward identification unit is used to erase the sampling points corresponding to the backward path in the teaching path point queue if the robot has a backward movement; An interpolation unit, used for performing interpolation processing based on the erased teaching path point queue; The noise reduction unit is used to perform noise reduction processing on the teaching path point queue after interpolation to obtain the final teaching path.
9. A cleaning robot cleaning path collection and generation device, characterized in that: include: processor; Memory for storing computer programs; Wherein, when the processor executes the computer program, the cleaning path collection and generation method of the cleaning robot described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the cleaning path acquisition and generation method of the cleaning robot according to any one of claims 1 to 7 is implemented.
