A mobile robot host computer and slave computer serial communication system and method

By using direct memory access for data transmission and union format parsing, combined with the ROS system interface, the problems of low efficiency, poor integrity, and insufficient mode flexibility in communication between upper and lower level machines of mobile robots are solved, achieving efficient and accurate data transmission and parsing, and improving the system's integration capabilities and adaptability.

CN120602576BActive Publication Date: 2026-02-03SHANDONG UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510722755.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2026-02-03
Estimated Expiration
2045-05-30

AI Technical Summary

Technical Problem

Traditional communication methods between upper and lower level mobile robots suffer from problems such as low data transmission efficiency, difficulty in ensuring data integrity, complex and error-prone data parsing, and insufficient flexibility in communication modes, which are particularly prominent in complex environments.

Method used

It adopts direct memory access transmission and union format data parsing, combined with the seamless interface of the ROS system, to achieve efficient and accurate data transmission and parsing between upper and lower level machines. Data mapping and verification are performed through data encapsulation module, data transmission module and data parsing module, and dynamic registration and flexible communication modes are supported.

Benefits of technology

It significantly improves data transmission efficiency, reduces system resource consumption, ensures the accuracy and integrity of data transmission, enhances system integration capabilities and adaptability to multiple scenarios, and supports real-time control and data interaction of mobile robots under different kinematic models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120602576B_ABST
    Figure CN120602576B_ABST
Patent Text Reader

Abstract

The application provides a kind of mobile robot host and slave computer serial communication system and method, and host computer and slave computer all include data encapsulation module, data transmission module and data analysis module, data encapsulation module, the message data to be published is decomposed into byte array using common body format, form message, data transmission module, using direct memory access transmission mode, allow data to be directly transmitted between memory and peripheral, for the data encapsulated by the data encapsulation module of publishing message party is transmitted to the data analysis module of subscribing message party;Data analysis module, the received message is analyzed using common body format, and the accurate data is parsed out, and it is embedded with ROS message bridge node with data encapsulation module, to realize the bidirectional mapping of data;The application can realize efficient and accurate data transmission and analysis between host computer and slave computer, meet the real-time control and data interaction requirements of mobile robot in complex environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of robot communication, specifically relating to a serial communication system and method for upper and lower level computers of a mobile robot. Background Technology

