A hierarchical cascade startup method, device, equipment and storage medium

Through the hierarchical cascade startup method of ROS2 nodes, the startup files are arranged in a hierarchical manner and the startup sequence are controlled, which solves the problem of bloated node startup files and work coupling, and the orderly hierarchical cascade startup is achieved, reducing the difficulty of system maintenance.

CN114968403BActive Publication Date: 2025-08-05AUTOMOTIVE INTELLIGENCE & CONTROL OF CHINA CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210565941.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-20
Publication Date
2025-08-05
Estimated Expiration
2042-05-20

AI Technical Summary

Technical Problem

In the prior art, all node startups of subsystems are organized in a launch file for orchestration, resulting in bloated file and coupled with the work of each group, increasing the difficulty and workload of subsequent system maintenance.

Method used

By hierarchically orchestrating the startup files of each node group and subsystem, a first-level, second-level and third-level startup files are generated. The ROS2 nodes are hierarchically cascaded startup based on these file sets, the startup sequence is controlled, and orderly startup is achieved through the interaction between the launch system and the controlled nodes.

Benefits of technology

It effectively solves the problem of file bloat and work coupling, reduces system maintenance difficulty, reduces maintenance workload, and realizes orderly hierarchical cascading startup.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114968403B_ABST
    Figure CN114968403B_ABST
Patent Text Reader

Abstract

The present invention discloses a hierarchical cascade startup method, device, equipment and storage medium, wherein the method comprises: arranging the script content of the first-level startup file of each node in each node group to generate a first-level startup file set; arranging the second-level startup file of each node group in each subsystem to generate a second-level startup file set; arranging the third-level startup file in each subsystem to generate a third-level startup file set; and performing hierarchical cascade startup of ROS2 nodes according to the first-level startup file set, the second-level startup file set and the third-level startup file set. The present invention determines the startup order of the secondary startup files by defining the startup description order, thereby controlling the startup order of each subsystem, effectively realizing hierarchical cascade startup, solving the problems of file bloat and work coupling of each group caused by organizing the node startup of all subsystems in one startup file, and reducing the difficulty and workload of subsequent system maintenance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a hierarchical cascade startup method, device, equipment and storage medium. Background Art

[0002] During the process of conceiving and implementing this application, the inventors discovered that prior art, based on the scripting characteristics of the launch system (startup file) of ROS2 (Robot Operating System II), combined with the state machine characteristics of managed nodes, can achieve an orderly startup of all nodes based on their dependencies. However, organizing the startup of all subsystem nodes in a single launch file results in a bloated file and coupled work between different groups, significantly increasing the difficulty and workload of subsequent system maintenance and hindering subsequent maintenance.

[0003] The preceding description is intended to provide general background information and does not necessarily constitute prior art. Summary of the Invention

[0004] The technical problem to be solved by the embodiments of the present invention is to provide a hierarchical cascade startup method, device, equipment and storage medium, which can solve the problems of file bloat and work coupling of various groups caused by organizing the node startup of all subsystems in one launch file.

[0005] To solve the above problem, a first aspect of an embodiment of the present application provides a hierarchical cascade startup method, comprising at least the following steps:

[0006] Scripting the first-level startup file of each node in each node group to generate a first-level startup file set, wherein the first-level startup file set includes at least one first-level startup file;

[0007] Arranging the secondary startup files of each node group in each subsystem to generate a secondary startup file set, wherein the secondary startup files include at least one of the secondary startup files;

[0008] Arranging the three-level startup files in each subsystem to generate a three-level startup file set, wherein the three-level startup files include at least one three-level startup file;

[0009] The ROS2 nodes are started in a hierarchical cascade manner according to the first-level startup file set, the second-level startup file set, and the third-level startup file set.

[0010] In a possible implementation of the first aspect, performing hierarchical cascade startup of the ROS2 node according to the first-level startup file set, the second-level startup file set, and the third-level startup file set includes:

[0011] Running the first-level startup file set to determine whether all first-level startup files in the first-level startup file set have been started;

[0012] When it is determined that all the first-level startup files in the first-level startup file set have been started, running the second-level startup file set to determine whether all the second-level startup files in the second-level startup file set have been started;

