Communication method of robot and robot
Patent Information
- Application Number
- CN202611140855.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-29
- Publication Date
- 2026-10-30
AI Technical Summary
[0006]本申请实施例提供了机器人的通讯方法及机器人,可以解决现有机器人的通信稳定性较差的问题
在本申请实施例中,机器人包括主控制器和多个关节,该多个关节被划分为至少两个模组,且每个模组通过独立的串口对与主控制器连接。当主控制器与任一个模组通信时,该主控制器可通过模组的串口对向该模组发送控制命令,该模组接收控制命令后,再通过串口对向主控制器返回响应数据。由于机器人的模组的数量大于或等于2,而每个模组又具有独立的串口对与主控制器连接,即一个机器人内部至少包括2条链路,因此,即使其中一条链路发生故障,也不会导致该机器人的整体通信中断,从而提高该机器人通信的稳定性。
Smart Images

Figure CN123000790A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of humanoid robot technology, and in particular relates to robot communication methods, robots, computer-readable storage media, and computer program products. Background Technology
[0002] With the rapid development of robotics technology, robots are being used more and more widely in fields such as industrial manufacturing, medical rehabilitation, and home services. In robot systems, coordinated communication between joints is the foundation for achieving complex motion functions.
[0003] In existing technologies, communication between the joints of a robot typically employs a single-link architecture. When the robot performs simple motion tasks, this single-link communication and control method can still meet basic requirements.
[0004] However, as the application scenarios of robots continue to expand, the functions that robots need to perform are becoming increasingly complex. At this point, the coordinated operation of a large number of joints and drive motors is required. During the process of a robot performing complex functions, each joint and motor may experience abnormalities due to communication delays, data packet loss, or hardware failures. If a single-link communication method is still used, it may lead to an overall communication interruption, thus failing to meet the user's application requirements for a high-performance robot system.
[0005] Therefore, a new communication method is needed to solve the above-mentioned technical problems. Summary of the Invention
[0006] This application provides a robot communication method and a robot, which can solve the problem of poor communication stability of existing robots.
[0007] In a first aspect, embodiments of this application provide a communication method for a robot. The robot includes a main controller and multiple joints, the multiple joints being divided into at least two modules, and each module being connected to the main controller via an independent serial port. The communication method for the robot includes: For any of the modules, the main controller sends control commands to the module through the module's serial port; After receiving the control command, the module returns response data to the main controller through the serial port.
[0008] The beneficial effects of the embodiments in this application compared with the prior art are: In this embodiment, the robot includes a main controller and multiple joints, which are divided into at least two modules. Each module is connected to the main controller via an independent serial port. When the main controller communicates with any module, it can send control commands to that module via its serial port. After receiving the control commands, the module returns response data to the main controller via its serial port. Since the robot has at least two modules, and each module has an independent serial port connected to the main controller (meaning at least two links exist within the robot), even if one link fails, the overall communication of the robot will not be interrupted, thus improving the stability of the robot's communication.
[0009] Secondly, embodiments of this application provide a robot, which includes a main controller and multiple joints, wherein the multiple joints are divided into at least two modules, and each module is connected to the main controller through an independent serial port. For any of the modules, the main controller sends control commands to the module through the module's serial port; After receiving the control command, the module returns response data to the main controller through the serial port.
[0010] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect.
[0011] Fourthly, embodiments of this application provide a computer program product that, when run on a robot, causes the robot to perform the method described in the first aspect.
[0012] It is understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0014] Figure 1 This is a flowchart illustrating a robot communication method provided in an embodiment of this application; Figure 2 This is a schematic diagram illustrating the connection between the head module and the main controller of a robot according to an embodiment of this application; Figure 3 This is a schematic diagram illustrating the connection between multiple modules of a robot and a main controller according to an embodiment of this application; Figure 4This is a schematic diagram of the structure of a robot provided in one embodiment of this application. Detailed Implementation
[0015] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0016] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0017] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0018] Furthermore, in the description of this application and the appended claims, the terms "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0019] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.
[0020] Currently, robots come in various forms and can perform an increasing number of functions. When the robot's main controller communicates with each joint using a single-link architecture, the lack of redundant channels means that a failure in that link will cause an overall communication interruption, resulting in poor communication stability for the robot.
[0021] To improve the communication stability of robots, this application provides a robot communication method. In this method, multiple joints of the robot are divided into at least two modules, and each module is connected to the main controller through an independent serial port. That is, the robot includes at least two links, and the main controller can communicate with the corresponding module through these two links respectively.
[0022] Because the robot contains at least two links, the failure of one link will not cause the robot's overall communication to be interrupted.
[0023] The communication method of the robot provided in the embodiments of this application will be described below with reference to the accompanying drawings.
[0024] Figure 1 This illustration shows a flowchart of a robot communication method according to an embodiment of this application. The robot of this embodiment includes a main controller and multiple joints, which are divided into at least two modules. Each module is connected to the main controller via an independent serial port. The robot communication method provided in this embodiment is described in detail below: S11, for any of the above modules, the main controller sends control commands to the module through the module's serial port.
[0025] S12, after receiving the control command, the module returns response data to the main controller through the serial port.
[0026] In this embodiment, the rules for assigning joints to corresponding modules may include: assigning joints based on their location. For example, when the robot is a humanoid robot, if joint 1 is located in the head of the humanoid robot and the module corresponding to the head is a head module, then joint 1 is assigned to the head module; if joint 2 is located in the hand of the humanoid robot and the module corresponding to the hand is a hand module, then joint 1 is assigned to the hand module. The above assignment rules may also include: assigning joints based on their function. For example, if joint 3's function is grasping, then joint 3 can be assigned to the hand module.
[0027] In this embodiment, each module has one independent pair of serial ports (i.e., two serial ports) connected to the main controller, meaning that the various joints within each module are connected in a loopback manner. The module can send response data to the main controller through one of these two serial ports. This response data may include a heartbeat response, or it may include result information after executing control commands from the main controller; this is not limited here.
[0028] Optionally, different modules can communicate with the main controller through different threads, that is, the main controller can communicate with different modules in parallel through multiple threads to improve resource utilization.
[0029] In this embodiment, the robot includes a main controller and multiple joints, which are divided into at least two modules. Each module is connected to the main controller via an independent serial port. When the main controller communicates with any module, it can send control commands to that module via its serial port. After receiving the control commands, the module returns response data to the main controller via its serial port. Since the robot has at least two modules, and each module has an independent serial port connected to the main controller (meaning at least two links exist within the robot), even if one link fails, the overall communication of the robot will not be interrupted, thus improving the stability of the robot's communication.
[0030] In this embodiment, the joints within the module are connected in series to form a joint connection, enabling the module to receive control commands and send response data through the same serial port, or to receive control commands and send response data through different serial ports.
[0031] In some embodiments, when the module receives control commands and sends response data through the same serial port (assuming it is through the first serial port in the serial port pair), the main controller sends control commands to the module through the serial port pair of the module. Specifically, the main controller sends control commands to each joint of the module sequentially through the first serial port in the serial port pair of the module. Correspondingly, after receiving the control command, the module returns response data to the main controller through the serial port. Specifically, after receiving the control command, the joint of the module returns response data to the main controller through the first serial port.
[0032] like Figure 2 As shown, the robot's head module includes n joints, which are connected in series to form a joint chain and are connected to the main controller via serial port 1 and serial port 2. If the first serial port is... Figure 2 If serial port 1 is used, the head module receives control commands sent by the main controller through serial port 1 and sends response data to the main controller through serial port 1. In this embodiment, the main controller sends control commands to each joint involved in the current task in the module one by one. For example, assuming that the joints involved in the current task are joint 1 and joint 2, after the main controller sends a control command to joint 1 through serial port 1, joint 1 sends response data to the main controller through serial port 1. After the main controller sends a control command to joint 2 through serial port 1 and joint 1, joint 2 sends response data to the main controller through joint 1 and serial port 1.
[0033] In some embodiments, the distances between the joints involved in the currently executed task and the two serial ports can be calculated separately, and then the distances for each serial port can be summed to obtain the corresponding distance sum. Finally, based on this distance sum, the serial port in the serial port pair is selected for receiving control commands and sending response data. Optionally, after calculating the sum of the distances between the joints involved in the currently executed task and the two serial ports in the serial port pair, the serial port corresponding to the shortest distance sum is selected as the serial port for receiving control commands and sending response data. For example, if the joints involved in the currently executed task include joint 1 and joint 2, then the distance between joint 1 and serial port 1 is 1, and the distance between joint 2 and serial port 1 is 2, that is, the sum of the distances between the joints involved in the currently executed task and serial port 1 is "1+2=3". The distance between joint 1 and serial port 2 is n, and the distance between joint 2 and serial port 2 is (n-1). Therefore, the sum of the distances between the joints involved in the currently executed task and serial port 2 is "n + (n-1) = 2n-1". If this sum is less than (2n-1), then serial port 1 is selected as the serial port for receiving control commands and sending response data. Since the serial port for receiving control commands and sending response data is selected based on the sum of the distances between the joints involved in the currently executed task and the serial port, and since the sum of distances is related to the data transmission duration, the serial port selected in this way is more suitable for obtaining a data transmission duration that better matches the currently executed task.
[0034] In some embodiments, when receiving control commands and sending response data through different serial ports, the main controller sends control commands to the module through the serial port pair of the module, specifically including: the main controller sends control commands to each joint of the module sequentially through the first serial port of the serial port pair of the module. Correspondingly, after receiving the control command, the module returns response data to the main controller through the serial port pair. Specifically, after receiving the control command, the joint of the module returns response data to the main controller through the second serial port of the serial port pair.
[0035] refer to Figure 2 Assuming the first serial port mentioned above is Figure 2 Serial port 1, the second serial port mentioned above is Figure 2 Serial port 2 is used for communication between the head module and the main controller. The head module receives control commands from the main controller via serial port 1 and sends response data back to the main controller via serial port 2. For example, when the main controller sends a control command to joint 1 via serial port 1, joint 1 sends response data back to the main controller via joint 2, joint 3, ..., joint n, and serial port 2. When the main controller sends a control command to joint 2 via serial port 1 and joint 1, joint 2 sends response data back to the main controller via joint 3, joint 4, and serial port 2. The communication process between other joints in the head module and the main controller is similar to that of joints 1 and 2, and will not be described further here.
[0036] In this embodiment, since control commands can be received and response data can be sent through the same serial port or different serial ports, the number of communication link options is increased, thereby improving the flexibility of communication link selection.
[0037] In some embodiments, the sum of distances between the joints involved in the currently executed task when receiving control commands and sending response data through the same serial port can be calculated, as well as the sum of distances between the joints involved in the currently executed task when receiving control commands and sending response data through different serial ports can be calculated. Then, the communication method is selected based on the shortest sum of distances. For example, assuming the currently executed task involves joints 1 and 2, if the receiving and sending of control commands and response data are done through the same serial port, the sum of their corresponding distances is 3 (through...). Figure 2 (Serial port 1 is used for receiving control commands and sending response data) and (2n-1) (via Figure 2 (The serial port 2 is used for receiving control commands and sending response data). If control commands are received and response data are sent through different serial ports, the sum of their corresponding distances is (2n+2). The serial port involved in the communication method corresponding to the minimum value among "3", "(2n-1)", and "2n+2" is used for receiving control commands and sending response data. After data transmission through the serial port selected in the above manner, it is beneficial to obtain a data transmission duration that is more matched to the currently executed task.
[0038] After selecting a serial port and transmitting data, abnormal situations may occur, such as those caused by malfunctions in the communication line or the joint itself. Therefore, to increase the probability of successful execution of the current task, if an abnormality is detected during the execution of the current task, an alternative communication link should be promptly used. That is, after the main controller sends control commands sequentially to each joint of the module through the first serial port of the module's serial port pair, the process also includes: If no response data is received from the joint within a preset time period, the main controller sends control commands to each joint of the module sequentially through the second serial port of the module's serial port pair.
[0039] The preset duration can be set according to actual needs, and is not limited here.
[0040] In this embodiment, if the current task involves joints 1, 2, and 3, and after sending control commands to joints 1, 2, and 3 via the first serial port, only response data is received from joint 1 within a preset time period, with no response data received from joints 2 and 3, then it is determined that joint 2 itself is malfunctioning or that the communication line between joints 1 and 2 is malfunctioning. Subsequently, the aforementioned control commands will be sent to the malfunctioning joints (i.e., joints 2 and 3) via the second serial port. (See reference...) Figure 2 If, within a preset time period after sending control commands to joints 1, 2, and 3 via serial port 1, the main controller only receives response data returned by joint 1 via serial port 1, but does not receive response data returned by joints 2 and 3 via serial port 1, then it will choose to send control commands to joints 3 and 2 via serial port 2.
[0041] Since no response data is received from all joints involved in the current task within a preset time period, it indicates that there are abnormal joints among these joints. Therefore, the main controller can improve the probability of successful communication by changing the serial port of communication (changing the first serial port to the second serial port) to communicate with the joints in the module that have not returned response data.
[0042] In some embodiments, if the main controller still cannot receive response data from the target joint after communicating with the module via a different serial port, it indicates that there is an abnormality in the target joint of the module. In this case, the user needs to be reminded to repair the target joint. That is, after sending control commands sequentially to each joint of the module through the second serial port of the module's serial port pair, the process further includes: If no response data is received from the target joint within the preset time period, the main controller outputs maintenance information containing the identity of the target joint. The target joint is the joint that has not sent the response data to the main controller within the preset time period after the main controller has sent control commands to the joints of the module one by one through the first and second serial ports of the module's serial port pair.
[0043] In this embodiment, the output maintenance information can be output via audio. When the robot includes a display screen, it can also be output via text or video; no limitation is made here. Since the output includes maintenance information identifying the target joint, it facilitates timely maintenance of the target joint by the user.
[0044] In some embodiments, after sending control commands sequentially to each joint of the module via the second serial port of the module's serial port pair, the method further includes: If no response data is received from the target joint within the preset time period, the main controller selects whether to continue executing the current task based on the importance of the target joint in the current task. The target joint is the joint that has not sent the response data to the main controller within the preset time period after the main controller has sent control commands to the joints of the module one by one through the first and second serial ports of the module's serial port pair.
[0045] In this embodiment, a task-joint association mapping can be pre-established, which characterizes the importance of each joint under different tasks. When an anomaly is detected in a target joint, the association mapping is queried according to the currently executed task to determine the importance of the target joint in the current task. A higher importance indicates a greater impact of the joint on the successful execution of the current task, and vice versa. Optionally, the importance can be represented by levels. For example, the most important joint in the current task can be set to level one, and the less important joints can be set to level two. Of course, the number of levels can also be set according to actual needs, and the levels that meet the importance requirements of which tasks can be selected based on the number of levels and the type of task.
[0046] In this embodiment, if the importance of the target joint in the current task is determined to meet a preset importance requirement, the current task is stopped; otherwise, the current task continues. Since the current task is not immediately stopped when an abnormality is detected in the joint, this improves the efficiency of successful task execution.
[0047] In some embodiments, after choosing to stop the current task, it can be determined whether the next task can be executed. If so, the next task is executed. For example, if the current task is a grasping task and the next task is to return to the initial position, if it is determined that an abnormality in the target joint prevents the grasping task from being executed, it is then determined whether the return to the initial position task can be executed. If so, the return to the initial position task is executed; otherwise, the robot is kept at its current position, awaiting repair. For example, if the robot is a humanoid robot and the abnormal target joint is the fingertip, since an abnormality in the fingertip joint will affect the successful execution of the grasping task, the grasping task is paused. Since the fingertip does not affect the humanoid robot's movement (if an abnormality is found in the humanoid robot's shoulder joint, an abnormal shoulder joint may cause the humanoid robot to collide with obstacles during movement, thus affecting its movement), the return to the initial position task will be executed if the joints of the humanoid robot's leg module can communicate effectively (i.e., if it can move). This configuration helps improve the timeliness of the execution of each task.
[0048] In some embodiments, considering that when the robot is a humanoid robot, its movement depends on the effective communication between the joints in the leg module of the humanoid robot, in order to improve the reliability of the communication between the joints in the leg module, two adjacent joints in the leg module can be connected in parallel, wherein one of the two parallel links is used as the default communication link and the other is used as the backup communication link.
[0049] like Figure 3 As shown, the humanoid robot includes a head module, a left hand module, a right hand module, a waist module, a left leg module, and a right leg module. The head module is connected to the main controller via serial ports 1 and 2, and its n joints are connected in series to form a joint chain. The left hand module is connected to the main controller via serial ports 3 and 4, and its n joints are connected in series to form a joint chain. The right hand module is connected to the main controller via serial ports 5 and 6, and its n joints are connected in series to form a joint chain. The waist module is connected to the main controller via serial ports 7 and 8, and its two joints are connected in series. The left leg module is connected to the main controller via serial ports 9 and 10, and its two adjacent joints are connected in parallel. The right leg module is connected to the main controller via serial ports 9 and 10, and its two adjacent joints are connected in parallel.
[0050] from Figure 3It is known that any two adjacent joints within the left and right leg modules are connected in parallel. In practice, these two links can be adjusted according to the actual situation. This design helps reduce the probability of the humanoid robot falling, thus greatly enhancing its safety. Taking joints 1 and 2 in the right leg module as an example, the main controller can send control commands to joints 1 and 2 via serial port 11 and the default link, as well as via serial port 11 and the backup link, serial port 12 and the default link, and also via serial port 12 and the backup link. This means the main controller can send control commands to joint 2 via four links. Only if all four links malfunction will the main controller be unable to control joint 2.
[0051] It should be pointed out that, in Figure 3 In this context, the number of joints contained in each module can be set according to the actual situation, and there is no limit here.
[0052] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0053] Figure 4 This is a schematic diagram of the structure of a robot provided in one embodiment of this application. Figure 4 As shown, the robot 4 in this embodiment includes: a main controller 41 and at least two modules 42. Figure 4 Only two modules are shown in the image, and each module includes at least two joints.
[0054] Optionally, multiple joints within the module are connected in series to form a joint chain.
[0055] The main controller sends control commands to the module through the serial port of the module, including: the main controller sends control commands to each joint of the module sequentially through the first serial port of the serial port pair of the module. After receiving the control command, the module returns response data to the main controller through the serial port, including: after receiving the control command, the joint of the module returns response data to the main controller through the first serial port.
[0056] Optionally, multiple joints within the module are connected in series to form a joint chain, and the main controller sends control commands to the module via the module's serial port, including: The main controller sends control commands sequentially to each joint of the module through the first serial port of the serial port pair of the module. After receiving the control command, the module returns response data to the main controller through the serial port, including: after receiving the control command, the joint of the module returns response data to the main controller through the second serial port of the serial port pair.
[0057] Optionally, after the main controller sends control commands sequentially to each joint of the module via the first serial port of the module's serial port pair, the method further includes: If no response data is received from the joint within a preset time period, the main controller sends control commands to each joint of the module sequentially through the second serial port of the module's serial port pair.
[0058] Optionally, after sending control commands sequentially to each joint of the module via the second serial port of the module's serial port pair, the method further includes: If no response data is received from the target joint within the preset time period, the main controller outputs maintenance information containing the identity of the target joint. The target joint is the joint that has not sent the response data to the main controller within the preset time period after the main controller has sent control commands to the joints of the module one by one through the first and second serial ports of the module's serial port pair.
[0059] Optionally, after sending control commands sequentially to each joint of the module via the second serial port of the module's serial port pair, the method further includes: If no response data is received from the target joint within the preset time period, the main controller selects whether to continue executing the current task based on the importance of the target joint in the current task. The target joint is the joint that has not sent the response data to the main controller within the preset time period after the main controller has sent control commands to the joints of the module one by one through the first and second serial ports of the module's serial port pair.
[0060] Optionally, the robot is a humanoid robot, the module includes a leg module, and two adjacent joints in the leg module are connected in parallel, wherein one of the two parallel links is used as the default communication link and the other is used as a backup communication link.
[0061] The robot 4 described above can be a humanoid robot, a wheeled robot, a tracked robot, etc. The robot may also include a memory. Those skilled in the art will understand that... Figure 4The example shown is merely of robot 4 and does not constitute a limitation on robot 4. It may include more or fewer parts than shown, or combine certain parts, or different parts, such as input / output devices, network access devices, etc.
[0062] The main controller 41 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0063] In some embodiments, the aforementioned memory may be an internal storage unit of the robot 4, such as a hard disk or memory of the robot 4. In other embodiments, the aforementioned memory may be an external storage device of the robot 4, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the robot 4. Furthermore, the aforementioned memory may include both internal storage units and external storage devices of the robot 4. The aforementioned memory is used to store operating systems, applications, bootloaders, data, and other programs, such as the program code of the aforementioned computer programs. The aforementioned memory can also be used to temporarily store data that has been output or will be output.
[0064] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the above device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0065] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps in the various method embodiments described above.
[0066] This application provides a computer program product that, when run on a robot, enables the robot to perform the steps described in the various method embodiments above.
[0067] If the integrated units described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, 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 computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographing device / robot, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0068] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0069] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0070] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0071] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
Claims
1. A communication method for a robot, characterized in that, The robot includes a main controller and multiple joints, which are divided into at least two modules. Each module is connected to the main controller via an independent serial port. The robot's communication method includes: For any of the modules, the main controller sends control commands to the module through the module's serial port; After receiving the control command, the module returns response data to the main controller through the serial port.
2. The robot communication method as described in claim 1, characterized in that, The multiple joints within the module are connected in series to form a joint chain. The main controller sends control commands to the module through the module's serial port, including: the main controller sends control commands to each joint of the module sequentially through the first serial port of the module's serial port pair. After receiving the control command, the module returns response data to the main controller through the serial port, including: after receiving the control command, the joint of the module returns response data to the main controller through the first serial port.
3. The robot communication method as described in claim 1, characterized in that, Multiple joints within the module are connected in series to form a joint chain. The main controller sends control commands to the module via the module's serial port, including: The main controller sends control commands to each joint of the module sequentially through the first serial port of the serial port pair of the module. After receiving the control command, the module returns response data to the main controller through the serial port pair, including: after receiving the control command, the joint of the module returns response data to the main controller through the second serial port in the serial port pair.
4. The robot communication method as described in claim 2, characterized in that, After the main controller sends control commands sequentially to each joint of the module via the first serial port of the module's serial port pair, the method further includes: If no response data is received from the joint within a preset time period, the main controller sends control commands to each joint of the module sequentially through the second serial port of the module's serial port pair.
5. The robot communication method as described in claim 4, characterized in that, After sending control commands sequentially to each joint of the module via the second serial port in the serial port pair of the module, the method further includes: If no response data is received from the target joint within the preset time period, the main controller outputs maintenance information containing the identity identifier of the target joint. The target joint is the joint that has not sent the response data to the main controller within the preset time period after the main controller sends control commands to each joint of the module sequentially through the first and second serial ports of the module's serial port pair.
6. The robot communication method as described in claim 4, characterized in that, After sending control commands sequentially to each joint of the module via the second serial port in the serial port pair of the module, the method further includes: If no response data is received from the target joint within the preset time period, the main controller selects whether to continue executing the current task based on the importance of the target joint in the current task. The target joint is the joint that has not sent the response data to the main controller within the preset time period after the main controller has sent control commands to the joints of the module one by one through the first and second serial ports of the module's serial port pair.
7. The communication method for a robot as described in any one of claims 1 to 6, characterized in that, The robot is a humanoid robot, and the module includes a leg module. Two adjacent joints in the leg module are connected in parallel. Of the two parallel links, one is used as the default communication link and the other is used as a backup communication link.
8. A robot, characterized in that, The robot includes a main controller and multiple joints, the multiple joints being divided into at least two modules, and each module being connected to the main controller via an independent serial port. For any of the modules, the main controller sends control commands to the module through the module's serial port; After receiving the control command, the module returns response data to the main controller through the serial port.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.
10. A computer program product, characterized in that, Includes a computer program, which, when run, causes the robot to perform the method according to any one of claims 1 to 7.