[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.

[0003] In mobile robot systems, communication between the host and supervisory computers is crucial for ensuring the robot's normal operation. Traditional communication methods often suffer from low data transmission efficiency and difficulty in guaranteeing data integrity, especially in complex environments.

[0004] Existing communication methods between upper and lower level robots generally have the following problems:

[0005] Low data transmission efficiency: Traditional methods rely on CPU interrupt handling, which consumes a lot of system resources and limits transmission speed.

[0006] Data integrity is difficult to guarantee: the lack of effective synchronization and verification mechanisms can easily lead to data misalignment, loss or damage.

[0007] Data parsing is complex and error-prone: traditional methods require complex type conversions and have low integration with the ROS system.

[0008] The communication mode lacks flexibility: it cannot flexibly support the computational needs of the forward and inverse kinematics models of mobile robots. Summary of the Invention

[0009] To address the aforementioned problems, this invention proposes a serial communication system and method for mobile robot upper and lower computer systems. This invention employs direct memory access transmission, union format data parsing, and achieves a seamless interface with the ROS system. This invention enables efficient and accurate data transmission and parsing between upper and lower computer systems, meeting the real-time control and data interaction needs of mobile robots in complex environments.

[0010] According to some embodiments, the present invention adopts the following technical solution:

[0011] A serial communication system for a mobile robot's host and slave devices includes a host computer and a slave computer. One device subscribes to messages, and the other device publishes messages. Both the host computer and the slave computer include a data encapsulation module, a data transmission module, and a data parsing module, wherein:

[0012] The data encapsulation module is used to decompose the message data to be published into a byte array in a union format to form a message, and embeds a ROS message bridge node. The ROS message bridge node supports dynamic registration and automatically matches the message type and serial port data frame format to map the serial port data into ROS standard messages.

[0013] The data transmission module adopts a direct memory access transmission method, which allows data to be directly transmitted between memory and peripherals. It is used to transmit the data encapsulated by the data encapsulation module of the message publisher to the data parsing module of the message subscriber.

[0014] The data parsing module uses a union format to analyze the received messages, extracts accurate data, and embeds a ROS message bridging node. It uses this node to automatically match the received ROS standard messages with the serial port data frame format, and maps the ROS messages back to serial port data, thus realizing bidirectional data mapping.

[0015] As an alternative implementation, the data packet module decomposes decimal data into binary byte arrays using a union format.

[0016] As an optional implementation, the message includes a first data header, a second data header, a length bit, data bits, a topic bit, a control bit, a check bit, a first data tail, and a second data tail, wherein: the first data header and the second data header are specified information; the length bit is used to indicate the length of the valid data in the data segment; the topic bit is used to identify the ROS topic to which the data belongs; the control bit has reserved bytes for expansion; the check bit is the sum of the length bit and the control bit; and the first data tail and the second data tail are specified information.

[0017] The data bits include stop bits, sign bits, and value bits. The stop bits are used to indicate whether control data is sent or received. The sign bits are used to indicate the positive or negative value of the data. The value bits include two bytes of data, with the high eight bits first and the low eight bits last.

[0018] As an alternative implementation, the data transmission module is used to send the data generated by the data packet module of the host computer to the data parsing module of the slave computer, or to transmit the data generated by the data packet module of the slave computer to the data parsing module of the host computer, introducing a circular buffer with shared memory, and the parsed data can be directly written into the circular buffer.

[0019] As a further implementation, the ROS message bridge node references data in a circular buffer of shared memory via pointers.

[0020] As an alternative implementation, the host computer also includes a ROS bridging module for communicating with other communication devices.

[0021] Based on the communication method of the above system, in the mode of upper computer subscribing to lower computer publishing, the following steps are included:

[0022] The lower-level machine reads data from the angle and speed sensors;

[0023] The lower-level machine's data packet module converts the transmitted data into messages using a union format and encapsulates each data frame of the message; and the ROS message bridge node embedded in the data encapsulation module maps serial port data into ROS standard messages.

[0024] The lower-level machine's data transmission module sends the mapped ROS standard messages to the upper-level machine;

[0025] The host computer's data parsing module receives message information and ROS standard messages from the slave computer. The ROS message bridging node automatically matches the message type with the serial port data frame format based on the message's topic bit, mapping the ROS standard message back to serial port data. It analyzes the message information of each frame, judges the integrity of the data from the data header to the data tail, extracts the data bits, and converts the message data into accurate sensor data.

[0026] As an alternative implementation, the method also includes: the host computer uses the ROS bridging module to perform forward kinematics calculations on the speed and angle to obtain the mileage, and then publishes it through the ROS topic.

[0027] As an alternative implementation, the lower-level machine reads the data from the angle and speed sensors and writes it directly into the circular buffer of shared memory.

[0028] Based on the communication method of the above system, in the mode of upper computer publishing to lower computer subscription, the following steps are included:

[0029] The host computer performs inverse kinematics to subscribe to speed topics;

[0030] The host computer uses a data encapsulation module to convert the ROS-subscribed speed topic messages into message data through a union format and encapsulate each data frame; the ROS message bridge node embedded in the data encapsulation module maps the encapsulated serial port data into ROS standard messages.

[0031] The data transmission module sends the mapped ROS standard messages to the lower-level machine;

[0032] The lower-level machine's data parsing module embeds a ROS standard message bridging node, receives ROS standard messages from the upper-level machine, automatically matches the message type with the serial port data frame format, and maps the ROS standard messages back to serial port data; the data parsing module analyzes the message information of each frame, judges the integrity of the data from the data header to the data tail, extracts the data bits, and converts the message data into accurate data from the sensor.

[0033] The lower-level machine adjusts its speed based on the parsed data.

[0034] As an alternative implementation, the data parsing module verifies data integrity before analyzing the message and then extracts data bits.

[0035] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0036] This invention employs DMA transfer to achieve direct data transfer between memory and peripherals without CPU intervention, significantly reducing system resource consumption and improving data transfer efficiency. For high-frequency sensor data and control commands, a zero-copy mechanism based on boost::circular_buffer for shared memory circular buffers is introduced. Lower-level machine data is directly written to the buffer, and ROS nodes reference the data through pointers, avoiding redundant memory copying between traditional byte streams and ROS messages, further improving real-time data interaction efficiency.