[0013] When it is determined that all the second-level startup files in the second-level startup file set have been started, the third-level startup file set is run to perform hierarchical cascade startup of the ROS2 nodes.

[0014] In a possible implementation of the first aspect, the hierarchical cascade startup of the ROS2 nodes includes:

[0015] Obtaining first startup information of the ROS2 node, and determining whether a corresponding managed node instance needs to be created according to the first startup information of the ROS2 node;

[0016] If so, create a managed node instance corresponding to the ROS2 node, create a managed node according to the managed node instance and trigger a state transition, thereby completing the hierarchical cascade startup between the ROS2 node and the managed node;

[0017] If not, start the corresponding managed node according to the managed node instance.

[0018] In a possible implementation of the first aspect, obtaining first startup information of the ROS2 node, and determining whether a corresponding managed node instance needs to be created according to the first startup information of the ROS2 node includes:

[0019] Start the ROS2 node and create a startup description file corresponding to the ROS2 node;

[0020] It is determined whether the managed node instance in the ROS2 node has been created according to the startup description file.

[0021] In a possible implementation of the first aspect, creating a managed node instance corresponding to the ROS2 node includes:

[0022] Create a managed node declaration and a managed event delegation corresponding to the ROS2 node in sequence;

[0023] Adding the created managed node declaration and managed event delegation to the startup description file;

[0024] Add the startup description file after adding the managed node declaration and managed event delegation to the startup service.

[0025] In a possible implementation of the first aspect, creating a managed node according to the managed node instance and triggering a state transition to complete hierarchical cascade startup between the ROS2 node and the managed node includes:

[0026] Create a managed node corresponding to the ROS2 node according to the managed node instance;

[0027] Instantiating the created managed node and converting the state of the managed node to a created state;

[0028] Return to the ROS2 node to run the managed node instance, and switch the state of the managed node to the configuration state;

[0029] Returning to the ROS2 node to run the managed event delegate, switching the state of the managed node to the activated state;

[0030] Return to the ROS2 node to run the managed event delegate and start the managed node.

[0031] In a possible implementation of the first aspect, the hierarchical cascade startup of the ROS2 nodes further includes:

[0032] Determining whether the managed node is successfully started;

[0033] When it is determined that the managed node is successfully started, the remaining subordinate managed nodes of the ROS2 node are started.

[0034] Accordingly, a second aspect of the embodiments of the present application provides a hierarchical cascade starting device, comprising:

[0035] A node startup module, configured to script the first-level startup files of each node in each node group to generate a first-level startup file set, wherein the first-level startup file set includes at least one first-level startup file;

[0036] A node group startup module, configured to compile the secondary startup files of each node group in each subsystem to generate a secondary startup file set, wherein the secondary startup files include at least one of the secondary startup files;

[0037] A subsystem startup module is used to arrange the three-level startup files in each subsystem to generate a three-level startup file set, wherein the three-level startup files include at least one three-level startup file;

[0038] The cascade startup module is used to perform hierarchical cascade startup of ROS2 nodes according to the first-level startup file set, the second-level startup file set and the third-level startup file set.

[0039] A third aspect of the embodiments of the present application further proposes a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any of the above-mentioned hierarchical cascade startup methods when executing the computer program.

[0040] A fourth aspect of the embodiments of the present application further proposes a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned hierarchical cascade startup methods are implemented.

[0041] Implementation of the embodiments of the present invention has the following beneficial effects: The embodiments of the present invention provide a hierarchical cascade startup method, apparatus, device, and storage medium, comprising: arranging the script content of the primary startup file for each node in each node group to generate a primary startup file set; arranging the secondary startup file for each node group in each subsystem to generate a secondary startup file set; arranging the tertiary startup file for each subsystem to generate a tertiary startup file set; and performing a hierarchical cascade startup of ROS2 nodes based on the primary, secondary, and tertiary startup file sets. The embodiments of the present invention determine the startup order of secondary startup files by defining the order of startup descriptions, thereby controlling the startup order of each subsystem. The launch system interacts with the controlled node through a "control-state transfer-event monitoring" process, achieving orderly startup of the two nodes and effectively implementing hierarchical cascade startup. Furthermore, the method adds the ability to determine the active status of dependent nodes, avoiding repeated startup of dependent nodes. This method solves the problems of file bloat and work coupling between groups caused by organizing the startup of all subsystem nodes in a single startup file, reduces the difficulty and workload of subsequent system maintenance, and facilitates subsequent system maintenance. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 This is a flowchart of a hierarchical cascade startup method according to an embodiment of the present application;

