An information sharing method and device for IROS topic communication entities

By adding environment variables for IROS and creating information sharing topics, the problem of insufficient information sharing among IROS topic communication entities is solved, and the behavior of spontaneous perception and response to other topic communication entities is realized, and the applicable scenarios of IROS are expanded.

CN116846856BActive Publication Date: 2025-03-11SHANDONG NEW GENERATION INFORMATION IND TECH RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310857431.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-13
Publication Date
2025-03-11
Estimated Expiration
2043-07-13

AI Technical Summary

Technical Problem

The lack of information sharing methods among IROS topic communication entities makes it difficult to spontaneously perceive and respond to other topic communication entities' online, modify, and offline behaviors, limiting the applicable scenarios of IROS.

Method used

Control the information function of the topic communication entity by adding an environment variable to IROS, and create a /topic_entity_info topic when IROS is started, which is used to periodically send and subscribe to the information of the topic communication entity. Add online, modify and offline behavior function pointers to realize the execution of system callback functions, and set up a global topic communication entity information table.

Benefits of technology

It realizes the online, modification, and offline behaviors of IROS spontaneous perception and response topic communication entities, and updates information in real time through the global information table, expanding the applicable scenarios of IROS.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116846856B_ABST
    Figure CN116846856B_ABST
Patent Text Reader

Abstract

An IROS topic communication entity information sharing method and device relate to the field of robot operating system technology. The method and device enable IROS to spontaneously perceive the online, modified, offline and other behaviors of the topic communication entity, and can quickly give feedback and respond to these behaviors. At the same time, a global topic communication entity information table is created and maintained locally. The table is updated in real time based on the information changes of the topic communication entity, thereby increasing the applicable scenarios of IROS.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of robot operating systems, and in particular to an information sharing method for IROS topic communication entities. Background Art

[0002] Intelligent Robot Operating System (IROS) is a meta-operating system suitable for robots. It adopts a distributed architecture and can be quickly deployed on robots. It supports basic communication functions such as topics, services, and parameters, and provides robots with real-time, secure, and stable message communication mechanisms to support various tasks of robots. Among them, topic communication is the most widely used communication mechanism in IROS. The topic communication entities of IROS include publishers and subscribers. When a publisher publishes a message to a topic in IROS, all subscribers who have subscribed to the topic can receive the message.

[0003] At present, there is a lack of information sharing methods between IROS topic communication entities. They can only obtain partial information of other topic communication entities by actively calling interfaces. The lack of unified structural management makes it cumbersome to use and increases the workload of coding. More importantly, IROS cannot spontaneously perceive the online, modified, and offline behaviors of other topic communication entities, which makes it difficult for IROS topic communication entities to quickly respond or give feedback to the online, modified, and offline behaviors of other topic communication entities, which limits the applicable scenarios of IROS to a certain extent. Summary of the invention

[0004] In order to overcome the deficiencies of the above technologies, the present invention provides an information sharing method of IROS topic communication entities to make up for the deficiencies of IROS topic communication entities.

[0005] The technical solution adopted by the present invention to overcome the technical problems is:

[0006] An information sharing method of an IROS topic communication entity, comprising:

[0007] Added a new environment variable for IROS to control the information function of the IROS topic communication entity;

[0008] IROS creates a topic / topic_entity_info when it starts, and sends its own information to the topic / topic_entity_info at time intervals t. The message type corresponding to the topic / topic_entity_info is TOPIC_ENTITY_INFO.

[0009] Add online behavior function pointer, modify behavior function pointer, and add offline behavior function pointer in IROS topic communication entity;

[0010] When the information sharing function of IROS topic communication entities is enabled, all topic communication entities created by IROS subscribe to the / topic_entity_info topic in the background and fill their own communication entity information into the instance of message type TOPIC_ENTITY_INFO, and send the instance to the / topic_entity_info topic at time intervals t;

[0011] When the information sharing function of IROS topic communication entities is enabled, all topic communication entities created by IROS subscribe to the / topic_entity_info topic in the background. Each topic communication entity passes in a system callback function. When a message is received in the / topic_entity_info topic, each topic communication entity executes the system callback function.

[0012] A global topic communication entity information table is set up to store information of all topic communication entities in IROS.

[0013] Furthermore, a new environment variable IROS_TOPIC_ENTITY_SHARE_ENABLE is added to IROS. When IROS_TOPIC_ENTITY_SHARE_ENABLE is set to 1, it means enabling the information sharing function of the IROS topic communication entity. When IROS_TOPIC_ENTITY_SHARE_ENABLE is set to 0, it means disabling the information sharing function of the IROS topic communication entity.