[0037] This invention achieves synchronous data verification through a frame structure design with dual data headers, a check bit (summated from length bits to control bits for verification), and a data tail. Combined with the integrity judgment logic of the data parsing module, it effectively reduces the risk of data misalignment, loss, or damage, ensuring the accuracy and integrity of transmitted data.

[0038] This invention utilizes a union format for data packetization and parsing, directly achieving type conversion between decimal data and binary byte streams, avoiding complex data format processing; it embeds a ROS message bridge node, supporting bidirectional dynamic mapping between serial port data and ROS standard messages, automatically matching message types and serial port data frame formats, reducing the complexity and error rate of manual parsing.

[0039] The data encapsulation and parsing module of this invention seamlessly integrates with the ROS system, supports dynamic registration and bidirectional mapping of ROS standard messages, and can directly convert sensor data into ROS topic messages or parse ROS messages into control commands. It is highly compatible with the ROS ecosystem, facilitates rapid integration with navigation, planning and other modules, improves system collaboration efficiency, and enhances system integration capabilities.

[0040] The communication method of this invention includes two communication modes: upper computer subscribing to lower computer publishing (forward kinematics model) and lower computer subscribing to upper computer publishing (inverse kinematics model). The ROS title is represented by topic bits to realize intelligent data distribution. Combined with the dynamic adaptation capability of bridging nodes, it can flexibly meet the data interaction needs of mobile robots in different kinematics model calculations, and enhance the system's scalability and multi-scenario adaptability.

[0041] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0042] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0043] Figure 1 This is a structural diagram of the upper and lower computer communication system of a mobile robot in one embodiment;

[0044] Figure 2 This is a data communication protocol for communication between the host and supervisor computers of a mobile robot in one embodiment.

[0045] Figure 3 This is a flowchart illustrating the upper-level computer receiving data from the lower-level computer in communication between the upper and lower-level computers of a mobile robot in one embodiment.

[0046] Figure 4 This is a flowchart illustrating the upper-level computer sending and lower-level computer receiving process for communication between the upper and lower-level computers of a mobile robot in one embodiment. Detailed Implementation

[0047] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0048] It should be noted that the following detailed description is illustrative and intended to provide further explanation of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0049] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0050] Where there is no conflict, the embodiments and features described in this application may be combined with each other.

[0051] As mentioned in the background section, traditional serial communication protocols in mobile robot applications lack a unified synchronization and verification mechanism for data frame structures. This leads to data misalignment, loss, or corruption during transmission, affecting the robot's control accuracy and stability. Traditional data transmission methods rely heavily on CPU interrupt handling, which consumes significant CPU resources when dealing with large data volumes, resulting in decreased system real-time performance and failing to meet the high-speed data interaction requirements of mobile robots. Furthermore, data parsing typically requires complex type conversions and data reassembly, easily introducing parsing errors. Integration with the ROS system is also low, making it difficult to efficiently convert sensor data into ROS topic messages for processing. Traditional master-slave communication modes have limitations in supporting the calculation of forward and inverse kinematics models for mobile robots, failing to flexibly adapt to different control scenarios, resulting in poor system scalability and adaptability.

[0052] To address the aforementioned problems, this invention provides a communication system between a host and a supervisory computer based on a ROS mobile robot.

[0053] To make the solution of this application clearer to those skilled in the art, the following definitions are provided:

[0054] ROS: Robot Operating System, is a framework for writing robot software that supports distributed processing, message passing, and hardware abstraction.

[0055] DMA (Direct Memory Access) allows peripherals to transfer data directly with memory without CPU intervention, thus improving transfer efficiency.