[0043] Figure 2 A flowchart of a method for implementing a hierarchical cascade startup according to an embodiment of the present application is shown;

[0044] Figure 3 This is a schematic block diagram of the structure of a hierarchical cascade starting device according to an embodiment of the present application;

[0045] Figure 4 This is a schematic block diagram of the structure of a computer device according to an embodiment of the present application.

[0046] The realization of the objectives, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0048] In the description of this application, it should be understood that the terms "first," "second," etc. are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Thus, a feature defined as "first," "second," etc. may explicitly or implicitly include one or more of the features. In the description of this application, unless otherwise specified, "plurality" means two or more.

[0049] The embodiments of the present application can be applied to a server. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0050] First, the application scenarios that the present invention can provide are introduced, such as providing a hierarchical cascade startup method, device, equipment and storage medium, which can determine the startup order of secondary startup files by defining the order of startup descriptions, thereby controlling the startup order of each subsystem and effectively realizing hierarchical cascade startup.

[0051] The first embodiment of the present invention:

[0052] See also Figure 1 .

[0053] like Figure 1 As shown, this embodiment provides a hierarchical cascade startup method, which includes at least the following steps:

[0054] S1. Scripting the first-level startup file of each node in each node group to generate a first-level startup file set, wherein the first-level startup file set includes at least one first-level startup file;

[0055] S2. Arrange the secondary startup files of each node group in each subsystem to generate a secondary startup file set, wherein the secondary startup files include at least one secondary startup file;

[0056] S3. Arrange the three-level startup files in each subsystem to generate a three-level startup file set, wherein the three-level startup files include at least one three-level startup file;

[0057] S4. Perform hierarchical cascade startup of the ROS2 nodes according to the first-level startup file set, the second-level startup file set, and the third-level startup file set.

[0058] In the prior art, based on the scripting characteristics of the launch system of ROS2 and combined with the state machine characteristics of the managed nodes, it is possible to achieve the orderly startup of all bytes based on dependency relationships. However, if the node startups of all subsystems are organized in one launch file for arrangement, the file will be bloated and the work of each group will be coupled, which will greatly increase the difficulty and workload of subsequent system maintenance and be detrimental to subsequent maintenance. In order to solve the above technical problems, this embodiment determines the startup order of the secondary startup files by defining the order of the startup descriptions, controls the startup order of each subsystem, and interacts with the launch system and the controlled nodes. Through the process of "control-state transfer-event monitoring", the orderly startup of the two nodes is achieved, effectively realizing hierarchical cascade startup. At the same time, the judgment of the active state of the dependent nodes is added to avoid repeated startup of the dependent nodes. It solves the problems of bloated files and coupled work of each group caused by organizing the node startups of all subsystems in one startup file, reduces the difficulty of subsequent system maintenance, reduces the workload of maintenance, and is beneficial to subsequent system maintenance.

[0059] Specifically, for step S1, the script content of the first-level startup file of each node in each node group is first arranged to generate a first-level startup file set, which includes at least one first-level startup file; each launch file takes the startup of a single node as the unit, and in the specific script content arrangement, the specified header file is first embedded in the source file and the launch file of its dependent node, and then the launch file itself is started.

[0060] In step S2, the secondary startup files of each node group in each subsystem are arranged to generate a secondary startup file set, wherein the secondary startup file includes at least one secondary startup file; each subsystem is responsible for the launch file arrangement of its own node group.

[0061] For step S3, the three-level startup files in each subsystem are arranged to generate a three-level startup file set, which includes at least one three-level startup file; the middleware group is responsible for the launch file arrangement of the entire subsystem, that is, determining the startup order between groups.

[0062] In step S4, the hierarchical cascade startup of the ROS2 nodes is performed according to the first-level startup file set, the second-level startup file set, and the third-level startup file set, and the hierarchical cascade startup of the ROS2 nodes is determined according to the startup order between the groups.