[0014] Preferably, the value of t is 30s.

[0015] Furthermore, the member variables of the message type TOPIC_ENTITY_INFO include: an unsigned integer entity_id used to save the unique ID of the topic communication entity, a string entity_type used to save the type of the topic communication entity, a string topic_name used to save the name of the topic associated with the topic communication entity, a string topic_type used to save the type of the topic associated with the topic communication entity, and an unsigned integer heartbeat_interval used to save the time interval for the topic communication entity to send its own information periodically.

[0016] Furthermore, an online behavior function pointer is added to save the callback function executed when the user goes online for the IROS topic communication entity, and its default value is empty; a modification behavior function pointer is added to save the callback function executed when the user modifies the IROS topic communication entity, and its default value is empty; an offline behavior function pointer is added to save the callback function executed when the user goes offline for the IROS topic communication entity, and its default value is empty.

[0017] Furthermore, in the IROS topic communication entity, external interfaces for setting the values ​​of the function pointers are added to the online behavior function pointer, the modification behavior function pointer, and the offline behavior function pointer respectively.

[0018] Furthermore, the value of the heartbeat_interval variable in the communication entity information is the time interval t.

[0019] Furthermore, each topic communication entity executes the system callback function including: parsing the message received in the " / topic_entity_info" topic, using the entity_id in the message as an index, and determining whether there is an entry for the message in the global topic communication entity table. If the entry does not exist, the entity information parsed from the message is added to the information table, and determining whether the online behavior function pointer in the topic communication entity is empty. If not, the user callback function pointed to by the pointer is executed. If the entry exists, the entity information of the existing entry is updated, and determining whether the modification behavior function pointer in the topic communication entity is empty. If not, the user callback function pointed to by the pointer is executed.

[0020] Furthermore, when a new topic communication entity comes online, a message is sent to the / topic_entity_info topic. After other topic communication entities receive the message, the information of this communication entity is added to the topic communication entity information table. When a topic communication entity goes offline, no message is sent to the / topic_entity_info topic. The heartbeat_interval time interval of each entity in the topic communication entity information table is counted. When the time interval is over, if no message is received from the corresponding topic communication entity, it is determined that the topic communication entity has gone offline, and the information of the entity is deleted from the topic communication entity information table. It is also determined whether the offline behavior function pointer of the topic communication entity is empty. If it is not empty, the function pointed to by the pointer is executed; when the information of a topic communication entity changes, messages are continuously sent to the / topic_entity_info topic at a time interval with the value of heartbeat_interval, and the information in the topic communication entity information table is updated in real time; when the information of the topic communication entity needs to be queried, it is directly obtained from the topic communication entity table.

[0021] An information sharing device for an IROS topic communication entity, comprising:

[0022] at least one processor, and

[0023] A memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:

[0024] Added a new environment variable for IROS to control the information function of the IROS topic communication entity;

[0025] IROS creates a topic / topic_entity_info when it starts, and sends its own information to the topic / topic_entity_info at time intervals t. The message type corresponding to the topic / topic_entity_info is TOPIC_ENTITY_INFO.

[0026] Add online behavior function pointer, modify behavior function pointer, and add offline behavior function pointer in IROS topic communication entity;

[0027] When the information sharing function of IROS topic communication entities is enabled, all topic communication entities created by IROS subscribe to the / topic_entity_info topic in the background and fill their own communication entity information into the instance of message type TOPIC_ENTITY_INFO, and send the instance to the / topic_entity_info topic at time intervals t;

[0028] When the information sharing function of IROS topic communication entities is enabled, all topic communication entities created by IROS subscribe to the / topic_entity_info topic in the background. Each topic communication entity passes in a system callback function. When a message is received in the / topic_entity_info topic, each topic communication entity executes the system callback function.

[0029] A global topic communication entity information table is set up to store information of all topic communication entities in IROS.

[0030] The beneficial effect of the present invention is: based on the IROS topic communication entity information sharing method of the present invention, IROS can spontaneously perceive the online, modified, offline and other behaviors of the topic communication entity, and can quickly give feedback and respond to these behaviors, while creating and maintaining a global topic communication entity information table locally, which is updated in real time based on the information changes of the topic communication entity, thereby increasing the applicable scenarios of IROS. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION

[0032] The following is combined with Figure 1 The present invention is further described.

[0033] An information sharing method of an IROS topic communication entity, comprising:

[0034] Added a new environment variable to IROS to control the information function of the IROS topic communication entity.