[0056] Union format: A data structure that allows multiple variables of different types to share the same memory space. It is often used for data encapsulation and parsing to reduce memory usage.

[0057] Forward kinematics model: A mathematical model that calculates the position and orientation of the end effector based on the robot's joint angles, used for pose estimation.

[0058] Inverse kinematics model: A mathematical model for solving joint angles based on the target position and attitude of the end effector, used for path planning and control.

[0059] A host-server communication system based on ROS mobile robots, such as Figure 1As shown, the system includes a host computer and a slave computer. One party subscribes to messages, and the other party publishes messages. Both the host computer and the slave computer include a data encapsulation module, a data transmission module, and a data parsing module, wherein:

[0060] The data encapsulation module is used to decompose the message data to be published into a byte array in a union format to form a message, and embeds a ROS message bridge node. The ROS message bridge node supports dynamic registration and automatically matches the message type and serial port data frame format to map the serial port data into ROS standard messages.

[0061] The data transmission module adopts a direct memory access transmission method, which allows data to be directly transmitted between memory and peripherals. It is used to transmit the data encapsulated by the data encapsulation module of the message publisher to the data parsing module of the message subscriber.

[0062] The data parsing module uses a union format to analyze the received messages, extracts accurate data, and embeds a ROS message bridging node. It uses this node to automatically match the received ROS standard messages with the serial port data frame format, and maps the ROS messages back to serial port data, thus realizing bidirectional data mapping.

[0063] The message or serial communication protocol involved in this embodiment includes data header 1, data header 2, length bits, data bits, topic bits, control bits, check bits, data tail 1 and data tail 2, wherein the data bits include stop bits, sign bits and value bits.

[0064] The length of each frame of a communication message needs to be determined by the number of bytes based on the length bits. The following explanation uses a message with a length bit of 0x01 as an example. Figure 2 As shown, where:

[0065] Data header 1: Byte0, always 0x55;

[0066] Data header 2: Byte1, always 0xAA;

[0067] Length bit: Byte2, which represents the length of the valid data in the data segment;

[0068] Data bits: Byte3~Byte6, which are the stop bits, sign bits, and value bits in the data segment;

[0069] Topic field: Byte 7, used to identify the ROS topic to which the data belongs (e.g., 0x01 corresponds to / odom, 0x02 corresponds to / cmd_vel). During lower-level machine parsing, this field is used to distribute the data to the corresponding processing module;

[0070] Control bits: Byte8, default 0x00, one byte reserved for user-defined function expansion;

[0071] Check bit: Byte9, which is the sum of the length bits and the control bits, and the lower eight bits are taken;

[0072] Data tail 1: Byte10, always 0x0D;

[0073] Data tail 2: Byte11, always 0x0A.

[0074] For data bits:

[0075] Stop bit: Byte3, controls whether data is sent or received;

[0076] Sign bit: Byte4, indicating the positive or negative value of the data;

[0077] Numerical bits: Byte5 and Byte6 are two bytes of data, with the high eight bits first and the low eight bits last.

[0078] The data packet module is used to decompose accurate decimal data into binary byte arrays using a union format. An embedded ROS message bridge node, based on the roscpp Publisher / Subscriber interface, enables bidirectional mapping between serial port data and ROS standard messages (such as geometry_msgs / Twist, nav_msgs / Odometry), and supports dynamic registration, automatically matching message types with serial port data frame formats.

[0079] The data transmission module is used to send data generated by the data packetization module of the host computer or the data packetization module of the slave computer to the data parsing module of the slave computer or the data parsing module of the host computer. The slave computer data transmission uses DMA (Direct Memory Access) transfer, which allows data to be transferred directly between memory and peripherals without CPU intervention, thus improving data transmission efficiency.

[0080] In this embodiment, a zero-copy transmission mechanism is adopted for high-frequency sensor data (such as angle and speed) and control commands. A shared memory circular buffer (implemented using boost::circular_buffer) is introduced, and the sensor data parsed by the lower-level machine can be directly written into this buffer.

