Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Application of remote debugging in Linux vehicle

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article shows you how to remotely debug the application in the Linux machine, the content is concise and easy to understand, absolutely can make your eyes bright, through the detailed introduction of this article, I hope you can get something.

Guide reading

Debugging is an indispensable link in the process of software development. the debugging of embedded operating system is very different from that of desktop operating system, and the visual debugging ability of embedded system is weaker than that of desktop operating system. For the program development with complex business scenarios such as navigation, the visual debugging environment can not only enable us to get twice the result with half the effort, but also quickly locate the problems in the interaction between the navigation business and other modules in the vehicle machine, and improve the debugging efficiency in the development process.

Remote debugging is the most convenient way for real machine debugging. Developers only need to borrow a powerful debugger on the PC side to complete the debugging of business scenarios.

Background

Thrift is an interface description language and binary communication protocol, which is used to define and create cross-language services. It is a RPC (remote procedure call) communication framework developed by Facebook for "large-scale cross-language service development". In the vehicle-machine system, each module can also use the Thrift communication framework to communicate. Navigation, as a separate module that provides services for the process, only provides navigation-related services and the ability of map rendering. The HMI interface of navigation is a unified operation interface in the vehicle-machine system, and the interactive interface between the system HMI interface and navigation is generated through the defined interface description language (IDL), using automation tools to generate local callable interfaces. Then use the Thrift framework to complete the communication between the system HMI and the navigation.

Debugging means

In order to facilitate debugging in the development process, we have made a set of simulator on PC, which can render map on PC. It also implements a set of system HMI simulation command sending tool used on PC, which is a service provided by client connection navigation, so that it can simulate sending commands on the PC side to help navigation simple business development, but this method has the following disadvantages:

Simulation command tools can only simulate simple business scenarios, and there are multiple interactive scenarios that cannot be simulated.

Unable to operate the map HMI, nor can you see the display of the HMI interface and feedback in the process.

Can not scroll the map, followed by the Win32 above the mouse event, can use the mouse to achieve scrolling, but this way is not consistent with the scrolling process in the car.

The PC side cannot use the equipment in the car, such as no navigation sound in the navigation process, unable to use USB and so on.

The PC side can not get the data in the car, such as body data, GPS signal and so on.

Debugging scheme optimization

In view of the above problems existing in the current debugging methods. We optimize the debugging scheme, and we can interact with the navigation with the help of the system HMI in the car. It is realized that the signal in the vehicle environment is used to debug the PC navigation business scene. It mainly has the following functions:

The 1.PC simulator receives the signal from the car and computer.

In this project, the navigation-related business is used as a server to provide services to other modules in the car machine. In the car machine system, the address of the system HMI connection navigation service is fixed. We have developed an agent-Sandwich in the car machine. The main function is to start the navigation service. This navigation service does not realize the real navigation business, but starts an empty service, so that other modules in the car machine can successfully establish a connection. At the same time, Sandwich is the navigation service provided by the client connecting to the simulator on the PC side, and the navigation service on the PC side really realizes the navigation service. Sandwich is responsible for receiving the business request sent by the car machine and forwarding the request to the PC side simulator, so that the PC side simulator can receive the signal in the car machine, receive the business request and do the processing, and then feedback the processing results to the car side through Thrift.

In this process, we can get through the signal in the car machine and send it to the PC simulator, and the processed data can be fed back to the car machine.

3. Project the map displayed in the PC simulator to the car side for display.

With the realization of the above two steps, an environment for debugging PC navigation program using vehicle signal is basically completed. It has been possible to receive the vehicle signal and the PC in both directions, but at this time, the rendering ability of the navigation still stays on the PC. Only a system HMI interface is displayed in the machine, and the effect of the navigation map cannot be seen. This will bring a problem. Some operations that need to rely heavily on the map may not be able to operate accurately, such as clicking a POI on the map. At this point, the presentation of the PC side needs to be synchronized to the machine side.

Generally speaking, we have two ways to achieve this goal:

Simultaneous rendering of car and PC

The navigation in the vehicle runs normally. When the navigation receives the business request of the system module, the navigation is processed first, and then the signal is forwarded to the PC for processing. In this scheme, the navigation business logic of both ends runs in parallel. In complex business scenarios, both sides will interact with the vehicle at the same time, which may lead to mutual exclusion and the scenario where the logic of the two ends is out of sync, which can not achieve the desired effect.

Project the rendered data to the end of the car.

Here, we can transfer the result to the car machine for each frame of the map rendered by the program on PC, which is received by the Sandwich. When the Sandwich receives a frame of map pixel data, it is responsible for rendering the frame data to the car machine screen. At this time, the effect of the car machine is the same as that of the PC end. In this project, we adopted this scheme, in which the real navigation business logic comes from the PC, and the vehicle is only a forwarding process, so there will be no problems in the first scheme.

However, in some specific environments, navigation drawings will be very frequent, and a lot of data will be sent to the car. Frequent data transmission may bring some performance overhead and performance delays. Image data can be reduced by reducing image quality, for example, 16-bit or 8-bit BMP can be used for transmission, and compression transmission can be used so that the 1920-720 resolution image transmission size can be controlled at about 30-50k.

Summary

Based on the Thrift communication framework of the car-machine system, the essence of this remote debugging scheme is to use the Sandwich program to take over all the interface processing that interact with the navigation in the car-machine system, and transmit it through RPC communication to achieve the purpose of debugging navigation with real vehicle-machine signals. With this set of debugging environment, we can even test and debug directly on the road on the real car. Compared with the previous road test to get Log back for analysis and reproduction, the whole debugging process is simple, convenient and intuitive. The development efficiency is greatly improved.

Based on the characteristics of RPC communication, we can further optimize the debugging scheme, we can add multi-client debugging functions, using the same machine environment, different module leaders can jointly debug complex business scenarios at the same time.

The above content is how to remotely debug the application in the Linux machine, have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report