ROS-based drive node software design method, apparatus and device, and medium

Through the ROS-based driver node software design, the problems of inaccurate CAN output message analysis and low data distribution efficiency in intelligent driving system are solved, and more efficient data processing and visualization are achieved, and system performance is improved.

CN119211388AActive Publication Date: 2024-12-27CHINA FAW CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411109813.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-12-27
Estimated Expiration
2044-08-13

AI Technical Summary

Technical Problem

In the intelligent driving system, the CAN output message analysis of EyeQ4 devices is inaccurate, the data distribution efficiency is low, the data collection and playback operations are cumbersome, and the data visualization effect is not ideal, which limits the improvement of system performance.

Method used

Design a driver node software based on ROS, which can obtain the original CAN data, match the decoding device for decoding, obtain data categories and publish corresponding message topics, and use the three-layer software inheritance structure to improve data processing efficiency and flexibility.

Benefits of technology

It solves the problems of inaccurate message parsing, low data distribution efficiency, cumbersome data collection and playback operations, and unsatisfactory data visualization effects, and improves the efficiency of EyeQ4 data processing and the convenience of algorithm development and testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119211388A_ABST
    Figure CN119211388A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of intelligent driving, in particular to an ROS-based driving node software design method and device, equipment and a medium, and the method comprises the steps: obtaining at least one piece of CAN original data, respectively matching corresponding target decoding equipment according to the corresponding ID of each piece of CAN original data, decoding the corresponding CAN original data, and obtaining a decoding result; and obtaining decoded CAN data corresponding to each piece of CAN original data, obtaining a data category of each piece of decoded CAN data, and matching a corresponding message theme according to the data category of each piece of decoded CAN data so as to publish the corresponding decoded CAN data. Therefore, the problems of inaccurate message analysis, low data distribution efficiency, tedious data collection and playback operation, unsatisfactory data visualization effect and the like in related technologies are solved, and the efficiency and flexibility of EyeQ4 data processing based on ROS and the convenience of algorithm development and test are improved by designing a three-layer software inheritance structure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent driving technology, and in particular to a method, device, equipment and medium for designing driving node software based on ROS (Robot Operating System). Background Art

[0002] With the rapid development of autonomous driving technology, the requirements for visual algorithm processors in intelligent driving systems are also increasing. As an open source robot software development framework, ROS provides developers with a wealth of tools and libraries, supports multiple programming languages, and is highly flexible and scalable.

[0003] However, in the actual application of intelligent driving systems, there are still certain problems in the parsing and distribution of CAN (Controller Area Network) output messages of EyeQ4 devices, data collection and playback, and data visualization. For example, related technologies have problems such as inaccurate message parsing, inefficient data distribution, cumbersome data collection and playback operations, and unsatisfactory data visualization effects, which limit the improvement of the performance of intelligent driving systems and need to be solved urgently. Summary of the invention

[0004] The present application provides a ROS-based driver node software design method, device, equipment and medium to solve the problems of inaccurate message parsing, low data distribution efficiency, cumbersome data collection and playback operations, and unsatisfactory data visualization effects in the related technology.

[0005] The first aspect of the present application provides a method for designing driver node software based on ROS, comprising the following steps:

[0006] Get at least one CAN raw data;

[0007] Matching a target decoding device for each original data ID according to the corresponding ID of each CAN original data, and decoding the corresponding CAN original data according to the target decoding device for each original data ID, to obtain decoded CAN data corresponding to each CAN original data;

[0008] The data category of each decoded CAN data is obtained, a corresponding message topic is matched according to the data category of each decoded CAN data, and the corresponding decoded CAN data is published according to the message topic.

[0009] According to one embodiment of the present application, after matching the corresponding message subject according to the data category of each decoded CAN data, it also includes:

[0010] Obtain the ROS message library corresponding to the data category of each decoded CAN data;