[0081] The data parsing module uses a union format to parse binary byte arrays into accurate data. It also embeds the aforementioned ROS message bridge node to achieve bidirectional data mapping. The host computer's data parsing module interfaces with the ROS system, enabling the conversion of data into ROS topic messages for subscription and publication.

[0082] ROS nodes use pointers to reference data in a shared memory ring buffer, avoiding redundant memory copying between traditional byte streams and ROS messages.

[0083] This embodiment embeds ROS message bridging nodes in both the data encapsulation and parsing modules. Based on the roscpp Publisher / Subscriber interface, it implements a bidirectional mapping between serial port data and ROS standard messages (such as geometry_msgs / Twist, nav_msgs / Odometry). The bridging node supports dynamic registration and can automatically match message types with serial port data frame formats.

[0084] Example 2

[0085] A communication method between a host computer and a slave computer based on a ROS mobile robot is provided. The system of host computer and slave computer provided in Embodiment 1 is divided into two parts: the host computer subscribing to the slave computer's publication and the slave computer subscribing to the host computer's publication.

[0086] In determining the positive kinematics model of a mobile robot's position and orientation in space, a pattern of a host computer subscribing to data published by a slave computer is required, such as... Figure 3 As shown, the steps are as follows:

[0087] Step 1: The lower-level machine reads the data from the angle and speed sensors. For high-frequency angle and speed sensor data, a shared memory circular buffer (implemented using boost::circular_buffer) is introduced. The sensor data parsed by the lower-level machine is directly written to the buffer, avoiding repeated memory copying between traditional byte streams and ROS messages.

[0088] Step 2: Use the data packet module to convert the transmitted data into a binary byte stream using a union format, and encapsulate the data frame with header, topic, checksum, and trailer bits.

[0089] Step 3: Embed a ROS message bridge node in the data encapsulation module. Based on the roscpp Publisher interface, the serial port data is mapped to ROS standard messages. The bridge node supports dynamic registration and can automatically match the message type and serial port data frame format. The data transmission module is used to send the mapped ROS messages to the host computer.

[0090] Step 4: Embed a ROS message bridge node in the data parsing module. Based on the roscpp Subscriber interface, it receives ROS standard messages from the lower-level machine. The bridge node automatically matches the message type and serial port data frame format according to the topic bit, and maps the ROS message back to serial port data. The data parsing module analyzes the message information of each frame, judges the integrity of the data from the data header to the data tail, and then extracts the data bits to convert the binary byte stream data into accurate sensor data.

[0091] Step 5: The mobile robot uses the ROS interaction module to perform forward kinematics on the speed and angle, calculates the odometer, and then publishes it through the ROS topic.

[0092] Another embodiment is provided, regarding communication between the host and slave computers in the calculation of the forward kinematics model:

[0093] Includes the following steps:

[0094] Lower-level machine data reading and packetization:

[0095] The lower-level machine reads angle and speed data through sensors.

[0096] The data encapsulation module encapsulates the read data according to the serial communication protocol, including adding a data header, length bits, data bits (including stop bits, sign bits, and value bits), control bits, parity bits, and data tail.

[0097] Data transmission:

[0098] The lower-level device sends the encapsulated data frame to the upper-level device via DMA transfer.

[0099] Host computer data analysis and ROS deployment:

[0100] After receiving data, the host computer embeds a ROS message bridge node in the data parsing module. Based on the roscpp Subscriber interface, it maps ROS messages back to serial port data. The data parsing module then analyzes the messages to verify data integrity and extract data bits.

[0101] The extracted data is converted into decimal form and positive kinematics calculations are performed through the ROS interaction module to obtain the odometry information of the mobile robot.

[0102] The odometer information is published through a ROS topic for other nodes to subscribe to and use.

[0103] When a mobile robot calculates the inverse kinematics model of the velocities of each wheel based on its position and orientation, a host computer publishes and a slave computer subscribes to the model, such as... Figure 4 As shown, the steps are as follows:

[0104] Step 1: The host computer subscribes to the speed topic using inverse kinematics based on the ROS interaction module.