[0063] In a specific embodiment, the node startup dependency unit is the launch file. The startup script at this level will continue to execute only when all nodes responsible for the secondary launch file embedded in the source file by the designated header file are fully started.

[0064] In a preferred embodiment, the step of performing hierarchical cascade startup of ROS2 nodes according to the first-level startup file set, the second-level startup file set, and the third-level startup file set includes:

[0065] Running the first-level startup file set to determine whether all first-level startup files in the first-level startup file set have been started;

[0066] When it is determined that all the first-level startup files in the first-level startup file set have been started, running the second-level startup file set to determine whether all the second-level startup files in the second-level startup file set have been started;

[0067] When it is determined that all the second-level startup files in the second-level startup file set have been started, the third-level startup file set is run to perform hierarchical cascade startup of the ROS2 nodes.

[0068] Specifically, step S4 includes: running the first-level startup file set, and determining whether all the first-level startup files in the first-level startup file set have been fully started during the running process; if so, running the second-level startup file set, and determining whether all the second-level startup files in the second-level startup file set have been fully started during the running process; if so, running the third-level startup file set, and performing hierarchical cascade startup on the ROS2 nodes by implementing step-by-step associated startup of the first-level startup file set, the second-level startup file set, and the third-level startup file set.

[0069] In a preferred embodiment, the hierarchical cascade startup of the ROS2 nodes includes:

[0070] Obtaining first startup information of the ROS2 node, and determining whether a corresponding managed node instance needs to be created according to the first startup information of the ROS2 node;

[0071] If so, create a managed node instance corresponding to the ROS2 node, create a managed node according to the managed node instance and trigger a state transition, thereby completing the hierarchical cascade startup between the ROS2 node and the managed node;

[0072] If not, start the corresponding managed node according to the managed node instance.

[0073] Specifically, the hierarchical cascade startup process of the ROS2 node includes: first obtaining the first startup information of the ROS2 node, and then judging whether it is necessary to create a corresponding managed node instance based on the first startup information; when it is judged that a managed node instance needs to be created, creating a managed node instance corresponding to the ROS2 node, and creating a corresponding managed node based on the created managed node instance, and then performing a state trigger conversion to complete the hierarchical cascade startup between the ROS2 node and the managed node; when it is judged that it is not necessary to create a managed node instance, directly starting the corresponding managed node based on the managed node instance.

[0074] In a preferred embodiment, the obtaining of the first startup information of the ROS2 node and determining whether a corresponding managed node instance needs to be created according to the first startup information of the ROS2 node include:

[0075] Start the ROS2 node and create a startup description file corresponding to the ROS2 node;

[0076] It is determined whether the managed node instance in the ROS2 node has been created according to the startup description file.

[0077] Specifically, the process of determining whether a corresponding managed node instance needs to be created based on the first startup information of the ROS2 node includes: starting the ROS2 node and creating a startup description file corresponding to the ROS2 node; and then determining whether the managed node instance in the current ROS2 node has been created based on the startup description file.

[0078] In a preferred embodiment, the step of creating a managed node instance corresponding to the ROS2 node includes:

[0079] Create a managed node declaration and a managed event delegation corresponding to the ROS2 node in sequence;

[0080] Adding the created managed node declaration and managed event delegation to the startup description file;

[0081] Add the startup description file after adding the managed node declaration and managed event delegation to the startup service.

[0082] Specifically, the process of creating a managed node instance corresponding to a ROS2 node includes: first creating a managed node declaration corresponding to the ROS2 node, and then creating a managed event delegate; adding both the managed node declaration and the managed event delegate to the startup description file, and after the addition is completed, adding the startup description file to the startup service.

[0083] In a preferred embodiment, the step of creating a managed node according to the managed node instance and triggering a state transition to complete the hierarchical cascade startup between the ROS2 node and the managed node includes:

[0084] Create a managed node corresponding to the ROS2 node according to the managed node instance;

[0085] Instantiating the created managed node and converting the state of the managed node to a created state;

[0086] Return to the ROS2 node to run the managed node instance, and switch the state of the managed node to the configuration state;

[0087] Returning to the ROS2 node to run the managed event delegate, switching the state of the managed node to the activated state;

