Robot control method and device, electronic equipment and storage medium
By setting up cameras on the robot to identify target feature codes and determining the relative positional relationship between the robot and the feature codes, the problem of the robot's inability to accurately judge dangers during movement is solved, and real-time prevention and avoidance of dangers is achieved.
Patent Information
- Application Number
- CN202310913424.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-24
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-07-24
AI Technical Summary
In existing technologies, robots have difficulty accurately judging whether there is danger during movement, which may lead to accidents such as falls.
By setting up cameras on the robot to acquire images of its direction of travel in real time, identifying target feature codes, and judging whether there is danger based on the positional relationship of the feature codes, the robot is controlled to change its mode of travel.
This enables the robot to accurately assess dangers during its movement, effectively preventing accidents such as falls.
Smart Images

Figure CN116834012B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of robotics, and in particular to a robot control method, apparatus, electronic devices and storage media applied to robots. Background Technology
[0002] With the development of robotics technology, robots have emerged for various applications. These include robots that can move autonomously, ride escalators, and climb stairs. However, these robots face the challenge of entering dangerous areas during their movement; for example, they might fall off escalators or even plummet to the ground floor. Currently, methods for accurately determining whether a robot poses a danger are not very accurate. Therefore, there is an urgent need for a more accurate method to assess the potential hazards of a robot's movement.
[0003] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0004] Therefore, it is necessary to provide a robot control method, device, electronic device and storage medium applied to the robot that can accurately determine whether there is danger during the robot's movement, in order to address the above-mentioned technical problems.
[0005] A robot control method includes: acquiring images of the robot's travel direction in real time via a camera; the camera being mounted on the robot; when at least one target feature code is extracted from the image, determining the position information of the at least one target feature code in the camera coordinate system corresponding to the camera; determining the relative positional relationship between the robot and the target feature code based on the positional information; if the relative positional relationship meets preset conditions, determining that the robot may be in danger, and controlling the robot to change its travel mode.
[0006] In one embodiment, the target feature code includes a first feature code and a second feature code, wherein the first feature code is an identifier code for a first orientation, and the second feature code is an identifier code for a second orientation; determining the relative positional relationship between the robot and the target feature code based on the position information includes: determining the orientation and depth of view of any one of the first feature code and the second feature code in the camera coordinate system based on the position information; and determining the relative positional relationship between the robot and the target feature code based on the orientation and / or depth of view of any one of the first feature code and the second feature code.
[0007] In one embodiment, if the relative positional relationship meets a preset condition, determining that the robot is potentially dangerous and controlling the robot to change its mode of travel includes: if, based on the relative positional relationship, it is determined that the depth of vision of at least one of the first feature code and the second feature code is less than a first depth of vision threshold and greater than a second depth of vision threshold, then determining that the robot is heading towards a dangerous area and controlling the robot to reduce its travel speed.
[0008] In one embodiment, after determining that the robot is heading towards a dangerous area and controlling the robot to reduce its speed, the method further includes: determining an updated relative position relationship based on the robot's current travel state; if the updated relative position relationship determines that the first feature code is located in a second position or the second feature code is located in a first position, or that the depth of view of both the first feature code and the second feature code is greater than a first depth of view threshold, then the robot is determined to be leaving the dangerous area, and the robot is controlled to reduce its speed until the depth of view of both the first feature code and the second feature code is greater than or equal to the first depth of view threshold.
[0009] In one embodiment, after determining that the robot is heading towards a dangerous area and controlling the robot to reduce its speed, the method further includes: determining an updated relative position relationship based on the robot's current travel state; if the updated relative position relationship determines that the first feature code is located in a first position and the second feature code is located in a second position, and that the depth of view of at least one of the first feature code and the second feature code is less than the second depth of view threshold, then the robot is determined to have entered a dangerous area, and the robot is controlled to stop traveling in the current direction.
[0010] In one embodiment, after acquiring images of the robot's direction of travel in real time via a camera, the method further includes: acquiring first feature information in the image; when it is determined from the first feature information that there is a target region in the image that matches the target type feature code, acquiring second feature information from the target region; the second feature information includes feature code identification information in the target region; when it is determined that the feature code identification information meets preset conditions, determining that the target region is the region where the target feature code is located.
[0011] In one embodiment, determining the position information of the at least one target feature code in the camera coordinate system corresponding to the camera includes: determining the coordinate value and attitude angle of the at least one target feature code in the camera coordinate system corresponding to the camera; determining the distance and angle between the at least one target feature code and the camera based on the coordinate value and the attitude angle, thereby obtaining the position information.
[0012] A robot control device includes: an image acquisition module for acquiring images of the robot's travel direction in real time via a camera; a position information determination module for determining the position information of at least one target feature code in the camera coordinate system corresponding to the camera when at least one target feature code is extracted from the image; a position relationship determination module for determining the relative position relationship between the robot and the target feature code based on the position information; and a robot control module for determining that the robot may be in danger and controlling the robot to change its travel mode if the relative position relationship meets preset conditions.
[0013] An electronic device for use in a robot includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: acquiring images of the robot's direction of travel in real time via a camera; the camera is mounted on the robot; when at least one target feature code is extracted from the image, determining the position information of the at least one target feature code in the camera coordinate system corresponding to the camera; determining the relative positional relationship between the robot and the target feature code based on the position information; if the relative positional relationship meets a preset condition, determining that the robot may be in danger, and controlling the robot to change its mode of travel.
[0014] A computer-readable storage medium storing a computer program, which, when executed by a processor, performs the following steps: acquiring images of a robot's direction of travel in real time via a camera; the camera being mounted on the robot; when at least one target feature code is extracted from the image, determining the position information of the at least one target feature code in the camera coordinate system corresponding to the camera; determining the relative positional relationship between the robot and the target feature code based on the position information; if the relative positional relationship meets preset conditions, determining that the robot may be in danger, and controlling the robot to change its mode of travel.
[0015] The aforementioned robot control method acquires images of the robot's direction of travel in real time using a camera mounted on the robot. When a target feature code is extracted from the image, the relative positional relationship between the robot and the extracted target feature code is determined. If the relative positional relationship meets preset conditions, it is determined that the robot may be in danger, and the robot's movement mode is changed. That is, during the robot's movement, the method can accurately determine whether the robot is in danger by combining the recognition status of the feature code and the relative positional relationship between the feature code and the robot in real time, thereby controlling the robot's movement mode and effectively keeping the robot away from danger. Correspondingly, the robot control device, electronic equipment applied to the robot, and storage medium provided in this application also have the above-mentioned technical effects. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating a robot control method in one embodiment;
[0017] Figure 2 This is a schematic diagram illustrating the application of a label in one embodiment;
[0018] Figure 3 This is an application scenario diagram of the robot control method in one embodiment;
[0019] Figure 4 This is a structural block diagram of a robot control device in one embodiment;
[0020] Figure 5 This is an internal structural diagram of an electronic device applied to a robot in one embodiment. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0022] The robot control method provided in this application can be applied to application environments that include intelligent robots. The intelligent robot is equipped with a camera and electronic devices with computing capabilities. During the robot's movement, the camera can acquire images in real time along the robot's direction of travel. The electronic devices analyze the images, and when a target feature code is identified, determine the relative positional relationship between the robot and the target feature code. Furthermore, if this relative positional relationship meets preset conditions, it is determined that the robot may be in danger, and the robot is controlled to change its mode of travel.
[0023] In one embodiment, such as Figure 1 As shown, a robot control method is provided. This embodiment illustrates the application of this method to an electronic device installed within a robot. It is understood that this method can also be applied to a standalone terminal device, a server, or a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices, and the server can be a standalone server or a server cluster consisting of multiple servers.
[0024] In this embodiment, the method includes the following steps:
[0025] S101, The camera is used to acquire images of the robot's direction of travel in real time; the camera is mounted on the robot.
[0026] The camera can be mounted on one side of the robot. As the robot moves in a certain direction, the camera takes real-time pictures to obtain the corresponding images.
[0027] S102, when at least one target feature code is extracted from the image, the position information of the at least one target feature code in the camera coordinate system corresponding to the camera is determined.
[0028] In one embodiment, after acquiring images of the robot's direction of travel in real time via a camera, the method further includes: acquiring first feature information in the image; when it is determined from the first feature information that there is a target region in the image that matches the target type feature code, acquiring second feature information from the target region; the second feature information includes feature code identification information in the target region; when it is determined that the feature code identification information meets preset conditions, determining that the target region is the region where the target feature code is located.
[0029] Optionally, the camera may capture multiple images in real time. The electronic device can analyze each image sequentially, or it can acquire images from the image set at fixed intervals and analyze them sequentially.
[0030] The feature code can be various identification codes with specific characteristics, such as QR codes, barcodes, and Apriltag (a visual reference system) labels. In this embodiment, in order to achieve high-precision target localization and attitude estimation in complex environments, the target type feature code may include an Apriltag label.
[0031] Apriltag labels have corners, and these corners contain characteristic patterns. These can be used as feature information for Apriltag labels. The first feature information can be the image's color, pixel values, etc., based on which the presence of corners in the image can be determined. Further, after acquiring the first feature information of the image, the electronic device compares it with the feature information of the Apriltag label. When it is determined that corners exist in the first feature information, and the arrangement of these corners matches the feature information of the Apriltag label, it is determined that a target region matching the Apriltag label exists in the image. This corner and its internal area are the target region.
[0032] The second feature information includes the number and number of feature codes. When it is determined that there is a target region in the image that matches the target type feature code, it is determined whether the number or number of feature codes in the target region meets the preset conditions, such as: there are at least two feature codes, or the feature code number matches the preset conditions. Then, it is determined that the target region is the region where the target feature code is located. The target feature code is used to identify the danger zone.
[0033] In one embodiment, determining the position information of the at least one target feature code in the camera coordinate system corresponding to the camera includes: determining the coordinate value and attitude angle of the at least one target feature code in the camera coordinate system corresponding to the camera; determining the distance and angle between the at least one target feature code and the camera based on the coordinate value and the attitude angle, thereby obtaining the position information.
[0034] The coordinate values and attitude angles constitute the six degrees of freedom of the target feature code. Specifically, the coordinate values can be the x, y, and z coordinates of the target feature code in the camera coordinate system; the attitude angles can be the pitch, yaw, and roll angles of the target feature code in the camera coordinate system. The electronic device determines the distance and angle between the target feature code and the camera based on these six degrees of freedom, and then calculates the distance and angle of the target feature code relative to the robot, thus obtaining the aforementioned position information.
[0035] S103, determine the relative positional relationship between the robot and the target feature code based on the position information.
[0036] In one embodiment, the target feature code includes a first feature code and a second feature code, wherein the first feature code is an identifier code for a first orientation, and the second feature code is an identifier code for a second orientation; determining the relative positional relationship between the robot and the target feature code based on the position information includes: determining the orientation and depth of view of any one of the first feature code and the second feature code in the camera coordinate system based on the position information; and determining the relative positional relationship between the robot and the target feature code based on the orientation and / or depth of view of any one of the first feature code and the second feature code.
[0037] Furthermore, when the first or second feature code is identified, its distribution position in the camera coordinate system (e.g., located on the left or right side of the image) is determined based on its corresponding position information, serving as its orientation. Additionally, its depth of view in the camera coordinate system is determined based on its corresponding position information. Then, the relative positional relationship between the robot and the feature code is determined based on at least one of the orientation and depth of view.
[0038] Optionally, when at least two target feature codes are identified, the relative positional relationship between the robot and the target feature code can be determined based on the orientation and / or depth of view of the target feature code closest to the robot, and this can be used as the relative positional relationship between the robot and the target feature code, thereby determining whether the robot is dangerous.
[0039] Optionally, the first feature code can be a label on the left, and the second feature code can be a label on the right. That is, the first feature code is affixed to the left side of the robot's direction of travel, and the second feature code is affixed to the right side of the robot's direction of travel. When image recognition determines that the first feature code is affixed to the left and the second feature code is affixed to the right, it is determined that the robot is moving towards or has entered the area corresponding to the feature code.
[0040] Optionally, the target signature can be affixed near the danger zone. For example... Figure 2 As shown, the target signature can be pasted in the following manner:
[0041] 1. With the robot facing the hazardous area, the left-side label should be affixed to the left side, and the right-side label should be affixed to the right side; this should ensure that the following conditions are met:
[0042] 1) The surface should be flat and free of wrinkles or twists;
[0043] 2) Angle: Vertical (the label must be vertical and must not be rotated);
[0044] 3) Height: The minimum height of the label is 67cm and the maximum height is 90cm (calculated based on the distance from the bottom of the label to the ground, with an ideal height of 90cm from the ground) to ensure that the label is within the field of view of the robot's camera.
[0045] 2. Confirm that the robot can see the complete label from 1.5 meters in front of the danger zone (measured from the label's placement position).
[0046] By using the above-mentioned labeling method, the robot's electronic equipment can recognize the label even when it is far away from the danger zone, and then determine whether the robot is potentially dangerous based on its relative position to the label.
[0047] S104, if the relative positional relationship meets the preset conditions, it is determined that the robot may be in danger, and the robot is controlled to change its mode of travel.
[0048] The preset condition can be a distance condition. When it is determined that the robot is close to the target feature code, it can be judged that the robot may be in danger. Furthermore, this distance condition can be divided into stages, for example, including a first distance condition (greater than a first depth-of-view threshold), a second distance condition (less than the first depth-of-view threshold but greater than the second depth-of-view threshold), and a third distance condition (less than the second depth-of-view threshold). Further, when the relative positional relationship meets the first distance condition, it is determined that the robot is far from the danger zone; when the relative positional relationship meets the second distance condition, it is determined that the robot is close to the danger zone; when the relative positional relationship meets the third distance condition, it is determined that the robot has entered the danger zone.
[0049] Optionally, the first depth-of-view threshold is greater than the second depth-of-view threshold. The first depth-of-view threshold can be 3 meters, and the second depth-of-view threshold can be 1.5 meters.
[0050] In one embodiment, the step of determining that the robot is potentially dangerous and controlling it to change its mode of travel if the relative positional relationship meets a preset condition includes: if, based on the relative positional relationship, at least one of the first feature code and the second feature code has a depth of vision less than a first depth of vision threshold and greater than a second depth of vision threshold, then the robot is determined to be heading towards a dangerous area (e.g., ...). Figure 3 Scene A in the middle, Figure 3 The arrow on the robot indicates its direction of travel, and the area formed by the two diagonal dashed lines is the camera's field of view; the area between the two vertical lines in the robot's viewpoint indicates the robot's direction of travel, and the direction the arrow on the label points indicates that the distance between the label and the robot is decreasing, thus controlling the robot to reduce its speed. When only one feature's depth of view is less than the first depth of view threshold but greater than the second depth of view threshold, it indicates that the robot is moving from one side towards a danger zone (e.g., ...). Figure 3 Scene B in the story.
[0051] In one embodiment, after determining that the robot is heading towards a dangerous area and controlling the robot to reduce its speed, the method further includes: determining an updated relative position relationship based on the robot's current travel state; if the updated relative position relationship determines that the first feature code is located in a second position or the second feature code is located in a first position, or if the depth of view of both the first feature code and the second feature code is greater than a first depth of view threshold, then it is determined that the robot is leaving the dangerous area (e.g., Figure 3 In scenario C), the robot is controlled to reduce its travel speed until the depth of view of both the first feature code and the second feature code is greater than or equal to the first depth of view threshold.
[0052] Furthermore, after determining that the robot is heading towards a dangerous area, the relative positional relationship between the target feature code and the robot is updated in real time. When it is determined that the robot is leaving the dangerous area and the relative positional relationship still meets the second distance condition, it continues to move at the reduced speed. When it is determined that the relative positional relationship no longer meets the second distance condition but meets the third distance condition, the control on reducing the robot's speed can be released, allowing it to return to normal speed.
[0053] In one embodiment, after determining that the robot is heading towards a dangerous area and controlling the robot to reduce its speed, the method further includes: determining an updated relative position relationship based on the robot's current travel state; if the updated relative position relationship determines that the first feature code is located in a first position and the second feature code is located in a second position, and that the depth of view of at least one of the first feature code and the second feature code is less than the second depth of view threshold, then the robot is determined to have entered a dangerous area, and the robot is controlled to stop traveling in the current direction.
[0054] Furthermore, after determining that the robot is heading towards a dangerous area, the relative positional relationship between the target feature code and the robot is updated in real time. When it is determined that the relative positional relationship meets the third distance condition and the left label is on the left and the right label is on the right, it is determined that the robot has entered the dangerous area, and the robot is controlled to stop moving in the current direction, that is, the robot is pulled to a stop.
[0055] In one embodiment, determining that the robot is potentially dangerous and controlling it to change its mode of travel if the relative positional relationship meets a preset condition includes: if, based on the relative positional relationship, at least one of the first feature code and the second feature code has a depth of view less than a first depth of view threshold and greater than a second depth of view threshold, and the first feature code is located in a first orientation and the second feature code is located in a second orientation, then determining that the robot is heading towards a dangerous area and controlling the robot to reduce its speed; determining an updated relative positional relationship based on the robot's current travel state; if, based on the updated relative positional relationship, at least one of the first feature code and the second feature code has a depth of view less than the second depth of view threshold, then determining that the robot has entered a dangerous area and controlling the robot to stop moving towards the current orientation.
[0056] Furthermore, when it is determined that the second distance condition is met and the left label is on the left and the right label is on the right, it is determined that the robot is heading towards a dangerous area, and the robot is controlled to reduce its speed. The relative position relationship between the target feature code and the robot is updated in real time. When it is determined that the robot meets the third distance condition, it is determined that the robot has entered a dangerous area, and the robot is controlled to stop moving in the current direction, that is, the robot is pulled to a stop.
[0057] The method further includes determining the relative positional relationship between the robot and the target feature code based on the location information, and if it is determined based on the relative positional relationship that the depth of view of both the first feature code and the second feature code is greater than a first depth of view threshold, or the first feature code is located in a second position or the second feature code is located in a first position, then it is determined that the robot is far away from the danger zone and can continue to maintain the robot's movement mode.
[0058] In the aforementioned robot control method, a camera mounted on the robot acquires images of the robot's direction of travel in real time. When a target feature code is extracted from the image, the relative positional relationship between the robot and the extracted target feature code is determined. If the relative positional relationship meets preset conditions, it is determined that the robot may be in danger, and the robot's movement mode is changed. During the robot's movement, the system can accurately determine whether the robot is in danger by combining the recognition status of the feature code and the relative positional relationship between the feature code and the robot in real time, thereby controlling the robot's movement mode. This can effectively keep the robot away from danger, for example, it can effectively prevent the robot from falling into an elevator.
[0059] This application also provides an application scenario in which the above-described robot control method is applied.
[0060] Specifically, the robot control method is applied in this application scenario as follows:
[0061] I. Label Selection:
[0062] The feature code is selected from Apriltag tags. There are many types of Apriltag tags. The recognition principle is to record the characteristics of each type of tag, extract the corner points in the image captured by the camera, and find the part where the arrangement of the corner points is similar to the tag characteristics. This is the area where the Apriltag tag is located.
[0063] The issue to consider here is that many tags have features that are very common in the environment and can be easily misidentified even without a specific tag being posted. Therefore, we should try to avoid this situation as much as possible, choose tags with fewer features that are misidentified, and at the same time ensure that the features are not too difficult to identify, so as to prevent the situation where the tag cannot be identified even if it is posted.
[0064] After extensive data collection and testing in environments where no tags were posted, approximately 200,000 false recognition records were collected. The number of false recognitions for different tags was compiled and sorted from highest to lowest ('tag id': number of false recognitions) as follows:
[0065] {'17':196904,'37':21476,'34':1981,'10':1824,'1':868,'38':755,'22':418,'16':276,'24':167,'49':145,'28':144,'42':142,'45':142,'41':138,'44':111,'13':108,'12':101,'30':91,'29':68,'40':64,'26':50,'33':4 8,'21':48,'32':47,'31':45,'2':39,'3':37,'8':35,'15':33,'7':32,'9':30,'47':21,'19':18,'48':16,'11':16,'27':14,'5':14,'23':13,'6':10,'0':8,'14':8,'35':7,'25':6,'36':5,'20':4,'43':4,'46':3,'4':3,'18':1}
[0066] Based on the above data, tags 21 and 6 were selected to complete the subsequent recognition logic.
[0067] II. Affix labels in the following manner:
[0068] 1. With the robot facing the direction of the fall area, affix tag #21 (left) to the left side of the escalator entrance and tag #6 (right) to the right side of the escalator entrance.
[0069] 2. At a distance of 1.5 meters in front of the danger zone, confirm that the robot can see the complete label from its perspective.
[0070] III. Robot Control Process:
[0071] 1. When tag number 21 or 6 is detected and the z (depth of view) of the tag in the camera coordinate system is calculated to be less than 3m, the robot is controlled to slow down to ensure that when the robot is in a dangerous area, it can see a clear tag image and stop immediately.
[0072] 2. Real-time updates of the relative positions of tags and the robot; that is, risk analysis is performed based on the identified tag's position in the image. If a tag on the left is located on the right side of the image, or a tag on the right is located on the left side, it is assumed the robot has only seen the tag but is not moving towards the danger zone, and therefore does not stop. If a tag on the left is located on the left side of the image, and a tag on the right is located on the right side, it is assumed the robot has seen the tag and is approaching the danger zone.
[0073] 3. Continue to update the relative positional relationship between the tag and the robot. When the z (depth of view) of the tag is less than 1.5m, and the tag on the left is located on the left side of the image and the tag on the right is located on the right side of the image, it is considered that the robot has entered the danger zone and the robot is stopped.
[0074] The above solution, by adding identifiable labels, allows the robot to identify the specific April tag through a camera, helping it determine its position at the escalator entrance and triggering subsequent actions such as pulling to stop or leaving, effectively preventing the robot from falling off the escalator.
[0075] It should be understood that although the steps in the flowchart above are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps.
[0076] Based on the same idea as the robot control method in the above embodiments, the present invention also provides a robot control device that can be used to execute the above robot control method. For ease of explanation, the structural schematic diagram of the robot control device embodiment only shows the parts related to the embodiments of the present invention. Those skilled in the art will understand that the illustrated structure does not constitute a limitation on the device, and it may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0077] In one embodiment, such as Figure 4 As shown, a robot control device is provided. This device can be a software module, a hardware module, or a combination of both, integrated into the robot. Specifically, the device includes:
[0078] The image acquisition module 401 is used to acquire images of the robot's direction of travel in real time via a camera;
[0079] The position information determination module 402 is used to determine the position information of the at least one target feature code in the camera coordinate system corresponding to the camera when at least one target feature code is extracted from the image;
[0080] The position relationship determination module 403 is used to determine the relative position relationship between the robot and the target feature code based on the position information;
[0081] The robot control module 404 is used to determine that the robot is potentially dangerous if the relative positional relationship meets preset conditions, and to control the robot to change its mode of travel.
[0082] In the aforementioned robot control device, a camera mounted on the robot acquires images of the robot's direction of travel in real time. When a target feature code is extracted from the image, the relative positional relationship between the robot and the extracted target feature code is determined. If the relative positional relationship meets preset conditions, it is determined that the robot may be in danger, and the robot's movement mode is changed. During the robot's movement, the device can accurately determine whether there is danger by combining the recognition status of the feature code and the relative positional relationship between the feature code and the robot in real time, thereby controlling the robot's movement mode and effectively keeping the robot away from danger.
[0083] In one embodiment, the target feature code includes a first feature code and a second feature code, wherein the first feature code is an identifier code for a first orientation, and the second feature code is an identifier code for a second orientation; the position relationship determination module includes: an information determination submodule, used to determine the orientation and depth of view of any one of the first feature code and the second feature code in the camera coordinate system based on the position information; and a position relationship determination submodule, used to determine the relative position relationship between the robot and the target feature code based on the orientation and / or depth of view of any one of the first feature code and the second feature code.
[0084] In one embodiment, the robot control module includes a deceleration control submodule, configured to determine that the robot is heading toward a dangerous area if, based on the relative positional relationship, at least one of the first feature code and the second feature code has a depth of view less than a first depth of view threshold and greater than a second depth of view threshold, and control the robot to reduce its travel speed.
[0085] In one embodiment, the robot control module further includes: a first positional relationship update submodule, configured to determine an updated relative positional relationship based on the robot's current travel state; and a distance control submodule, configured to determine that the robot is leaving a dangerous area if, based on the updated relative positional relationship, the first feature code is located in a second orientation or the second feature code is located in a first orientation, or if the depth of view of both the first feature code and the second feature code is greater than a first depth of view threshold, and control the robot to reduce its travel speed until the depth of view of both the first feature code and the second feature code is greater than or equal to the first depth of view threshold.
[0086] In one embodiment, the robot control module further includes: a second positional relationship update submodule, configured to determine an updated relative positional relationship based on the robot's current travel state; and a stop travel control submodule, configured to determine that the robot has entered a danger zone and control the robot to stop traveling in the current direction if, based on the updated relative positional relationship, the first feature code is located in a first orientation and the second feature code is located in a second orientation, and the depth of view of at least one of the first feature code and the second feature code is less than a second depth of view threshold.
[0087] In one embodiment, the device further includes: a first feature information acquisition module, configured to acquire first feature information in the image; a second feature information acquisition module, configured to acquire second feature information from the target region when it is determined from the first feature information that there is a target region in the image that conforms to a target type feature code; the second feature information includes feature code identification information in the target region; and a feature code judgment module, configured to determine that the target region is the region where the target feature code is located when it is determined that the feature code identification information conforms to a preset condition.
[0088] In one embodiment, the position information determination module includes: a pose determination submodule, used to determine the coordinate values and attitude angles of the at least one target feature code in the camera coordinate system corresponding to the camera; and a position information determination submodule, used to determine the distance and angle between the at least one target feature code and the camera based on the coordinate values and the attitude angle, thereby obtaining the position information.
[0089] Specific limitations regarding the robot control device can be found in the limitations of the robot control method described above, and will not be repeated here. Each module in the aforementioned robot control device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the robot's processor in hardware form or independent of it, or stored in the robot's memory in software form, so that the processor can call and execute the operations corresponding to each module.
[0090] In one embodiment, an electronic device for use in a robot is provided, the internal structure of which can be shown in the following diagram. Figure 5As shown, the electronic device includes a processor, memory, communication interface, display screen, and input device connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements an electronic device control method. The display screen can be a liquid crystal display (LCD) or an e-ink display. The input device can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the device's casing, or an external keyboard, touchpad, or mouse. Of course, the electronic device may also include mobile devices or other components for implementing other functions; these will not be elaborated further in this embodiment.
[0091] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0092] In one embodiment, an electronic device for use with a robot is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0093] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0094] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0095] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0096] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A robot control method, characterized in that, The method includes: The robot's direction of travel is captured in real time by a camera; the camera is mounted on the robot. When at least one target feature code is extracted from the image, the position information of the at least one target feature code in the camera coordinate system corresponding to the camera is determined. Specifically, this includes: determining the coordinate values and attitude angles of the at least one target feature code in the camera coordinate system corresponding to the camera; determining the distance and angle between the at least one target feature code and the camera based on the coordinate values and the attitude angles to obtain the position information; the coordinate values and attitude angles constitute the information of the six degrees of freedom of the target feature code, where the coordinate values are x, y, and z of the target feature code in the camera coordinate system; the attitude angles can be the pitch angle, yaw angle, and roll angle of the target feature code in the camera coordinate system. The electronic device determines the distance and angle of the target feature code from the camera based on the information of these six degrees of freedom, and then calculates the distance and angle of the target feature code relative to the robot to obtain the position information. The relative positional relationship between the robot and the target feature code is determined based on the location information; If the relative positional relationship meets the preset conditions, it is determined that the robot is potentially dangerous, and the robot is controlled to change its mode of travel. The target feature code includes a first feature code and a second feature code, wherein the first feature code is an identifier code for a first location and the second feature code is an identifier code for a second location. Determining the relative positional relationship between the robot and the target feature code based on the position information includes: Based on the location information, determine the orientation and depth of view of either the first feature code or the second feature code in the camera coordinate system; The relative positional relationship between the robot and the target feature code is determined based on the orientation and / or the depth of view of either the first feature code or the second feature code. If the relative positional relationship meets a preset condition, it is determined that the robot may be in danger, and the robot is controlled to change its mode of travel, including: If, based on the relative positional relationship, it is determined that the depth of view of at least one of the first feature code and the second feature code is less than a first depth of view threshold and greater than a second depth of view threshold, then it is determined that the robot is heading towards a dangerous area, and the robot is controlled to reduce its speed; wherein, the first depth of view threshold is 3 meters, and the second depth of view threshold is 1.5 meters; After determining that the robot is heading towards a dangerous area and controlling the robot to reduce its speed, the process further includes: The updated relative positional relationship is determined based on the robot's current travel state; If, based on the updated relative positional relationship, it is determined that the first feature code is located in the second position or the second feature code is located in the first position, or if the depth of view of both the first feature code and the second feature code is greater than the first depth of view threshold, then it is determined that the robot is leaving the danger zone, and the robot is controlled to reduce its speed until the depth of view of both the first feature code and the second feature code is greater than or equal to the first depth of view threshold. If, based on the updated relative positional relationship, it is determined that the first feature code is located in the first orientation and the second feature code is located in the second orientation, and the depth of view of at least one of the first feature code and the second feature code is less than the second depth of view threshold, then it is determined that the robot has entered a dangerous area, and the robot is controlled to stop moving in the current direction.
2. The method according to claim 1, characterized in that, After acquiring images of the robot's direction of travel in real time via a camera, the method further includes: Obtain the first feature information in the image; When it is determined from the first feature information that there is a target region in the image that matches the target type feature code, second feature information is obtained from the target region; the second feature information includes feature code identification information in the target region. When it is determined that the feature code identification information meets the preset conditions, the target area is determined to be the area where the target feature code is located.
3. A robot control device, characterized in that, The device includes: The image acquisition module is used to acquire images of the robot's direction of travel in real time via a camera; A position information determination module is used to determine the position information of at least one target feature code in the camera coordinate system corresponding to the camera when at least one target feature code is extracted from the image. Specifically, this includes: determining the coordinate values and attitude angles of the at least one target feature code in the camera coordinate system corresponding to the camera; determining the distance and angle between the at least one target feature code and the camera based on the coordinate values and attitude angles to obtain the position information; the coordinate values and attitude angles constitute the information of six degrees of freedom of the target feature code, where the coordinate values are x, y, and z of the target feature code in the camera coordinate system; the attitude angles can be the pitch angle, yaw angle, and roll angle of the target feature code in the camera coordinate system. The electronic device determines the distance and angle of the target feature code from the camera based on this information of six degrees of freedom, and then calculates the distance and angle of the target feature code relative to the robot to obtain the position information; the target feature code includes a first feature code and a second feature code, where the first feature code is an identifier code for a first orientation, and the second feature code is an identifier code for a second orientation. A positional relationship determination module is used to determine the relative positional relationship between the robot and the target feature code based on the position information; determine the orientation and depth of view of any one of the first feature code and the second feature code in the camera coordinate system based on the position information; and determine the relative positional relationship between the robot and the target feature code based on the orientation and / or depth of view of any one of the first feature code and the second feature code. A robot control module is used to determine that the robot may be in danger if the relative positional relationship meets preset conditions, and control the robot to change its movement mode; if the depth of view of at least one of the first feature code and the second feature code is determined to be less than a first depth of view threshold and greater than a second depth of view threshold based on the relative positional relationship, then determine that the robot is heading towards a dangerous area, and control the robot to reduce its speed; wherein the first depth of view threshold is 3 meters, and the second depth of view threshold is 1.5 meters. After determining that the robot is heading towards a dangerous area and controlling the robot to reduce its speed, the process further includes: The updated relative positional relationship is determined based on the robot's current travel state; If, based on the updated relative positional relationship, it is determined that the first feature code is located in the second position or the second feature code is located in the first position, or if the depth of view of both the first feature code and the second feature code is greater than the first depth of view threshold, then it is determined that the robot is leaving the danger zone, and the robot is controlled to reduce its speed until the depth of view of both the first feature code and the second feature code is greater than or equal to the first depth of view threshold. If, based on the updated relative positional relationship, it is determined that the first feature code is located in the first orientation and the second feature code is located in the second orientation, and the depth of view of at least one of the first feature code and the second feature code is less than the second depth of view threshold, then it is determined that the robot has entered a dangerous area, and the robot is controlled to stop moving in the current direction.
4. An electronic device for use in a robot, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 2.
5. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 2.
Citation Information
Patent Citations
Method for identifying dangerous area by robot, robot and storage medium
CN111055284A
Automatic escalator avoidance early warning method for robot
CN113341983A
Robot movement control method and device, equipment and storage medium
CN113485350A