[0105] Step 2: The host computer uses a data encapsulation module to convert the ROS-subscribed speed topic messages into a binary byte stream using a union format, and then encapsulates the data frames with headers, checksums, and trailers. A ROS message bridge node is embedded in the data encapsulation module. Based on the roscpp Publisher interface, the encapsulated serial port data is mapped to ROS standard messages. The bridge node supports dynamic registration and can automatically match the message type and serial port data frame format.

[0106] Step 3: Use the data transmission module to send the mapped ROS message to the lower-level machine.

[0107] Step 4: Embed a ROS message bridge node in the data parsing module. Based on the roscpp Subscriber interface, it receives ROS standard messages from the host computer. The bridge node automatically matches the message type with the serial port data frame format and maps the ROS message back to serial port data. The lower-level data parsing module analyzes the message information of each frame, judges the integrity of the data from the data header to the data tail, and then extracts the data bits to convert the binary byte stream data into accurate sensor data.

[0108] Step 5: The lower-level machine adjusts its speed based on the parsed data.

[0109] Another embodiment is provided, which includes the following steps for communication between the host and slave computers in solving the inverse kinematics model:

[0110] ROS subscription and data packet processing on the host computer:

[0111] The host computer subscribes to speed topics through the ROS interaction module to obtain target speed information.

[0112] The data encapsulation module encapsulates the target speed information according to the serial communication protocol, including adding a data header, length bits, data bits (including stop bits, sign bits, and value bits), topic bits, control bits, parity bits, and data trailer. A ROS message bridge node is embedded in the data encapsulation module, using the roscpp Publisher interface to map the serial data to ROS standard messages.

[0113] Data transmission:

[0114] The host computer sends the encapsulated data frame to the slave computer.

[0115] Lower-level machine data parsing and speed adjustment:

[0116] After receiving data, the lower-level device embeds a ROS message bridge node in the data parsing module. Based on the roscpp Subscriber interface, it maps ROS messages back to serial port data. The data parsing module then analyzes the messages to verify data integrity and extract data bits.

[0117] The extracted data is converted into decimal form, and the speed of each wheel is adjusted according to the analyzed data to achieve inverse kinematics control of the mobile robot.

[0118] As a typical example, the serial port data segment is represented in hexadecimal, with each two bits representing one byte. Assuming the transmitted data consists of three bits: the first bit represents the angle 103 degrees, the second bit represents the first-round speed -199 cm / s, the third bit represents the second-round speed 186 cm / s, and the topic bit is / cmd_vel, then the data segment would look like this: Figure 2 The given value is 55AA0301010067010000C7010100BA0200F00D0A. Converting this to hexadecimal, we get 0x55, 0xAA, 0x03, 0x01, 0x01, 0x00, 0x67, 0x01, 0x00, 0x00, 0xC7, 0x01, 0x01, 0x00, 0xBA, 0x02, 0x00, 0xF2, 0x0D, 0x0A. The check digit is calculated by summing the length bits up to 0x03 and the control bits up to 0x02, resulting in 0x1F2. The lower eight bits are then added to 0xF2.

[0119] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of one or more computer-usable storage media (including, but not limited to, disk storage, etc.) containing computer-usable program code. CD - ROM It takes the form of a computer program product implemented on (such as optical memory, etc.).

[0120] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1A device that provides the functions specified in one or more boxes.

[0121] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0122] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0123] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made by those skilled in the art without creative effort within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A serial communication system for a mobile robot's upper and lower computer, characterized in that, This includes a host computer and a slave computer. One party subscribes to messages, and the other party publishes messages. Both the host computer and the slave computer include a data encapsulation module, a data transmission module, and a data parsing module, wherein: The data encapsulation module is used to decompose the message data to be published into a byte array using a union format to form a message, and embeds a ROS message bridge node. The ROS message bridge node supports dynamic registration and automatically matches the message type and serial port data frame format to map the serial port data into a ROS standard message. The message includes a first data header, a second data header, a length bit, data bits, a topic bit, control bits, a check bit, a first data tail, and a second data tail. The topic bit is used to identify the ROS topic to which the data belongs. The data transmission module adopts a direct memory access transmission method, which allows data to be directly transmitted between memory and peripherals. It is used to transmit the data encapsulated by the data encapsulation module of the message publisher to the data parsing module of the message subscriber, and introduces a circular buffer with shared memory. The parsed data can be directly written to the circular buffer. The ROS message bridge node references the data in the circular buffer of shared memory through pointers. The data parsing module uses a union format to analyze the received messages, extracts accurate data, and embeds a ROS message bridging node. It uses this node to automatically match the received ROS standard messages with the serial port data frame format, and maps the ROS messages back to serial port data, thus realizing bidirectional data mapping.