[0011] Each decoded CAN data is encapsulated into the corresponding ROS message library, and the ROS message library encapsulating the decoded CAN data is published to the corresponding message topic.

[0012] According to one embodiment of the present application, publishing the ROS message library encapsulating the decoded CAN data to the corresponding message topic also includes:

[0013] Identify all ROS message libraries that encapsulate decoded CAN data as the target ROS message library for visualization;

[0014] Generate CAN picture information according to the decoded CAN data in the target ROS message library, and publish the CAN picture information to the corresponding visualization message topic.

[0015] According to one embodiment of the present application, after obtaining the decoded CAN data corresponding to each CAN original data, it also includes:

[0016] Get CAN data subscription requirements;

[0017] Determine the topic of the message to be published based on the CAN data subscription requirement;

[0018] Target CAN data is screened out from all decoded CAN data according to the subject of the message to be published, and the target CAN data is published.

[0019] According to one embodiment of the present application, the target decoding device is a DBC protocol file.

[0020] According to the ROS-based driver node software design method of the embodiment of the present application, at least one CAN raw data is obtained, and the corresponding target decoding device is matched according to the corresponding ID of each CAN raw data to decode the corresponding CAN raw data, and the decoded CAN data corresponding to each CAN raw data is obtained, and the data category of each decoded CAN data is obtained, and the corresponding message topic is matched according to the data category of each decoded CAN data to publish the corresponding decoded CAN data. Thus, the problems of inaccurate message parsing, low data distribution efficiency, cumbersome data collection and playback operations, and unsatisfactory data visualization effects in the related art are solved, and the efficiency and flexibility of EyeQ4 data processing based on ROS and the convenience of algorithm development and testing are improved by designing a three-layer software inheritance structure.

[0021] The second aspect of the present application provides a ROS-based driver node software design device, including:

[0022] An acquisition module, used for acquiring at least one CAN raw data;

[0023] A parsing module, used for matching a target decoding device of each original data ID according to a corresponding ID of each CAN original data, and decoding the corresponding CAN original data according to the target decoding device of each original data ID, to obtain decoded CAN data corresponding to each CAN original data;

[0024] The matching module is used to obtain the data category of each decoded CAN data, match the corresponding message subject according to the data category of each decoded CAN data, and publish the corresponding decoded CAN data according to the message subject.

[0025] According to one embodiment of the present application, after matching the corresponding message subject according to the data category of each decoded CAN data, the matching module further includes:

[0026] A first acquisition unit, configured to acquire a ROS message library corresponding to a data category of each decoded CAN data;

[0027] The encapsulation unit is used to encapsulate each decoded CAN data into the corresponding ROS message library, and publish the ROS message library encapsulating the decoded CAN data to the corresponding message topic.

[0028] According to one embodiment of the present application, the packaging unit further includes:

[0029] An identification subunit, used to identify the target ROS message library where the decoded CAN data encapsulated in all ROS message libraries are visualization data;

[0030] The generating subunit is used to generate CAN picture information according to the decoded CAN data in the target ROS message library, and publish the CAN picture information to the corresponding visualization message topic.

[0031] According to an embodiment of the present application, after obtaining the decoded CAN data corresponding to each CAN original data, the parsing module further includes:

[0032] The second acquisition unit is used to obtain CAN data subscription requirements;

[0033] A determination unit, configured to determine a topic of a message to be published based on the CAN data subscription requirement;

[0034] The screening unit is used to screen out target CAN data from all decoded CAN data according to the subject of the message to be published, and publish the target CAN data.

[0035] According to one embodiment of the present application, the target decoding device is a DBC protocol file.