[0035] IROS creates a topic / topic_entity_info when it starts, and sends its own information to the topic / topic_entity_info at time intervals t. The message type corresponding to the topic / topic_entity_info is TOPIC_ENTITY_INFO.

[0036] In the IROS topic communication entity, add online behavior function pointer, modify behavior function pointer, and add offline behavior function pointer.

[0037] When the information sharing function of IROS topic communication entities is enabled, all topic communication entities created by IROS (including publishers and subscribers) subscribe to the / topic_entity_info topic in the background and fill their own communication entity information into an instance of the message type TOPIC_ENTITY_INFO, and send the instance to the / topic_entity_info topic at time intervals t.

[0038] When the information sharing function of the IROS topic communication entity is enabled, all topic communication entities created by IROS subscribe to the / topic_entity_info topic in the background. Each topic communication entity passes in a system callback function. When a message is received in the / topic_entity_info topic, each topic communication entity executes the system callback function.

[0039] A global topic communication entity information table is set up to store information of all topic communication entities in IROS.

[0040] When IROS starts, it automatically creates a topic " / topic_entity_info". All topic communication entities created by IROS will subscribe to the topic " / topic_entity_info" in the background and send their own information to the topic at a certain time interval. When the topic communication entity receives a message from the topic " / topic_entity_info", it will execute the system callback function to save the entity information in the message to a global entity information table. At the same time, it supports users to add their own user callback functions in the topic communication entity for the online, modified, and offline behaviors of other topic communication entities. The callback function of the online behavior will be executed after a new entry is added to the global entity information table, the callback function of the modification behavior will be executed after the entry is modified in the global entity information table, and the callback function of the offline behavior will be executed after the entry is deleted from the global information table, ultimately realizing information sharing of topic communication entities.

[0041] In one embodiment of the present invention, a new environment variable IROS_TOPIC_ENTITY_SHARE_ENABLE is added to IROS. When IROS_TOPIC_ENTITY_SHARE_ENABLE is set to 1, it indicates that the information sharing function of the IROS topic communication entity is enabled. When IROS_TOPIC_ENTITY_SHARE_ENABLE is set to 0, it indicates that the information sharing function of the IROS topic communication entity is disabled.

[0042] In one embodiment of the present invention, the value of t is 30s.

[0043] In one embodiment of the present invention, the member variables of the message type TOPIC_ENTITY_INFO include: an unsigned integer entity_id for storing the unique ID of the topic communication entity, a string entity_type for storing the type of the topic communication entity, a string topic_name for storing the name of the topic associated with the topic communication entity, a string topic_type for storing the type of the topic associated with the topic communication entity, and an unsigned integer heartbeat_interval for storing the time interval for the topic communication entity to periodically send its own information.

[0044] In one embodiment of the present invention, an online behavior function pointer is added to save the callback function executed when the user goes online for the IROS topic communication entity, and its default value is empty; a modification behavior function pointer is added to save the callback function executed when the user modifies the IROS topic communication entity, and its default value is empty; an offline behavior function pointer is added to save the callback function executed when the user goes offline for the IROS topic communication entity, and its default value is empty.

[0045] In one embodiment of the present invention, external interfaces for setting the values ​​of function pointers are added to the online behavior function pointer, the modified behavior function pointer, and the offline behavior function pointer in the IROS topic communication entity. After the user defines the user callback function for a certain behavior of the topic communication entity, these external interfaces can be used to assign the user callback function to the function pointer of the corresponding behavior.

[0046] In one embodiment of the present invention, the value of the heartbeat_interval variable in the communication entity information is the time interval t. This variable can be specified when creating a topic communication entity. If not specified, the default value of the heartbeat_interval variable is 30 seconds.

[0047] In one embodiment of the present invention, each topic communication entity executes the system callback function including: parsing the message received in the " / topic_entity_info" topic, using the entity_id in the message as an index, determining whether there is an entry for the message in the global topic communication entity table; if the entry does not exist, adding the entity information parsed from the message to the information table, and determining whether the online behavior function pointer in the topic communication entity is empty; if not, executing the user callback function pointed to by the pointer; if the entry exists, updating the entity information of the existing entry, and determining whether the modification behavior function pointer in the topic communication entity is empty; if not, executing the user callback function pointed to by the pointer.