[0088] Return to the ROS2 node to run the managed event delegate and start the managed node.

[0089] In a specific embodiment, a managed node is created according to the managed node instance and a state transition is triggered to complete the hierarchical cascade startup between the ROS2 node and the managed node as follows: run the startup service, create a managed node corresponding to the ROS2 node according to the managed node instance; instantiate the created managed node, and convert the state of the managed node to the creation state; return to the ROS2 node to run the managed node instance, trigger the managed node to convert the state to the configuration state, and switch the state of the managed node to the configuration state; return to the ROS2 node to run the managed event delegation, trigger the managed node to convert the state to the activated state, and switch the state of the managed node to the activated state; return to the ROS2 node to run the managed event delegation, and start the managed node.

[0090] In a preferred embodiment, the hierarchical cascade startup of the ROS2 nodes further includes:

[0091] Determining whether the managed node is successfully started;

[0092] When it is determined that the managed node is successfully started, the remaining subordinate managed nodes of the ROS2 node are started.

[0093] In a specific embodiment, each time the managed node corresponding to the ROS2 node is started, it is determined whether the managed node is successfully started. When it is determined that the managed node is successfully started, the hierarchical cascade startup method is repeated to continue starting the remaining subordinate managed nodes of the ROS2 node until all subordinate managed nodes are successfully started.

[0094] This embodiment provides a hierarchical cascade startup method, comprising: arranging the script content of the first-level startup file of each node in each node group to generate a first-level startup file set; arranging the second-level startup file of each node group in each subsystem to generate a second-level startup file set; arranging the third-level startup file in each subsystem to generate a third-level startup file set; and performing a hierarchical cascade startup of ROS2 nodes based on the first-level startup file set, the second-level startup file set, and the third-level startup file set. This embodiment determines the startup order of the secondary startup files by defining the startup description sequence, controls the startup order of each subsystem, and interacts with the controlled node through the "control-state transfer-event monitoring" process to achieve orderly startup of the two nodes, effectively implementing hierarchical cascade startup. At the same time, it adds the determination of the active status of dependent nodes to avoid repeated startup of dependent nodes. This solves the problems of file bloat and work coupling of various groups caused by organizing the startup of all subsystem nodes in a single startup file, reduces the difficulty and workload of subsequent system maintenance, and facilitates subsequent system maintenance.

[0095] Second embodiment of the present invention:

[0096] like Figure 2As shown, this embodiment also provides a method for implementing hierarchical cascade startup, and the specific process includes implementing the orderly startup of two nodes and the launch file implementation script; wherein, the specific process for implementing the orderly startup of two nodes is as follows: start the ROS2 node and create a startup description file corresponding to the ROS2 node; thereby judging whether the managed node instance in the current ROS2 node has been created according to the startup description file; if so, directly start the managed node according to the managed node instance, and after determining that the startup is successful, continue to start other nodes; if not, create a managed node declaration corresponding to the ROS2 node, and then create a managed event delegate; add both the managed node declaration and the managed event delegate to the ROS2 node. to the startup description file, and after the addition is completed, add the startup description file to the startup service; run the startup service, create a managed node corresponding to the ROS2 node according to the managed node instance; instantiate the created managed node, and switch the state of the managed node to the creation state; return to the ROS2 node to run the managed node instance, trigger the managed node to switch state to the configuration state, and switch the state of the managed node to the configuration state; return to the ROS2 node to run the managed event delegate, trigger the managed node to switch state to the activated state, and switch the state of the managed node to the activated state; return to the ROS2 node to run the managed event delegate and start the managed node. Each time the managed node corresponding to the ROS2 node is started, determine whether the managed node is successfully started. When it is determined that the managed node is successfully started, repeat the hierarchical cascade startup method to continue starting the remaining subordinate managed nodes of the ROS2 node until all subordinate managed nodes are successfully started. Figure 2 As shown in Figure 1, the launch system interacts with the controlled node and realizes the orderly startup of the two nodes through the process of "control-state transfer-event monitoring". Figure 2 In the launch file implementation script, the startup order of the sub-launch files can be defined by the program, thereby controlling the startup order of each subsystem.

[0097] The third embodiment of the present invention:

[0098] See also Figure 3 .

[0099] like Figure 3 As shown, this embodiment provides a hierarchical cascade starting device, including:

[0100] The node startup module 100 is used to script the first-level startup files of each node in each node group to generate a first-level startup file set, wherein the first-level startup file set includes at least one first-level startup file;

[0101] The node group startup module 200 is used to compile the secondary startup files of each node group in each subsystem to generate a secondary startup file set, wherein the secondary startup file includes at least one secondary startup file;

[0102] The subsystem startup module 300 is used to arrange the three-level startup files in each subsystem to generate a three-level startup file set, wherein the three-level startup files include at least one three-level startup file;

[0103] The cascade startup module 400 is used to perform hierarchical cascade startup of ROS2 nodes according to the first-level startup file set, the second-level startup file set, and the third-level startup file set.

[0104] In this embodiment, the first-level startup file of each node in each node group is scripted by the node startup module to generate a first-level startup file set, wherein the first-level startup file set includes at least one first-level startup file; the second-level startup file of each node group in each subsystem is scripted by the node group startup module to generate a second-level startup file set, wherein the second-level startup file includes at least one second-level startup file; the third-level startup file in each subsystem is scripted by the subsystem startup module to generate a third-level startup file set, wherein the third-level startup file includes at least one third-level startup file; and the cascade startup module performs hierarchical cascade startup of ROS2 nodes according to the first-level startup file set, the second-level startup file set, and the third-level startup file set. In this embodiment, the startup order of the secondary startup files is determined by the definition order of the startup description, the startup order of each subsystem is controlled, the launch system interacts with the controlled node, and the orderly startup of the two nodes is achieved through the "control-state transfer-event monitoring" process, effectively realizing hierarchical cascade startup. At the same time, the judgment of the active state of the dependent node is added to avoid repeated startup of the dependent node. This solves the problem of file bloat and work coupling of various groups caused by organizing the startup of all subsystem nodes in one startup file, reduces the difficulty of subsequent system maintenance, reduces the maintenance workload, and is conducive to subsequent system maintenance work.

[0105] Reference Figure 4 In the embodiment of the present application, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 4As shown. The computer device includes a processor, memory, network interface, and database connected via a system bus. The processor of the computer is designed to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data such as a hierarchical cascade startup method. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements a hierarchical cascade startup method. The hierarchical cascade startup method includes: arranging the script content of the first-level startup file of each node in each node group to generate a first-level startup file set; arranging the second-level startup file of each node group in each subsystem to generate a second-level startup file set; arranging the third-level startup file in each subsystem to generate a third-level startup file set; and performing a hierarchical cascade startup of the ROS2 nodes based on the first-level startup file set, the second-level startup file set, and the third-level startup file set.

[0106] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, a hierarchical cascade startup method is implemented, comprising the steps of: arranging the script content of the first-level startup file of each node in each node group to generate a first-level startup file set; arranging the second-level startup file of each node group in each subsystem to generate a second-level startup file set; arranging the third-level startup file in each subsystem to generate a third-level startup file set; and performing a hierarchical cascade startup of the ROS2 nodes according to the first-level startup file set, the second-level startup file set, and the third-level startup file set.

[0107] The hierarchical cascade startup method executed above, in this embodiment, determines the startup order of the secondary startup files by defining the startup description order, controls the startup order of each subsystem, and interacts with the launch system and the controlled node. Through the "control-state transfer-event monitoring" process, the orderly startup of the two nodes is achieved, effectively realizing hierarchical cascade startup. At the same time, the judgment of the active state of the dependent nodes is added to avoid repeated startup of dependent nodes. It solves the problems of file bloat and work coupling of various groups caused by organizing the startup of all subsystem nodes in one startup file, reduces the difficulty of subsequent system maintenance, reduces the maintenance workload, and is beneficial to subsequent system maintenance work.

[0108] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0109] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the modules can be a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0110] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.

[0111] In addition, the functional modules in various embodiments of the present invention may be integrated into a single processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module. The aforementioned integrated modules may be implemented in the form of hardware or software functional modules.

[0112] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.

[0113] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct RAM bus dynamic RAM (DRDRAM), and RAM bus dynamic RAM (RDRAM), etc.