[0036] According to the ROS-based driver node software design device of the embodiment of the present application, at least one CAN raw data is obtained, and the corresponding target decoding device is matched according to the corresponding ID of each CAN raw data to decode the corresponding CAN raw data, and the decoded CAN data corresponding to each CAN raw data is obtained, and the data category of each decoded CAN data is obtained, and the corresponding message topic is matched according to the data category of each decoded CAN data to publish the corresponding decoded CAN data. Thus, the problems of inaccurate message parsing, low data distribution efficiency, cumbersome data collection and playback operations, and unsatisfactory data visualization effects in the related art are solved, and the efficiency and flexibility of EyeQ4 data processing based on ROS and the convenience of algorithm development and testing are improved by designing a three-layer software inheritance structure.

[0037] The third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the ROS-based driver node software design method as described in the above embodiment.

[0038] The fourth aspect of the present application provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the ROS-based driver node software design method as described in the above embodiment.

[0039] The fifth aspect of the present application provides a computer program product, including a computer program, which is executed to implement the ROS-based driver node software design method described in the above embodiment.

[0040] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0042] Figure 1 A flowchart of a ROS-based driver node software design method provided according to an embodiment of the present application;

[0043] Figure 2 A schematic diagram of a three-layer class inheritance relationship of a driver node software according to an embodiment of the present application;

[0044] Figure 3 A flowchart of processing lane line and target data according to an embodiment of the present application;

[0045] Figure 4 is a block diagram of an exemplary device for designing driver node software based on ROS according to an embodiment of the present application;

[0046] Figure 5 Schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0047] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0048] The following describes the ROS-based driver node software design method, device, equipment and medium of the embodiment of the present application with reference to the accompanying drawings. In view of the problems of inaccurate message parsing, low data distribution efficiency, cumbersome data collection and playback operations, and unsatisfactory data visualization effects in the related technologies mentioned in the above background technology, the present application provides a ROS-based driver node software design method, in which at least one CAN raw data is obtained, and the corresponding target decoding device is matched according to the corresponding ID of each CAN raw data to decode the corresponding CAN raw data, and the decoded CAN data corresponding to each CAN raw data is obtained, and the data category of each decoded CAN data is obtained, and the corresponding message topic is matched according to the data category of each decoded CAN data to publish the corresponding decoded CAN data. Thus, the problems of inaccurate message parsing, low data distribution efficiency, cumbersome data collection and playback operations, and unsatisfactory data visualization effects in the related technologies are solved, and the efficiency and flexibility of EyeQ4 data processing based on ROS and the convenience of algorithm development and testing are improved by designing a three-layer software inheritance structure.

[0049] Specifically, before introducing the embodiments of the present application, the framework of software development involved in the embodiments of the present application is first introduced, such as the ROS (Robot Operating System) system. ROS provides a large number of toolkits and libraries to help software developers create robot applications. Its built-in libraries and tools can support the solution of problems including: device drivers, visualization, algorithm libraries, message sending, and software package management. As an open source system, the development of ROS is very flexible, convenient for expansion and transformation, and supports C++ and Python APIs. ROS can transmit data through underlying drivers such as Linux drivers, and control motion through kinematic solutions of various algorithms. Among them, the above logic can be written by itself and encapsulated into a node, so as to be controlled through topics / services. The following is a detailed discussion of the software design method of the signal parsing driver node of the ROS-based intelligent driving system visual algorithm processor EyeQ4 in the embodiments of the present application through specific embodiments.

[0050] Specifically, Figure 1 A flowchart of a ROS-based driver node software design method provided in an embodiment of the present application.

[0051] like Figure 1 As shown, the ROS-based driver node software design method includes the following steps:

[0052] In step S101 , at least one CAN raw data is acquired.

[0053] Specifically, Figure 2 As shown, the embodiment of the present application adopts the user's ROS-based intelligent driving system visual algorithm processor EyeQ4 signal analysis driver node software design as a three-class inheritance software structure, namely: the first layer, CAN data communication layer (CAN Interface Manager), the main function of which is responsible for the communication of the underlying hardware, the second layer, the data decoding layer (EyeQ4 Message Manager) and the third layer, the data publishing layer (EyeQ4 ROS Publisher), wherein EyeQ4Message Manager inherits the CAN Interface Manager class, and EyeQ4 ROS Publisher inherits the EyeQ4Message Manager class, thereby realizing the data processing of the visual sensor, the testing of the path planning algorithm, and the monitoring and visualization of the vehicle status through the three-layer inheritance structure.