[0048] In one embodiment of the present invention, when a new topic communication entity comes online, a message is sent to the / topic_entity_info topic. After other topic communication entities receive the message, the information of this communication entity is added to the topic communication entity information table. When a topic communication entity goes offline, no message is sent to the / topic_entity_info topic. The heartbeat_interval time interval for each entity in the topic communication entity information table is counted. When the time interval timing ends, if no message is received from the corresponding topic communication entity, it is determined that the topic communication entity has gone offline, and the information of the entity is deleted from the topic communication entity information table. It is also determined whether the offline behavior function pointer of the topic communication entity is empty. If it is not empty, the function pointed to by the pointer is executed; when the information of a topic communication entity changes, messages are continuously sent to the / topic_entity_info topic at a time interval with the value of heartbeat_interval, and the information in the topic communication entity information table is updated in real time, so as to update the information in the topic communication entity information table in real time; when the information of the topic communication entity needs to be queried, it is directly obtained from the topic communication entity table.

[0049] The present invention also relates to an information sharing device of an IROS topic communication entity, comprising:

[0050] at least one processor, and

[0051] A memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:

[0052] Added a new environment variable for IROS to control the information function of the IROS topic communication entity;

[0053] IROS creates a topic / topic_entity_info when it starts, and sends its own information to the topic / topic_entity_info at time intervals t. The message type corresponding to the topic / topic_entity_info is TOPIC_ENTITY_INFO.

[0054] Add online behavior function pointer, modify behavior function pointer, and add offline behavior function pointer in IROS topic communication entity;

[0055] When the information sharing function of IROS topic communication entities is enabled, all topic communication entities created by IROS subscribe to the / topic_entity_info topic in the background and fill their own communication entity information into the instance of message type TOPIC_ENTITY_INFO, and send the instance to the / topic_entity_info topic at time intervals t;

[0056] When the information sharing function of IROS topic communication entities is enabled, all topic communication entities created by IROS subscribe to the / topic_entity_info topic in the background. Each topic communication entity passes in a system callback function. When a message is received in the / topic_entity_info topic, each topic communication entity executes the system callback function.

[0057] A global topic communication entity information table is set up to store information of all topic communication entities in IROS.

[0058] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. An information sharing method for IROS topic communication entities, characterized in that: include: Added a new environment variable for IROS to control the information function of the IROS topic communication entity; IROS creates a topic / topic_entity_info when it starts, and sends its own information to the topic / topic_entity_info at time intervals t. The message type corresponding to the topic / topic_entity_info is TOPIC_ENTITY_INFO. Add online behavior function pointer, modify behavior function pointer, and add offline behavior function pointer in IROS topic communication entity; When the information sharing function of IROS topic communication entities is enabled, all topic communication entities created by IROS subscribe to the / topic_entity_info topic in the background and fill their own communication entity information into the instance of message type TOPIC_ENTITY_INFO, and send the instance to the / topic_entity_info topic at time intervals t; When the information sharing function of IROS topic communication entities is enabled, all topic communication entities created by IROS subscribe to the / topic_entity_info topic in the background. Each topic communication entity passes in a system callback function. When a message is received in the / topic_entity_info topic, each topic communication entity executes the system callback function. Setting a global topic communication entity information table for storing information of all topic communication entities in IROS; Add an online behavior function pointer to save the callback function executed when the user goes online for the IROS topic communication entity, and its default value is empty; add a modification behavior function pointer to save the callback function executed when the user modifies the IROS topic communication entity, and its default value is empty; add an offline behavior function pointer to save the callback function executed when the user goes offline for the IROS topic communication entity, and its default value is empty; Each topic communication entity executes the system callback function including: parsing the message received in the " / topic_entity_info" topic, using the entity_id in the message as the index, determining whether there is an entry for the message in the global topic communication entity table, and if the entry does not exist, adding the entity information parsed from the message to the information table, and determining whether the online behavior function pointer in the topic communication entity is empty, if not empty, executing the user callback function pointed to by the pointer, and if the entry exists, updating the entity information of the existing entry, and determining whether the modification behavior function pointer in the topic communication entity is empty, if not empty, executing the user callback function pointed to by the pointer; When a new topic communication entity comes online, a message is sent to the / topic_entity_info topic. After receiving the message, other topic communication entities add the information of this communication entity to the topic communication entity information table. When a topic communication entity goes offline, no message is sent to the / topic_entity_info topic. The heartbeat_interval time interval of each entity in the topic communication entity information table is counted. When the time interval is over, if no message is received from the corresponding topic communication entity, it is determined that the topic communication entity has gone offline, and the information of the entity is deleted from the topic communication entity information table. It is also determined whether the offline behavior function pointer of the topic communication entity is empty. If it is not empty, the function pointed to by the pointer is executed; when the information of a topic communication entity changes, messages are continuously sent to the / topic_entity_info topic at a time interval with the value of heartbeat_interval, and the information in the topic communication entity information table is updated in real time; when the information of the topic communication entity needs to be queried, it is directly obtained from the topic communication entity table.

