Robot recharging method, device and equipment and storage medium
By extracting the target rectangular area in the environment image, determining the position of the charging device and setting the position of the buffer point, using dynamic movement control parameters, robot recharge without high-precision sensors is realized, solving the problems of high cost and difficulty in dealing with complex environments in the prior art, and improving docking accuracy and system stability.
Patent Information
- Application Number
- CN202411998890.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-11
AI Technical Summary
The existing robot independent recharge technology relies on high-precision and high-cost sensors, which are costly and difficult to cope with charging needs in complex environments.
By acquiring the environment image collected by the robot, extracting the target rectangular area, determining the position information of the charging device, and determining the position information of the buffer point based on the information, controlling the robot to move to the buffer point using dynamic movement control parameters to realize the return of the pure visual robot.
Without the need for high-precision and high-cost sensors, the docking accuracy and reliability of robot recharge are achieved, the system complexity and cost are reduced, and the stability of the robot's operation in complex environments and the recharge success rate are improved.
Smart Images

Figure CN119806157A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of robotics technology, and in particular to a robot recharging method, device, equipment and storage medium. Background Art
[0002] At present, with the rapid development of robot technology, autonomous charging technology has become the key to the long-term operation of robots. In the existing technology, the autonomous recharging of robots mostly relies on preset fixed paths or complex sensor systems, such as high-precision and high-cost sensors such as infrared or radar, which are costly and difficult to cope with charging needs in complex environments. Summary of the invention
[0003] In view of this, the purpose of the present invention is to provide a robot recharging method, device, equipment and storage medium, which can realize the pure visual robot recharging function without the need for high-precision and high-cost sensors, and ensure docking accuracy and reliability. The specific scheme is as follows:
[0004] In a first aspect, the present application discloses a robot recharging method, comprising:
[0005] Acquire an environment image collected by the robot, and extract a target rectangular area from the environment image; the target rectangular area is a rectangular area on a charging device corresponding to the robot;
[0006] Determine the position information of the charging device according to the position information of the target rectangular area, and determine the position information of the buffer point according to the position information of the charging device; the distance between the buffer point and the charging device is the target length, and the buffer point is in the same direction as the charging device;
[0007] The robot is controlled to move toward the buffer point using dynamic movement control parameters, and then moves to the charging device for charging after reaching the buffer point; the dynamic movement control parameters are determined based on the posture information of the robot and the buffer point, including real-time linear velocity and real-time angular velocity.
[0008] Optionally, extracting a target rectangular area from the environment image includes:
[0009] Obtaining all contours contained in the environment image according to the contour recognition result corresponding to the environment image;
[0010] Filtering a first contour set from all contours according to the area of the contour and a preset area threshold;
[0011] Filtering a second contour set from the first contour set according to the number of vertices of contours in the first contour set and a preset target number of vertices;
[0012] Filtering rectangular contours from the second contour set according to the filling rate of each contour in the second contour set; the filling rate is the ratio of the area of the contour to the area of the minimum circumscribed rectangle of the contour;
[0013] According to the aspect ratio of the rectangular outline and the target aspect ratio, a target rectangular outline is determined from all the rectangular outlines to obtain the target rectangular area; the target aspect ratio is the aspect ratio of the rectangular area on the charging device.
[0014] Optionally, extracting a target rectangular area from the environment image includes:
[0015] Performing image processing on the environment image to obtain a processed image; the image processing includes binarization processing and contour recognition in sequence;
[0016] A target rectangular area is extracted from the processed image.
[0017] Optionally, determining the position information of the charging device according to the position information of the target rectangular area includes:
[0018] Determine the three-dimensional coordinates of the charging device in the camera coordinate system of the robot as initial three-dimensional coordinates according to the position coordinates and depth information of the target rectangular area and the internal parameters of the camera of the robot;
[0019] According to the initial three-dimensional coordinates and the relationship between the camera coordinate system of the robot and the chassis coordinate system of the robot, the three-dimensional coordinates of the charging device in the world coordinate system are obtained by coordinate conversion as the position information of the charging device.
[0020] Optionally, determining the position information of the buffer point according to the position information of the charging device includes:
[0021] Determine the three-dimensional coordinates of the center point of the target rectangular area in the world coordinate system to obtain the three-dimensional coordinates of the center point;
[0022] Determine the normal vector of the target rectangular area according to the three-dimensional coordinates of each rectangular corner point of the target rectangular area in the world coordinate system;
[0023] The position and posture information of the buffer point is determined according to the three-dimensional coordinates of the center point, the normal vector and the target length.
[0024] Optionally, controlling the robot to move toward the buffer point using dynamic movement control parameters includes:
[0025] Determine, according to the current coordinates of the robot and the coordinates of the buffer point, a target direction angle of the buffer point relative to the robot, and a real-time distance between the robot and the buffer point;
[0026] Obtaining a real-time angle difference according to a difference between a current direction angle of the robot and the target direction angle;
[0027] Determine the real-time angular velocity according to the real-time angle difference and a preset first proportional factor, and determine the real-time linear velocity according to the real-time distance and a preset second proportional factor;
[0028] The dynamic movement control parameter is obtained based on the real-time angular velocity and the real-time linear velocity, and the dynamic movement control parameter is used to control the robot to move toward the buffer point.
[0029] Optionally, the step of moving to the charging device for charging after reaching the buffer point includes:
[0030] After reaching the buffer point, determining the direction deviation between the robot and the center point of the target rectangular area;
[0031] If the direction deviation is greater than a preset direction deviation threshold, re-determine the position and posture information of the buffer point according to the environment image currently collected by the robot to obtain a new buffer point;
[0032] The robot is controlled to move toward the new buffer point using dynamic movement control parameters, and then moves to the charging device for charging after reaching the new buffer point.
[0033] In a second aspect, the present application discloses a robot recharging device, comprising:
[0034] A rectangular area extraction module is used to obtain an environmental image collected by the robot and extract a target rectangular area from the environmental image; the target rectangular area is a rectangular area on the charging device corresponding to the robot;
[0035] A buffer point determination module, used to determine the position information of the charging device according to the position information of the target rectangular area, and determine the position information of the buffer point according to the position information of the charging device; the distance between the buffer point and the charging device is the target length, and the direction is the same as that of the charging device;
[0036] A mobile control module is used to control the robot to move toward the buffer point using dynamic mobile control parameters, and then move to the charging device for charging after reaching the buffer point; the dynamic mobile control parameters are determined based on the posture information of the robot and the buffer point, including real-time linear velocity and real-time angular velocity.
[0037] In a third aspect, the present application discloses an electronic device, comprising:
[0038] Memory, used to store computer programs;
[0039] A processor is used to execute the computer program to implement the aforementioned robot recharging method.
[0040] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein the computer program implements the aforementioned robot recharging method when executed by a processor.
[0041] In the present application, an environmental image collected by a robot is obtained, and a target rectangular area is extracted from the environmental image; the target rectangular area is a rectangular area on the charging device corresponding to the robot; the posture information of the charging device is determined according to the position information of the target rectangular area, and the posture information of the buffer point is determined according to the posture information of the charging device; the distance between the buffer point and the charging device is the target length, and is in the same direction as the charging device; the robot is controlled to move to the buffer point by using dynamic movement control parameters, and then moves to the charging device for charging after reaching the buffer point; the dynamic movement control parameters are determined according to the posture information of the robot and the buffer point, including real-time linear velocity and real-time angular velocity. It can be seen that by locating the target rectangular area from the captured image and determining the position and posture of the charging device according to the target rectangular area, the robot and the charging device can be docked based on vision without the need for sensing equipment. On the basis of ensuring the docking accuracy and reliability, the complexity and cost of the system are reduced to achieve a pure visual robot recharging function; by utilizing a buffer point that is at the same target length and position as the charging device, by first moving to the buffer point and then moving from the buffer point to the charging device, the accuracy of the robot's docking with the charging device can be improved; by controlling the movement of the robot through dynamic motion control parameters, that is, controlling the movement of the robot through real-time linear velocity and real-time angular velocity, the stability of the robot's operation in complex environments can be improved, the time consumption of the robot's recharging path can be reduced, and the success rate of the robot's recharging can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0043] Figure 1 A flow chart of a robot recharging method provided in this application;
[0044] Figure 2 A specific environment image schematic diagram provided for this application;
[0045] Figure 3 A schematic diagram of a specific environment image after binarization processing provided in this application;
[0046] Figure 4 A schematic diagram of an environment image after a specific contour recognition provided in this application;
[0047] Figure 5 A specific schematic diagram of a target rectangular area provided for this application;
[0048] Figure 6 A specific robot recharging method flow chart provided in this application;
[0049] Figure 7 A schematic diagram of the structure of a robot recharging device provided in this application;
[0050] Figure 8 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] In the prior art, autonomous robot recharging mostly relies on preset fixed paths or complex sensor systems, such as high-precision, high-cost sensors such as infrared or radar, which are costly and difficult to cope with charging needs in complex environments. In order to overcome the above technical problems, this application proposes a robot recharging method that can realize the pure visual robot recharging function without the need for high-precision, high-cost sensors, and ensure docking accuracy and reliability.
[0053] The present application embodiment discloses a robot recharging method, see Figure 1 As shown, the method may include the following steps:
[0054] Step S11: Acquire an environment image collected by the robot, and extract a target rectangular area from the environment image; the target rectangular area is a rectangular area on the charging device corresponding to the robot.
[0055] In this embodiment, the robot has its own camera, and the charging device corresponding to the robot has a fixed rectangular area, such as Figure 2 The black area on the charging seat is obtained; the environment image captured by the robot's own camera is obtained, and then the target rectangular area is extracted from the environment image, that is, the position area of the rectangular area on the charging device in the image is determined to obtain the target rectangular area.
[0056] In some embodiments, extracting the target rectangular area from the environment image may include: performing image processing on the environment image to obtain a processed image; the image processing includes binarization processing and contour recognition in sequence; extracting the target rectangular area from the processed image. Specifically, the rectangular area may be extracted based on contour recognition; firstly, binarization processing is performed, for example Figure 3 Shown is the pair Figure 2 The environment image shown is binarized and then contour recognition is performed, for example Figure 4 Shown is the pair Figure 3 The image after contour recognition after binarization shown in the figure is prepared for extracting the target rectangular area through the above operations. Binarization refers to the process of converting a grayscale image into a binary image. Each pixel value in the image is converted to one of two possible values, usually 0 or 255; binarization helps to simplify the image, making subsequent contour recognition and rectangle detection easier. Specifically, by calling the threshold_value parameter of the cv::threshold function, the threshold can be dynamically adjusted according to the actual scene. The target area and the background area in the binarized image can be clearly distinguished, providing a clear input for the subsequent image processing steps. Contour recognition is the process of detecting all continuous boundary lines or contours in a binary image; these contours represent the boundaries of different areas in the image. Contour recognition usually uses an edge detection algorithm to identify the edges in the image; then, by connecting these edge points, a complete contour is formed; the result of contour recognition can be a list of all contour points, each contour point represents a boundary point in the image, and these contour points can be used for further analysis and processing of rectangle detection.
[0057] In some embodiments, extracting the target rectangular area from the environment image may specifically include the following steps:
[0058] S201: Obtain all contours contained in the environment image according to the contour recognition result corresponding to the environment image, that is, first obtain the contour recognition result of the environment image, that is, obtain all contour areas contained in the environment image.
[0059] S202: Filter out a first set of contours from all contours according to the area of the contour and the preset area threshold. It is understandable that the area of the rectangular area on the charging device is within a certain range, and contours with too large or too small areas are definitely not target rectangles, so contours with too small or too large areas can be filtered out by presetting minimum and maximum area thresholds.
[0060] S203: Filter out a second contour set from the first contour set according to the number of vertices of the contours in the first contour set and the preset target number of vertices. Since the target rectangle on the charging device is usually a rectangle with four vertices, further filtering can be performed based on the number of vertices, that is, filtering out contours with vertices other than 4. It should be noted that the present application does not limit the order of the filtering operation based on the number of vertices in this step and the filtering operation based on the area threshold in step S202, and filtering can also be performed based on the number of vertices first.
[0061] S204: According to the filling rate of each contour in the second contour set, a rectangular contour is screened out from the second contour set; the filling rate is the ratio of the area of the contour to the area of the minimum circumscribed rectangle of the contour. Quadrilaterals can be screened out by the number of vertices, but not rectangles, so rectangles are further screened out from all quadrilaterals using the filling rate of Luo Kuo; the filling rate is the ratio of the area of the contour to the area of the minimum circumscribed rectangle of the contour, that is, the closer the ratio is to 1, the greater the probability that the contour is a rectangle. Specifically, a ratio threshold can be set to treat contours with a ratio result greater than the ratio threshold as rectangular contours.
[0062] S205: According to the aspect ratio of the rectangular outline and the target aspect ratio, determine the target rectangular outline from all the rectangular outlines to obtain the target rectangular area; the target aspect ratio is the aspect ratio of the rectangular area on the charging device. In order to further improve the accuracy of target rectangle extraction and avoid the influence of the outline on rectangle recognition, the target rectangular outline is screened out from the screened rectangular outlines based on the aspect ratio of the rectangular area on the charging device, that is, the aspect ratio of the target rectangular outline should be consistent with or almost the same as the target aspect ratio. Therefore, through the above steps, the target rectangle that meets the specific conditions can be screened out from all outlines, and the rectangle on the charging device can be located from the image. Rectangle recognition can remove noise and irrelevant outlines, and identify rectangles that may represent target objects, thereby improving the accuracy of subsequent processing.
[0063] Finally, according to the result of rectangle recognition, a rectangular bounding box is drawn on the environment image, for example Figure 5 As shown, the detection frame is used to mark the rectangular area of the charging device in the image. After the rectangular area is determined, the center point coordinates and size of the rectangle can be further calculated to obtain detailed information of the rectangular area for subsequent coordinate conversion and robot movement control.
[0064] Step S12: determining the posture information of the charging device according to the position information of the target rectangular area, and determining the posture information of the buffer point according to the posture information of the charging device; the distance between the buffer point and the charging device is the target length, and is in the same direction as the charging device.
[0065] After determining the target rectangular area, the position information of the charging device can be determined according to the position information of the marked rectangular area. The position information includes position and posture, that is, the position information includes the direction of the object. In this application, in order to improve the accuracy of docking when the robot is charging, the buffer point is used as a transfer, and the distance between the buffer point and the charging device is the target length, and the direction is the same as the charging device; the direction (Orientation) refers to the orientation of the device relative to the reference coordinate system, which is usually described by rotation; in three-dimensional space, the direction can be represented by Euler angles (three angle values: rotation around the X axis, rotation around the Y axis, and rotation around the Z axis) or quaternions (a mathematical object containing real parts and three imaginary parts). That is to say, when the robot is at the buffer point, the robot and the charging device are face to face, and the robot can accurately dock by going straight; by setting up a buffer point, it can be avoided that the robot drives obliquely to the charging device, and even if it reaches the position of the charging device, it cannot be aligned, resulting in the problem of unsuccessful docking. That is, if the robot is moved directly to the charging device, it may cause an abnormal collision between the robot and the charging seat. For example, a buffer point can be set at 0.5 meters away from the charging seat, and the direction is consistent with the charging seat. Therefore, after determining the posture information of the charging device, this embodiment determines the posture information of the buffer point according to the posture information of the charging device.
[0066] In some embodiments, determining the position information of the charging device based on the position information of the target rectangular area may include: determining the three-dimensional coordinates of the charging device in the camera coordinate system of the robot as initial three-dimensional coordinates based on the position coordinates and depth information of the target rectangular area and the internal parameters of the robot's camera; and obtaining the three-dimensional coordinates of the charging device in the world coordinate system through coordinate transformation based on the initial three-dimensional coordinates and the relationship between the robot's camera coordinate system and the robot's chassis coordinate system as the position information of the charging device.
[0067] That is, the environment image is usually an RGB image and does not contain depth information. Therefore, it is necessary to obtain the depth value corresponding to the image pixel from the depth image corresponding to the depth image; then, the image point is converted into a three-dimensional coordinate point in the camera coordinate system using the camera's intrinsic parameters. Specifically, the three-dimensional coordinates of the charging device in the robot's camera coordinate system are determined by the following formula: X = (image_point.x - c x ) * Z / fx , Y = (image_point.y - c y ) * Z / f y ; Where Z is the depth value, f x and f y is the focal length of the camera, c x and c y is the coordinate of the center point of the camera, (image_point.x, image_point.y) is the two-dimensional coordinate of the center point of the target rectangular area in the environment image; the conversion result is a list containing three-dimensional coordinates. Then, using the relationship between the camera coordinate system and the robot chassis coordinate system, the coordinate point is converted to the world coordinate system to obtain the coordinate information of the charging device for subsequent control information calculation and path planning. The rectangular area detection and positioning technology based on vision and depth information significantly improves the accuracy and reliability of docking and reduces system complexity and cost.
[0068] In some embodiments, the determination of the posture information of the buffer point according to the posture information of the charging device may specifically include: determining the three-dimensional coordinates of the center point of the target rectangular area in the world coordinate system to obtain the three-dimensional coordinates of the center point; determining the normal vector of the target rectangular area according to the three-dimensional coordinates of each rectangular corner point of the target rectangular area in the world coordinate system; determining the posture information of the buffer point according to the three-dimensional coordinates of the center point, the normal vector and the target length. That is, the orientation of the surface of the object is represented by the normal vector, and then the buffer point is determined according to the normal vector of the target rectangular area, and the direction of the buffer point is consistent with the direction of the rectangular area on the charging device. The normal vector determination process is as follows: extract the three-dimensional coordinates of the rectangular corner points from the depth image to form a point cloud, and calculate the center of mass of the average position of all points in the point cloud; then calculate the covariance matrix of the point cloud to describe the distribution and direction of the point cloud, perform eigenvalue decomposition on the covariance matrix, and obtain the eigenvector; usually the eigenvector corresponding to the minimum eigenvalue is selected as the normal vector.
[0069] Step S13: Use dynamic movement control parameters to control the robot to move toward the buffer point, and then move to the charging device for charging after reaching the buffer point; the dynamic movement control parameters are determined based on the posture information of the robot and the buffer point, including real-time linear velocity and real-time angular velocity.
[0070] After determining the buffer point, the dynamic movement control parameters are used to control the robot to move to the buffer point. The dynamic movement control parameters specifically include real-time linear velocity and real-time angular velocity. That is, during the robot's movement to the buffer point, the real-time linear velocity and real-time angular velocity are dynamically adjusted to control the movement, thereby improving the stability of the robot's operation. After moving to the buffer point, the robot is controlled to move from the buffer point to the charging device for charging according to the distance and direction between the buffer point and the charging device. Specifically, the robot can be controlled to move the target length toward the charging device.
[0071] In some embodiments, controlling the robot to move toward the buffer point using dynamic movement control parameters may include the following steps:
[0072] S301: Determine a target direction angle of the buffer point relative to the robot and a real-time distance between the robot and the buffer point according to the current coordinates of the robot and the coordinates of the buffer point.
[0073] S302: Obtaining a real-time angle difference according to a difference between the current direction angle of the robot and the target direction angle.
[0074] Specifically, according to the direction of the buffer point, the target direction angle that the robot needs to turn to is calculated. The target direction angle calculation formula is: target_yaw=atan2(target_pose.position.y-current_pose.position.y,target_pose.position.x-current_pose.position.x); where (target_pose.position.x, target_pose.position.y) is the coordinate of the buffer point, (current_pose.position.x, current_pose.position.y) is the real-time coordinate of the robot, and atan2 is the angle calculation function. Then, the target direction angle is compared with the current direction angle of the robot to obtain the angle difference angle_diff=normalizeAngle(target_yaw-yaw); where yaw is the current direction angle of the robot, and normalizeAngle is a function used to normalize the angle value to a specific interval to ensure that the angle value is within a reasonable range for easy processing and comparison. At the same time, according to the position and posture of the buffer point, the specific travel distance of the robot after the direction angle of the buffer point is calculated; the specific formula for real-time distance calculation is: distance=sqrt((target_pose.position.x-current_pose.position.x) 2+(target_pose.position.y-current_pose.position.y) 2 ), where sqrt is a function used to calculate the square root of a number.
[0075] S303: determining a real-time angular velocity according to the real-time angle difference and a preset first proportional factor, and determining a real-time linear velocity according to the real-time distance and a preset second proportional factor;
[0076] Further, the real-time linear speed and real-time angular speed for mobile control are determined according to the preset proportional factors. Among them, the real-time linear speed is proportional to the real-time distance, and the real-time angular speed is proportional to the real-time angle difference. Specifically, the real-time linear speed calculation formula is: the real-time angular speed calculation formula is: angular_speed=angle_diff×scaling_factor1, scaling_factor1 is the first proportional factor; linear_speed=distance×scaling_factor2, scaling_factor2 is the second proportional factor; the proportional factor is used to adjust the size of the linear speed or angular speed, which can be customized according to actual needs; and then by issuing angular speed and linear speed commands, the robot is controlled to turn to the buffer point and then move in a straight line until it reaches the buffer point; the above formula can prevent the robot from overshooting when approaching the target direction or target point. Therefore, in the process of the robot moving to the buffer point, the distance between the robot and the buffer point is continuously detected. If it is detected that the distance is gradually increasing, it means that the robot may have deviated from the target direction, and remedial measures are taken again; the robot is turned back to the target point by the real-time angle difference, and then the robot is moved back to the target point by calculating the real-time distance.
[0077] S304: Obtaining the dynamic movement control parameter based on the real-time angular velocity and the real-time linear velocity, and controlling the robot to move toward the buffer point using the dynamic movement control parameter.
[0078] During the robot navigation and docking process, how to accurately control the movement and rotation of the robot to ensure that it accurately reaches the target position and docks with the charging base is a technical difficulty; factors such as the robot's motion control accuracy, sensor errors, and environmental interference will affect the docking accuracy; the present application obtains the real-time linear velocity and real-time angular velocity based on the real-time distance and real-time angle difference, and then controls the robot operation according to the real-time linear velocity and real-time angular velocity, which can improve the stability of the operation and improve the accuracy of docking with the charging device.
[0079] In some embodiments, the step of moving to the charging device for charging after reaching the buffer point may include: after reaching the buffer point, determining the direction deviation between the robot and the center point of the target rectangular area; if the direction deviation is greater than a preset direction deviation threshold, redetermining the position information of the buffer point according to the environmental image currently collected by the robot to obtain a new buffer point; using dynamic movement control parameters to control the robot to move to the new buffer point, and moving to the charging device for charging after reaching the new buffer point.
[0080] It is understandable that since the acquisition position corresponding to the environmental image of the target rectangular area extracted for the first time may be far away from the charging device, there may be deviations in the determined posture of the charging device and the posture of the buffer point. Therefore, after reaching the buffer point, the direction deviation between the robot and the center point of the target rectangular area is first determined, that is, when the robot is at the buffer point, whether the robot is facing the charging device. If there is a large direction deviation, directly controlling the robot to drive towards the charging device will cause the robot to collide with the charging device and fail to accurately dock for charging. Therefore, the image can be re-captured and the new buffer point can be re-determined.
[0081] Of course, the time for determining the above-mentioned new buffer point does not necessarily have to be after the robot reaches the buffer point. The position and posture of the charging device can be updated in real time during the robot's movement towards the buffer point, and the position and posture of the buffer point can be adjusted in real time to improve the accuracy of the position and posture of the buffer point and achieve precise docking with the charging base. That is, by receiving the signal that the motor starts charging, the robot's autonomous recharging task is completed, and the entire process does not require human intervention.
[0082] The above-mentioned robot recharging method based on visual detection realizes the function of automatic recharging of the robot by identifying the rectangular feature information on the charging base. Specifically based on image rectangle detection, the rectangular pattern on the charging base is identified by binarizing the camera's data stream, performing contour recognition, rectangle recognition, rectangle extraction and other operations; at the same time, the camera's depth data is subscribed and pixel coordinate conversion is performed to obtain the three-dimensional coordinate position of the charging base from the robot's perspective; finally, the robot speed control method based on distance difference and angle difference is used, and the charging base is continuously positioned during movement, and the motor signal is obtained to realize the docking of the robot and the charging base. The docking of the robot with the charging base can be realized simply, efficiently and at a low cost.
[0083] For example Figure 6The figure shows a flow chart of a robot recharging method, which obtains the grayscale data stream transmitted by the robot camera, generates a binary image through binarization processing, and then performs contour recognition. The rectangular area in the image is detected according to the recognized contour. If the target rectangular area that meets the requirements is not extracted, the subsequent processing is stopped. After the target rectangular area that meets the requirements is extracted, a depth camera is introduced to obtain the depth image of the charging device, the closest depth image is obtained according to the timestamp of the image, and the three-dimensional image of the charging device is obtained through coordinate transformation according to the depth value, and the buffer point is determined; then the dynamic movement control parameters are calculated, that is, the control information used to control the movement of the robot, so as to control the robot to move to the buffer point, and then move from the buffer point to the charging seat. The real-time performance of the system is ensured by efficient algorithms and data structures. At the same time, the robustness of the system is enhanced through multiple detection and correction mechanisms, and it can run stably even in complex environments, and is suitable for a variety of robot application scenarios. In addition, the present application can adopt a modular structure, and each functional module is independent of each other, which is convenient for system maintenance and expansion, and is convenient for customization and expansion according to different needs.
[0084] As can be seen from the above, in this embodiment, an environmental image collected by the robot is obtained, and a target rectangular area is extracted from the environmental image; the target rectangular area is a rectangular area on the charging device corresponding to the robot; the posture information of the charging device is determined according to the position information of the target rectangular area, and the posture information of the buffer point is determined according to the posture information of the charging device; the distance between the buffer point and the charging device is the target length, and is in the same direction as the charging device; the robot is controlled to move to the buffer point by using dynamic movement control parameters, and then moves to the charging device for charging after reaching the buffer point; the dynamic movement control parameters are determined according to the posture information of the robot and the buffer point, including real-time linear velocity and real-time angular velocity. It can be seen that by locating the target rectangular area from the captured image and determining the position and posture of the charging device according to the target rectangular area, the robot and the charging device can be docked based on vision without the need for sensing equipment. On the basis of ensuring the docking accuracy and reliability, the complexity and cost of the system are reduced; by utilizing a buffer point that is at the same target length and position as the charging device, by first moving to the buffer point and then moving from the buffer point to the charging device, the accuracy of the robot's docking with the charging device can be improved; by controlling the movement of the robot through dynamic motion control parameters, that is, controlling the movement of the robot through real-time linear velocity and real-time angular velocity, the stability of the robot's operation in complex environments can be improved, the time consumption of the robot's recharging path can be reduced, and the success rate of the robot's recharging can be improved.
[0085] Correspondingly, the present application also discloses a robot recharging device, see Figure 7 As shown, the device comprises:
[0086] The rectangular area extraction module 11 is used to obtain the environment image collected by the robot and extract the target rectangular area from the environment image; the target rectangular area is the rectangular area on the charging device corresponding to the robot;
[0087] A buffer point determination module 12 is used to determine the position information of the charging device according to the position information of the target rectangular area, and determine the position information of the buffer point according to the position information of the charging device; the distance between the buffer point and the charging device is the target length, and the buffer point is in the same direction as the charging device;
[0088] The mobile control module 13 is used to control the robot to move toward the buffer point using dynamic mobile control parameters, and then move to the charging device for charging after reaching the buffer point; the dynamic mobile control parameters are determined based on the posture information of the robot and the buffer point, including real-time linear velocity and real-time angular velocity.
[0089] As can be seen from the above, in this embodiment, an environmental image collected by the robot is obtained, and a target rectangular area is extracted from the environmental image; the target rectangular area is a rectangular area on the charging device corresponding to the robot; the posture information of the charging device is determined according to the position information of the target rectangular area, and the posture information of the buffer point is determined according to the posture information of the charging device; the distance between the buffer point and the charging device is the target length, and is in the same direction as the charging device; the robot is controlled to move to the buffer point by using dynamic movement control parameters, and then moves to the charging device for charging after reaching the buffer point; the dynamic movement control parameters are determined according to the posture information of the robot and the buffer point, including real-time linear velocity and real-time angular velocity. It can be seen that by locating the target rectangular area from the captured image and determining the position and posture of the charging device according to the target rectangular area, the robot and the charging device can be docked based on vision without the need for sensing equipment. On the basis of ensuring the docking accuracy and reliability, the complexity and cost of the system are reduced; by utilizing a buffer point that is at the same target length and position as the charging device, by first moving to the buffer point and then moving from the buffer point to the charging device, the accuracy of the robot's docking with the charging device can be improved; by controlling the movement of the robot through dynamic motion control parameters, that is, controlling the movement of the robot through real-time linear velocity and real-time angular velocity, the stability of the robot's operation in complex environments can be improved, the time consumption of the robot's recharging path can be reduced, and the success rate of the robot's recharging can be improved.
[0090] In some specific embodiments, the rectangular area extraction module 11 may specifically include:
[0091] A contour acquisition unit, used to obtain all contours contained in the environment image according to the contour recognition result corresponding to the environment image;
[0092] A first screening unit, configured to screen out a first contour set from all contours according to the area of the contour and a preset area threshold;
[0093] A second screening unit, configured to screen out a second contour set from the first contour set according to the number of vertices of contours in the first contour set and a preset target number of vertices;
[0094] A rectangular contour screening unit, used to screen rectangular contours from the second contour set according to the filling rate of each contour in the second contour set; the filling rate is the ratio of the area of the contour to the area of the minimum circumscribed rectangle of the contour;
[0095] The target rectangular outline determining unit is used to determine the target rectangular outline from all the rectangular outlines according to the aspect ratio of the rectangular outlines and the target aspect ratio to obtain the target rectangular area; the target aspect ratio is the aspect ratio of the rectangular area on the charging device.
[0096] In some specific embodiments, the rectangular area extraction module 11 may specifically include:
[0097] An image processing unit, used for performing image processing on the environment image to obtain a processed image; the image processing includes binarization processing and contour recognition in sequence;
[0098] The rectangular area extraction unit is used to extract the target rectangular area from the processed image.
[0099] In some specific embodiments, the buffer point determination module 12 may specifically include:
[0100] an initial three-dimensional coordinate determining unit, configured to determine the three-dimensional coordinates of the charging device in the camera coordinate system of the robot as the initial three-dimensional coordinates according to the position coordinates and depth information of the target rectangular area and the internal parameters of the camera of the robot;
[0101] A coordinate conversion unit is used to obtain the three-dimensional coordinates of the charging device in the world coordinate system through coordinate conversion according to the initial three-dimensional coordinates and the relationship between the camera coordinate system of the robot and the chassis coordinate system of the robot, as the position information of the charging device.
[0102] In some specific embodiments, the buffer point determination module 12 may specifically include:
[0103] A center point three-dimensional coordinate determining unit, used to determine the three-dimensional coordinates of the center point of the target rectangular area in the world coordinate system to obtain the three-dimensional coordinates of the center point;
[0104] A normal vector determining unit, used to determine the normal vector of the target rectangular area according to the three-dimensional coordinates of each rectangular corner point of the target rectangular area in the world coordinate system;
[0105] A buffer point position determination unit is used to determine the position and posture information of the buffer point according to the three-dimensional coordinates of the center point, the normal vector and the target length.
[0106] In some specific embodiments, the movement control module 13 may specifically include:
[0107] A real-time distance determination unit, used to determine a target direction angle of the buffer point relative to the robot and a real-time distance between the robot and the buffer point according to the current coordinates of the robot and the coordinates of the buffer point;
[0108] A real-time angle difference determination unit, used to obtain a real-time angle difference according to a difference between a current direction angle of the robot and the target direction angle;
[0109] a real-time angular velocity determination unit, configured to determine the real-time angular velocity according to the real-time angle difference and a preset first proportional factor, and to determine the real-time linear velocity according to the real-time distance and a preset second proportional factor;
[0110] A mobile control unit is used to obtain the dynamic mobile control parameter based on the real-time angular velocity and the real-time linear velocity, and use the dynamic mobile control parameter to control the robot to move toward the buffer point.
[0111] In some specific embodiments, the movement control module 13 may specifically include:
[0112] A direction deviation determining unit, used to determine the direction deviation between the robot and the center point of the target rectangular area after reaching the buffer point;
[0113] A new buffer point determination unit, configured to re-determine the position information of the buffer point according to the environment image currently collected by the robot to obtain a new buffer point if the direction deviation is greater than a preset direction deviation threshold;
[0114] The mobile control unit is used to control the robot to move to the new buffer point using dynamic mobile control parameters, and then move to the charging device for charging after reaching the new buffer point.
[0115] Furthermore, the present application also discloses an electronic device, see Figure 8 As shown, the contents in the drawings should not be considered as any limitation on the scope of use of the present application.
[0116] Figure 8The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the robot recharging method disclosed in any of the aforementioned embodiments.
[0117] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0118] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222, and data 223 including environmental images, etc. The storage method can be temporary storage or permanent storage.
[0119] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, and it can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the robot recharging method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0120] Furthermore, an embodiment of the present application also discloses a computer storage medium, in which computer executable instructions are stored. When the computer executable instructions are loaded and executed by a processor, the robot recharging method steps disclosed in any of the aforementioned embodiments are implemented.
[0121] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0122] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0123] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0124] The robot recharging method, device, equipment and storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A robot recharging method, characterized in that: include: Acquire an environment image collected by the robot, and extract a target rectangular area from the environment image; the target rectangular area is a rectangular area on a charging device corresponding to the robot; Determine the position information of the charging device according to the position information of the target rectangular area, and determine the position information of the buffer point according to the position information of the charging device; the distance between the buffer point and the charging device is the target length, and the buffer point is in the same direction as the charging device; The robot is controlled to move toward the buffer point using dynamic movement control parameters, and then moves to the charging device for charging after reaching the buffer point; the dynamic movement control parameters are determined based on the posture information of the robot and the buffer point, including real-time linear velocity and real-time angular velocity.
2. The robot recharging method according to claim 1, characterized in that: The step of extracting a target rectangular area from the environment image comprises: Obtaining all contours contained in the environment image according to the contour recognition result corresponding to the environment image; Filtering a first contour set from all contours according to the area of the contour and a preset area threshold; Filtering a second contour set from the first contour set according to the number of vertices of contours in the first contour set and a preset target number of vertices; Filtering rectangular contours from the second contour set according to the filling rate of each contour in the second contour set; the filling rate is the ratio of the area of the contour to the area of the minimum circumscribed rectangle of the contour; According to the aspect ratio of the rectangular outline and the target aspect ratio, a target rectangular outline is determined from all the rectangular outlines to obtain the target rectangular area; the target aspect ratio is the aspect ratio of the rectangular area on the charging device.
3. The robot recharging method according to claim 1, characterized in that: The step of extracting a target rectangular area from the environment image comprises: Performing image processing on the environment image to obtain a processed image; the image processing includes binarization processing and contour recognition in sequence; A target rectangular area is extracted from the processed image.
4. The robot recharging method according to claim 1, characterized in that: The determining the position information of the charging device according to the position information of the target rectangular area includes: Determine the three-dimensional coordinates of the charging device in the camera coordinate system of the robot as initial three-dimensional coordinates according to the position coordinates and depth information of the target rectangular area and the internal parameters of the camera of the robot; According to the initial three-dimensional coordinates and the relationship between the camera coordinate system of the robot and the chassis coordinate system of the robot, the three-dimensional coordinates of the charging device in the world coordinate system are obtained by coordinate conversion as the position information of the charging device.
5. The robot recharging method according to claim 1, characterized in that: The step of determining the position information of the buffer point according to the position information of the charging device includes: Determine the three-dimensional coordinates of the center point of the target rectangular area in the world coordinate system to obtain the three-dimensional coordinates of the center point; Determine the normal vector of the target rectangular area according to the three-dimensional coordinates of each rectangular corner point of the target rectangular area in the world coordinate system; The position and posture information of the buffer point is determined according to the three-dimensional coordinates of the center point, the normal vector and the target length.
6. The robot recharging method according to claim 1, characterized in that: The step of controlling the robot to move toward the buffer point by using dynamic movement control parameters includes: Determine, according to the current coordinates of the robot and the coordinates of the buffer point, a target direction angle of the buffer point relative to the robot, and a real-time distance between the robot and the buffer point; Obtaining a real-time angle difference according to a difference between a current direction angle of the robot and the target direction angle; Determine the real-time angular velocity according to the real-time angle difference and a preset first proportional factor, and determine the real-time linear velocity according to the real-time distance and a preset second proportional factor; The dynamic movement control parameter is obtained based on the real-time angular velocity and the real-time linear velocity, and the dynamic movement control parameter is used to control the robot to move toward the buffer point.
7. The robot recharging method according to any one of claims 1 to 6, characterized in that: The step of moving to the charging device for charging after reaching the buffer point comprises: After reaching the buffer point, determining the direction deviation between the robot and the center point of the target rectangular area; If the direction deviation is greater than a preset direction deviation threshold, re-determine the position and posture information of the buffer point according to the environment image currently collected by the robot to obtain a new buffer point; The robot is controlled to move toward the new buffer point using dynamic movement control parameters, and then moves to the charging device for charging after reaching the new buffer point.
8. A robot recharging device, characterized in that: include: A rectangular area extraction module is used to obtain an environment image collected by the robot and extract a target rectangular area from the environment image; The target rectangular area is a rectangular area on the charging device corresponding to the robot; A buffer point determination module, used to determine the position information of the charging device according to the position information of the target rectangular area, and determine the position information of the buffer point according to the position information of the charging device; The distance between the buffer point and the charging device is a target length, and the buffer point is in the same direction as the charging device; A mobile control module is used to control the robot to move toward the buffer point using dynamic mobile control parameters, and then move to the charging device for charging after reaching the buffer point; the dynamic mobile control parameters are determined based on the posture information of the robot and the buffer point, including real-time linear velocity and real-time angular velocity.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the robot recharging method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein when the computer programs are executed by a processor, the robot recharging method as described in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Charging method, device, equipment, storage medium and program product
CN120178891A