[0054] Specifically, in the embodiment of the present application, at least one CAN raw data is first obtained through the CAN Interface Manager layer, that is, the raw data frame received by the CAN interface is directly obtained, and then the EyeQ4 Message Manager layer inherits the CAN Interface Manager class, and performs the next step of related operations on the CAN raw data. Since the CANInterface Manager class does not rely on any decoding function or any ROS-related library, it can be directly transplanted to any application to be responsible for the function of receiving CAN data.

[0055] In step S102, the target decoding device of each original data ID is matched according to the corresponding ID of each CAN original data, and the corresponding CAN original data is decoded according to the target decoding device of each original data ID to obtain the decoded CAN data corresponding to each CAN original data.

[0056] Specifically, after the EyeQ4 Message Manager of the embodiment of the present application inherits the CAN Interface Manager class, each CAN raw data will be decoded by a different decoder according to the ID, that is, based on the corresponding ID of at least one CAN raw data obtained, the target decoding device of each raw data ID is matched respectively, so that the corresponding CAN raw data is decoded respectively according to the target decoding device of each raw data ID, and the corresponding data is updated, and finally the decoded CAN data corresponding to each CAN raw data is obtained respectively. Among them, in the EyeQ4 Message Manager class, it also does not rely on any ROS-related library, and can be ported to other non-ROS applications to be responsible for the function of decoding the CAN messages output by EyeQ4.