2. The information sharing method of the IROS topic communication entity according to claim 1, characterized in that: A new environment variable IROS_TOPIC_ENTITY_SHARE_ENABLE is added to IROS. When IROS_TOPIC_ENTITY_SHARE_ENABLE is set to 1, it means enabling the information sharing function of the IROS topic communication entity. When IROS_TOPIC_ENTITY_SHARE_ENABLE is set to 0, it means disabling the information sharing function of the IROS topic communication entity.

3. The information sharing method of the IROS topic communication entity according to claim 1, characterized in that: The value of t is 30s.

4. The information sharing method of the IROS topic communication entity according to claim 1, characterized in that: The member variables of the message type TOPIC_ENTITY_INFO include: an unsigned integer entity_id used to save the unique ID of the topic communication entity, a string entity_type used to save the type of the topic communication entity, a string topic_name used to save the name of the topic associated with the topic communication entity, a string topic_type used to save the type of the topic associated with the topic communication entity, and an unsigned integer heartbeat_interval used to save the time interval for the topic communication entity to send its own information periodically.

5. The information sharing method of the IROS topic communication entity according to claim 1, characterized in that: In the IROS topic communication entity, external interfaces for setting the values ​​of the function pointers are added to the online behavior function pointer, the modification behavior function pointer, and the offline behavior function pointer respectively.

6. The information sharing method of IROS topic communication entity according to claim 1, characterized in that: The value of the heartbeat_interval variable in the communication entity information is the time interval t.

7. An information sharing device for IROS topic communication entities, characterized in that: include: at least one processor, and A memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Added a new environment variable for IROS to control the information function of the IROS topic communication entity; IROS creates a topic / topic_entity_info when it starts, and sends its own information to the topic / topic_entity_info at time intervals t. The message type corresponding to the topic / topic_entity_info is TOPIC_ENTITY_INFO. Add online behavior function pointer, modify behavior function pointer, and add offline behavior function pointer in IROS topic communication entity; When the information sharing function of IROS topic communication entities is enabled, all topic communication entities created by IROS subscribe to the / topic_entity_info topic in the background and fill their own communication entity information into the instance of message type TOPIC_ENTITY_INFO, and send the instance to the / topic_entity_info topic at time intervals t; When the information sharing function of IROS topic communication entities is enabled, all topic communication entities created by IROS subscribe to the / topic_entity_info topic in the background. Each topic communication entity passes in a system callback function. When a message is received in the / topic_entity_info topic, each topic communication entity executes the system callback function. Setting a global topic communication entity information table for storing information of all topic communication entities in IROS; Add an online behavior function pointer to save the callback function executed when the user goes online for the IROS topic communication entity, and its default value is empty; add a modification behavior function pointer to save the callback function executed when the user modifies the IROS topic communication entity, and its default value is empty; add an offline behavior function pointer to save the callback function executed when the user goes offline for the IROS topic communication entity, and its default value is empty; Each topic communication entity executes the system callback function functions including: Parse the message received in the topic " / topic_entity_info", use the entity_id in the message as the index, and determine whether there is an entry for the message in the global topic communication entity table. If the entry does not exist, add the entity information parsed from the message to the information table, and determine whether the online behavior function pointer in the topic communication entity is empty. If it is not empty, execute the user callback function pointed to by the pointer. If the entry exists, update the entity information of the existing entry, and determine whether the modification behavior function pointer in the topic communication entity is empty. If it is not empty, execute the user callback function pointed to by the pointer; When a new topic communication entity comes online, a message is sent to the / topic_entity_info topic. After receiving the message, other topic communication entities add the information of this communication entity to the topic communication entity information table. When a topic communication entity goes offline, no message is sent to the / topic_entity_info topic. The heartbeat_interval time interval of each entity in the topic communication entity information table is counted. When the time interval is over, if no message is received from the corresponding topic communication entity, it is determined that the topic communication entity has gone offline, and the information of the entity is deleted from the topic communication entity information table. It is also determined whether the offline behavior function pointer of the topic communication entity is empty. If it is not empty, the function pointed to by the pointer is executed; when the information of a topic communication entity changes, messages are continuously sent to the / topic_entity_info topic at a time interval with the value of heartbeat_interval, and the information in the topic communication entity information table is updated in real time; when the information of the topic communication entity needs to be queried, it is directly obtained from the topic communication entity table.

Citation Information

Patent Citations

  • Shell instruction remote execution method based on IROS message communication mechanism

    CN115237621A

  • Topic message subscribing and processing method based on IROS

    CN115617543A