Claims

1. A hierarchical cascade startup method, characterized in that: At least the following steps are included: Scripting the first-level startup file of each node in each node group to generate a first-level startup file set, wherein the first-level startup file set includes at least one first-level startup file; Arranging the secondary startup files of each node group in each subsystem to generate a secondary startup file set, wherein the secondary startup files include at least one of the secondary startup files; Arranging the three-level startup files in each subsystem to generate a three-level startup file set, wherein the three-level startup files include at least one three-level startup file; The ROS2 nodes are started in a hierarchical cascade manner according to the first-level startup file set, the second-level startup file set, and the third-level startup file set.

2. The hierarchical cascade startup method according to claim 1, characterized in that: The step of performing hierarchical cascade startup of the ROS2 node according to the first-level startup file set, the second-level startup file set, and the third-level startup file set includes: Running the first-level startup file set to determine whether all first-level startup files in the first-level startup file set have been started; When it is determined that all the first-level startup files in the first-level startup file set have been started, running the second-level startup file set to determine whether all the second-level startup files in the second-level startup file set have been started; When it is determined that all the second-level startup files in the second-level startup file set have been started, the third-level startup file set is run to perform hierarchical cascade startup of the ROS2 nodes.

3. The hierarchical cascade startup method according to claim 2, characterized in that: The hierarchical cascade startup of the ROS2 nodes includes: Obtaining first startup information of the ROS2 node, and determining whether a corresponding managed node instance needs to be created according to the first startup information of the ROS2 node; If so, create a managed node instance corresponding to the ROS2 node, create a managed node according to the managed node instance and trigger a state transition, thereby completing the hierarchical cascade startup between the ROS2 node and the managed node; If not, start the corresponding managed node according to the managed node instance.

4. The hierarchical cascade startup method according to claim 3, characterized in that: The obtaining the first startup information of the ROS2 node and determining whether it is necessary to create a corresponding managed node instance according to the first startup information of the ROS2 node include: Start the ROS2 node and create a startup description file corresponding to the ROS2 node; It is determined whether the managed node instance in the ROS2 node has been created according to the startup description file.

5. The hierarchical cascade startup method according to claim 3, characterized in that: The step of creating a managed node instance corresponding to the ROS2 node includes: Create a managed node declaration and a managed event delegation corresponding to the ROS2 node in sequence; Add the created managed node declaration and managed event delegation to the startup description file; Add the startup description file after adding the managed node declaration and managed event delegation to the startup service.

6. The hierarchical cascade startup method according to claim 3, characterized in that: The step of creating a managed node according to the managed node instance and triggering a state transition to complete the hierarchical cascade startup between the ROS2 node and the managed node includes: Create a managed node corresponding to the ROS2 node according to the managed node instance; Instantiating the created managed node and converting the state of the managed node to a created state; Return to the ROS2 node to run the managed node instance, and switch the state of the managed node to the configuration state; Returning the ROS2 node to run the managed event delegate, switching the state of the managed node to the activated state; Return to the ROS2 node to run the managed event delegate and start the managed node.

7. The hierarchical cascade startup method according to claim 3, characterized in that: The hierarchical cascade startup of the ROS2 nodes further includes: Determining whether the managed node is successfully started; When it is determined that the managed node is successfully started, the remaining subordinate managed nodes of the ROS2 node are started.

8. A hierarchical cascade starting device, characterized in that: include: A node startup module, configured to script the first-level startup files of each node in each node group to generate a first-level startup file set, wherein the first-level startup file set includes at least one first-level startup file; A node group startup module, configured to compile the secondary startup files of each node group in each subsystem to generate a secondary startup file set, wherein the secondary startup files include at least one of the secondary startup files; A subsystem startup module is used to arrange the three-level startup files in each subsystem to generate a three-level startup file set, wherein the three-level startup files include at least one three-level startup file; The cascade startup module is used to perform hierarchical cascade startup of ROS2 nodes according to the first-level startup file set, the second-level startup file set and the third-level startup file set.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the hierarchical cascade startup method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the hierarchical cascade startup method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Controlling method and controlling device for running applications

    CN107220077A

  • Distributed cloud navigation system and method based on ROS2

    CN110427039A