[0057] Preferably, in order to avoid the need for relevant technical personnel to deeply understand the details of the underlying CAN protocol and the logic development of the application layer, and to improve the development efficiency and the maintainability of the system, the target decoding device of the embodiment of the present application can select the DBC (Database for CAN, controller area network database file) protocol file. The DBC protocol file is a standard file format for describing the CAN bus communication specification, which can store all necessary information for data interaction on the CAN network in a structured manner, mainly including four parts: message definition, signal definition, node definition and comments and version information. In this way, the configuration of the CAN network can be communicated in a unified and standardized format, so that different development tools and software (such as Vector's CANoe, CANalyzer, or CANdb++, ETAS ISOLAR or open source tools) can understand and parse this information.

[0058] In step S103, the data category of each decoded CAN data is obtained, the corresponding message subject is matched according to the data category of each decoded CAN data, and the corresponding decoded CAN data is published according to the message subject.

[0059] According to one embodiment of the present application, after matching the corresponding message topic according to the data category of each decoded CAN data, it also includes: obtaining the ROS message library corresponding to the data category of each decoded CAN data; encapsulating each decoded CAN data into the corresponding ROS message library, and publishing the ROS message library encapsulated with the decoded CAN data to the corresponding message topic.

[0060] Specifically, Figure 3 As shown, in the embodiment of the application, after decoding the corresponding CAN raw data using the DBC protocol file in the EyeQ4 Message Manager layer and obtaining the decoded CAN data corresponding to each CAN raw data, the data category of each decoded CAN data and the ROS message library corresponding to the data category of each decoded CAN data are obtained through the EyeQ4 ROS Publisher, each decoded CAN data is respectively encapsulated into the corresponding ROS message library, and the ROS message library encapsulated with the decoded CAN data is published to the corresponding message topic (Topic), so as to publish the corresponding decoded CAN data according to the message topic.

[0061] Specifically, after inheriting the EyeQ4 Message Manager class, the EyeQ4 ROS Publisher of the embodiment of the present application obtains the data category of each decoded CAN data and the ROS message library corresponding to the data category of each decoded CAN data. For example, the data category of the decoded CAN data can be lane lines, target detection information, road edge detection information, etc. After a cycle of sending decoded CAN data ends and all decoded CAN data are updated, each decoded CAN data is respectively encapsulated into the corresponding ROS message library, and each publisher publishes the ROS message library encapsulated with the decoded CAN data to the corresponding message topic. The EyeQ4 ROS driver node program of the embodiment of the present application will create multiple message topics to publish the corresponding decoded CAN data, wherein the specific correspondence between the ROS message library of the decoded CAN data and the corresponding message topic can be shown in Table 1:

[0062] Table 1

[0063]

[0064]

[0065] It should be noted that in the embodiment of the present application, the message topic is the way for all ROS message libraries (i.e., ROS nodes) to transmit data. The ROS message library sends the corresponding decoded CAN data through the message topic (i.e., the ROS node publishes a message topic), and the ROS node also receives the corresponding decoded CAN data through the topic (i.e., the ROS node subscribes to a message topic). There is no other connection between the ROS nodes. As long as the decoded CAN data type is correct, the decoded CAN data can be sent and read through the message topic. At the same time, the data structure of all messages is defined to be as consistent as possible with the content of the CAN original data output, including the naming and hierarchical relationship of data points.

[0066] According to one embodiment of the present application, a ROS message library encapsulating decoded CAN data is published to a corresponding message topic, and also includes: identifying a target ROS message library in which the decoded CAN data encapsulated in all ROS message libraries is visualization data; generating CAN picture information according to the decoded CAN data in the target ROS message library, and publishing the CAN picture information to the corresponding visualization message topic.

[0067] Specifically, after the embodiment of the present application publishes the ROS message library encapsulating the decoded CAN data to the corresponding message topic through the EyeQ4 ROS Publisher layer, if there is visualization data in all the decoded CAN data, the visualization data is encapsulated into the target ROS message library, and the EyeQ4 ROS Publisher layer generates corresponding CAN image information according to the decoded CAN data (i.e., visualization data) in the target ROS message library, and then publishes the CAN image information to the corresponding visualization message topic, so that the CAN image information in the visualization topic can be displayed through the ROS built-in visualization tool Rviz.

[0068] According to one embodiment of the present application, after obtaining the decoded CAN data corresponding to each CAN original data, it also includes: obtaining CAN data subscription requirements; determining the topic of the message to be published based on the CAN data subscription requirements; filtering out target CAN data from all decoded CAN data according to the topic of the message to be published, and publishing the target CAN data.

[0069] Specifically, after publishing each acquired decoded CAN data to the corresponding message topic, the embodiment of the present application can obtain the decoded CAN data subscription demand based on the data processing node, and determine the message topic to be published corresponding to each decoded CAN data based on the decoded CAN data subscription demand, so as to filter out the target CAN data from all the decoded CAN data according to the message topic to be published, that is, the decoded CAN data subscription demand database, and publish the target CAN data.

[0070] In summary, in order to facilitate those skilled in the art to better understand the embodiments of the present application, an application example will be described below. The specific method is as follows:

[0071] First, the compilation and operation of the EyeQ4 ROS driver node in the embodiment of the present application have the following system requirements: (1) The test system needs to use version 18.04 of the Ubuntu operating system; (2) The software project or system needs to be developed, compiled and run under the version framework of ROS Melodic, where ROS Melodic supports the Ubuntu 18.04 operating system.

[0072] Secondly, compile the system code: (1) Create a ROS workspace, for example, name it "catkin_ws"; (2) Create a "src" folder in the "catkin_ws" folder, and copy the source code folder "EyeQ4_ROS" of the ROS message library and the message topic definition folder "me_msg" to the "src" folder to obtain "catkin_ws / src / EyeQ4_ROS" and "catkin_ws / src / me_msg"; (3) Open the command line, enter the catkin_ws file directory, enter the command catkin_make, and wait for the compilation to succeed.

[0073] Thirdly, receive real-time CAN data and process the CAN data through a three-layer inheritance structure, that is, obtain at least one CAN raw data through the CANInterface Manager layer, decode the ID corresponding to each CAN raw data by the DBC protocol file in the EyeQ4 Message Manager layer, and update the corresponding data to obtain the decoded CAN data corresponding to each CAN raw data. The EyeQ4 ROS Publisher layer will encapsulate all decoded CAN data into the corresponding ROS message library, and each publisher will publish it to the corresponding message topic in the ROS message library. If there is visualized decoded CAN data, the image information corresponding to the decoded CAN data will be generated in this layer and published to the corresponding visualization message topic. The main processing and operation process of CAN data includes the following steps:

[0074] (1) Set the CAN port. Assume that the CAN data access port is can0 and open the command line.

[0075] (2) Start ROSCORE and open a new command line;

[0076] (3) Start the EyeQ4_ROS node and open a new command line. The program node will run and start publishing decoded CAN data.

[0077] (4) Start rqt to check the status of the decoded CAN data transmission. Open a new command line and enter: rqt. At this time, rqt will start, and information such as the ROS message library, message topic, and decoded CAN data will be displayed in real time.

[0078] Then, when the recorded CAN data stream needs to be used without connecting to a real CAN device, the embodiment of the present application can use the following method to access the data using the decoded CAN data. The main steps are:

[0079] (1) Set the virtual CAN port vcan0:

[0080] (2) Use canplayer to replay the CAN data stream. At this time, vcan0 will generate data stream like a real CAN port. Among them, 'vcan0=can0, vcan0=can1' means that the data generated by can0 and can1 in the CAN raw data are mapped to vcan0;

[0081] (3) Use the above-mentioned method for receiving real-time CAN data to continue to perform the corresponding operations after step (2), and replace can0 with vcan0 to process the replayed CAN data stream.

[0082] Finally, the embodiment of the present application can use Rviz to display visual data. Rviz is a graphical tool that comes with ROS, which can easily perform graphical operations on ROS programs. The method of using Rviz to display the visual data output by the EyeQ4_ROS node is as follows: (1) After the EyeQ4_ROS node program is started and runs normally, open a new command line and run Rviz; (2) Find and click "Add" in the lower left corner of the operation interface; (3) Find the "By topic" label in the pop-up window, find the visualization theme created by EyeQ4 that needs to be displayed in the list and add it; (4) After adding the visualization theme, you need to change the Fixed Frame option under Global Option to "host". If all optional visualization themes are added, it can be seen from the display diagram of the system interface that the yellow, black and white lines are lane lines, the gray line is the road edge, the blue line is the lane centerline prediction, the red dot is the stop line position, the green vehicle is the ordinary vehicle detection result, the green rectangle is the truck detection result, and the small yellow cube is the traffic light position (traffic signs, etc. are not displayed). In this way, data processing of ROS-based visual sensors, testing of path planning algorithms, and monitoring and visualization of vehicle status can be realized.

[0083] In summary, based on the specific discussion of the above embodiments of the present application, the following beneficial effects can be achieved:

[0084] (1) The design of a three-layer class inheritance structure makes the responsibilities of each layer clear, which is easy to maintain and expand data. It is also convenient for transplantation in non-ROS environments, and can realize the distribution function of EyeQ4 output data, so that different data processing nodes can use the output messages at the same time, and have a unified interface protocol, ensuring that the published ROS message structure is consistent with the original CAN output data of EyeQ4, simplifying data mapping and usage logic;

[0085] (2) By defining multiple ROS topics for publishing different types of data, such as object detection, lane information, road signs, etc., the standardization and efficiency of data transmission are guaranteed;

[0086] (3) Through data management and testing, a data collection and playback function was designed to facilitate the algorithm development and testing phases, ensuring the repeatability and efficiency of algorithm verification. At the same time, the intuitive visualization of EyeQ4 output data was achieved, which helps relevant technical personnel to intuitively understand the data structure and accelerate the algorithm iteration and debugging process.

[0087] According to the ROS-based driver node software design method of the embodiment of the present application, at least one CAN raw data is obtained, and the corresponding target decoding device is matched according to the corresponding ID of each CAN raw data to decode the corresponding CAN raw data, and the decoded CAN data corresponding to each CAN raw data is obtained, and the data category of each decoded CAN data is obtained, and the corresponding message topic is matched according to the data category of each decoded CAN data to publish the corresponding decoded CAN data. Thus, the problems of inaccurate message parsing, low data distribution efficiency, cumbersome data collection and playback operations, and unsatisfactory data visualization effects in the related art are solved, and the efficiency and flexibility of EyeQ4 data processing based on ROS and the convenience of algorithm development and testing are improved by designing a three-layer software inheritance structure.

[0088] Next, a ROS-based driver node software design device proposed according to an embodiment of the present application is described with reference to the accompanying drawings.

[0089] Figure 4 It is a block diagram of a ROS-based driver node software design device according to an embodiment of the present application.

[0090] like Figure 4 As shown, the ROS-based driver node software design device 10 includes: an acquisition module 100 , a parsing module 200 and a matching module 300 .

[0091] Wherein, the acquisition module 100 is used to acquire at least one CAN original data;

[0092] The parsing module 200 is used to match the target decoding device of each original data ID according to the corresponding ID of each CAN original data, and decode the corresponding CAN original data according to the target decoding device of each original data ID to obtain the decoded CAN data corresponding to each CAN original data;

[0093] The matching module 300 is used to obtain the data category of each decoded CAN data, match the corresponding message subject according to the data category of each decoded CAN data, and publish the corresponding decoded CAN data according to the message subject.

[0094] According to one embodiment of the present application, after matching the corresponding message subject according to the data category of each decoded CAN data, the matching module 300 further includes:

[0095] A first acquisition unit is used to acquire a ROS message library corresponding to a data category of each decoded CAN data;

[0096] The encapsulation unit is used to encapsulate each decoded CAN data into a corresponding ROS message library, and publish the ROS message library encapsulating the decoded CAN data to a corresponding message topic.

[0097] According to one embodiment of the present application, the packaging unit further includes:

[0098] An identification subunit, used to identify the target ROS message library where the decoded CAN data encapsulated in all ROS message libraries are visualization data;

[0099] The generation subunit is used to generate CAN image information according to the decoded CAN data in the target ROS message library, and publish the CAN image information to the corresponding visualization message topic.

[0100] According to an embodiment of the present application, after obtaining the decoded CAN data corresponding to each CAN original data, the parsing module 200 further includes:

[0101] The second acquisition unit is used to obtain CAN data subscription requirements;

[0102] A determination unit, used to determine the topic of the message to be published based on the CAN data subscription requirements;

[0103] The screening unit is used to screen out target CAN data from all decoded CAN data according to the subject of the message to be published, and publish the target CAN data.

[0104] According to one embodiment of the present application, the target decoding device is a DBC protocol file.

[0105] According to the ROS-based driver node software design device of the embodiment of the present application, at least one CAN raw data is obtained, and the corresponding target decoding device is matched according to the corresponding ID of each CAN raw data to decode the corresponding CAN raw data, and the decoded CAN data corresponding to each CAN raw data is obtained, and the data category of each decoded CAN data is obtained, and the corresponding message topic is matched according to the data category of each decoded CAN data to publish the corresponding decoded CAN data. Thus, the problems of inaccurate message parsing, low data distribution efficiency, cumbersome data collection and playback operations, and unsatisfactory data visualization effects in the related art are solved, and the efficiency and flexibility of EyeQ4 data processing based on ROS and the convenience of algorithm development and testing are improved by designing a three-layer software inheritance structure.

[0106] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:

[0107] A memory 501 , a processor 502 , and a computer program stored in the memory 501 and executable on the processor 502 .

[0108] When the processor 502 executes the program, the ROS-based driver node software design method provided in the above embodiment is implemented.

[0109] Furthermore, the electronic device further comprises:

[0110] The communication interface 503 is used for communication between the memory 501 and the processor 502 .

[0111] The memory 501 is used to store computer programs that can be executed on the processor 502 .

[0112] The memory 501 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0113] If the memory 501, the processor 502 and the communication interface 503 are implemented independently, the communication interface 503, the memory 501 and the processor 502 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0114] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can communicate with each other through an internal interface.