2. The mobile robot host-server serial communication system as described in claim 1, characterized in that, The data packet module decomposes decimal data into binary byte arrays using a union format.

3. The mobile robot host-server serial communication system as described in claim 1, characterized in that, The first data header and the second data header are specified information. The length bit is used to indicate the length of the valid data in the data segment. The control bit has reserved bytes for expansion. The check bit is the sum of the length bit and the control bit. The first data tail and the second data tail are specified information. The data bits include stop bits, sign bits, and value bits. The stop bits are used to indicate whether control data is sent or received. The sign bits are used to indicate the positive or negative value of the data. The value bits include two bytes of data, with the high eight bits first and the low eight bits last.

4. The mobile robot host-server serial communication system as described in claim 1, characterized in that, The data transmission module is used to send the data generated by the data packet module of the host computer to the data parsing module of the slave computer, or to transmit the data generated by the data packet module of the slave computer to the data parsing module of the host computer.

5. A serial communication system for a mobile robot host and slave computer as described in claim 1, characterized in that, The host computer also includes a ROS bridging module for communicating with other communication devices.

6. The communication method based on the system according to any one of claims 1-5, in the mode of upper computer subscription and lower computer publishing, is characterized in that, Includes the following steps: The lower-level machine reads data from the angle and speed sensors; The lower-level machine's data packet module converts the transmitted data into messages using a union format and encapsulates each data frame of the message; and the ROS message bridge node embedded in the data encapsulation module maps serial port data into ROS standard messages. The lower-level machine's data transmission module sends the mapped ROS standard messages to the upper-level machine; The host computer's data parsing module receives message information and ROS standard messages from the slave computer. The ROS message bridging node automatically matches the message type with the serial port data frame format based on the message's topic bit, mapping the ROS standard message back to serial port data. It analyzes the message information of each frame, judges the integrity of the data from the data header to the data tail, extracts the data bits, and converts the message data into accurate sensor data.

7. The method of claim 6, characterized in that, it further... include: The host computer uses the ROS bridging module to perform forward kinematics calculations on the velocity and angle to obtain the mileage, which is then published through the ROS topic. Alternatively, the lower-level machine can read the data from the angle and speed sensors and write it directly into the circular buffer of shared memory.

8. A communication method based on the system according to any one of claims 1-5, in a mode where the host computer publishes and the slave computer subscribes, characterized in that, Includes the following steps: The host computer performs inverse kinematics to subscribe to speed topics; The host computer uses a data packet module to convert the ROS-subscribed speed topic messages into message data through a union format and encapsulate each data frame. The ROS message bridge node embedded in the data encapsulation module maps the encapsulated serial port data into ROS standard messages. The data transmission module sends the mapped ROS standard messages to the lower-level machine; The lower-level machine's data parsing module embeds a ROS standard message bridging node, which receives ROS standard messages from the upper-level machine, automatically matches the message type with the serial port data frame format, and maps the ROS standard messages back to serial port data. The data parsing module analyzes the message information of each frame, judges the integrity of the data from the data header to the data tail, extracts the data bits, and converts the message data into accurate data from the sensor. The lower-level machine adjusts its speed based on the parsed data.

9. The method as described in claim 6, 7, or 8, characterized in that, Before analyzing the message, the data parsing module first verifies the data integrity and then extracts the data bits.

Citation Information

Patent Citations

  • Robot control system and robot

    CN119159580A