[0115] The processor 502 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0116] This embodiment also provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the above-mentioned ROS-based driver node software design method is implemented.

[0117] This embodiment also provides a computer program product, including a computer program, which is executed to implement the ROS-based driver node software design method of the above embodiment.

[0118] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0119] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0120] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0121] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.

[0122] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0123] A person skilled in the art may understand that all or part of the steps in the above-mentioned embodiment method may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0124] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0125] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A driver node software design method based on ROS, characterized in that: The method comprises the following steps: Obtaining at least one controller area network (CAN) raw data; Matching a target decoding device for each original data ID according to the corresponding identity identification ID of each CAN original data, and decoding the corresponding CAN original data according to the target decoding device for each original data ID, to obtain decoded CAN data corresponding to each CAN original data; The data category of each decoded CAN data is obtained, a corresponding message topic is matched according to the data category of each decoded CAN data, and the corresponding decoded CAN data is published according to the message topic.

2. The method according to claim 1, characterized in that After matching the corresponding message subject according to the data category of each decoded CAN data, the method further includes: Obtain a robot operating system ROS message library corresponding to the data category of each decoded CAN data; Each decoded CAN data is encapsulated into the corresponding ROS message library, and the ROS message library encapsulating the decoded CAN data is published to the corresponding message topic.

3. The method according to claim 2, characterized in that The step of publishing the ROS message library encapsulating the decoded CAN data to the corresponding message topic also includes: Identify all ROS message libraries that encapsulate decoded CAN data as the target ROS message library for visualization; Generate CAN picture information according to the decoded CAN data in the target ROS message library, and publish the CAN picture information to the corresponding visualization message topic.

4. The method according to claim 1, characterized in that: After obtaining the decoded CAN data corresponding to each CAN original data, the method further includes: Get CAN data subscription requirements; Determine the topic of the message to be published based on the CAN data subscription requirement; Target CAN data is screened out from all decoded CAN data according to the subject of the message to be published, and the target CAN data is published.

5. The method according to claim 1, characterized in that The target decoding device is a DBC protocol file.

6. A driver node software design device based on ROS, characterized in that: include: An acquisition module, used for acquiring at least one CAN raw data; A parsing module, used for matching a target decoding device of each original data ID according to a corresponding ID of each CAN original data, and decoding the corresponding CAN original data according to the target decoding device of each original data ID, to obtain decoded CAN data corresponding to each CAN original data; The matching module is used to obtain the data category of each decoded CAN data, match the corresponding message subject according to the data category of each decoded CAN data, and publish the corresponding decoded CAN data according to the message subject.

7. The device according to claim 6, characterized in that After matching the corresponding message subject according to the data category of each decoded CAN data, the matching module further includes: An acquisition unit, used for acquiring a ROS message library corresponding to a data category of each decoded CAN data; The encapsulation unit is used to encapsulate each decoded CAN data into the corresponding ROS message library, and publish the ROS message library encapsulating the decoded CAN data to the corresponding message topic.

8. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the ROS-based driver node software design method according to any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the ROS-based driver node software design method as described in any one of claims 1 to 5.

10. A computer program product, comprising a computer program, characterized in that The computer program is executed to implement the ROS-based driver node software design method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Flight carrier hardware-in-loop communication method, device and system and storage medium

    CN115580668A

  • Decoding method and apparatus

    US20240171304A1

  • Motor-vehicle-hosted can-bus data and network communications system

    WO2017131763A1