Design and Implementation of a GPS Navigation and Positioning System Based on MiniGUI

The positioning system has been booming since its inception, and its application has penetrated into all walks of life. The field of personal consumption has led the emergence of mobile positioning type technology products, and there are also a large number of technical updates in other fields and industries. At present, the positioning systems in various fields are mainly concentrated on the development of platforms and maps. The platform uses hardware in conjunction with application requirements, and the map implements software algorithms according to display requirements. Therefore, they are systematically formed in the research work of the positioning system, and the compatibility is not strong.

In recent years, in the design of positioning systems, hardware selection has increasingly concentrated on several models of several brands. The software design is more scattered. Therefore, centralized software development on a compatible platform will be the future research and development direction.

Here, a system construction mode is proposed to weaken the influence of the hardware platform and strive to maximize the unified software design.

1 system overall design

Here, a practical design scheme is proposed to realize the GPS real-time navigation function by configuring various aspects of the system. The system main control device adopts the ARM core 32-bit RISC microprocessor S3C2410 produced by South Korea's Samsung company, and transplants the Linux operating system on the development board composed of it. The Linux operating system is responsible for the overall scheduling and control of the system. The GPS receiver is connected to the UART interface of the S3C2410 to receive GPS positioning information in NEMA0183 format. Communication via the UART interface with the GSM/GPRS module MC35.

In order to realize the drawing and display of the electronic map on the mobile LED, the overall hierarchical structure of the system is shown in Figure 1. The Linux operating system is responsible for the initialization and management of the underlying hardware, and provides an application interface to the upper layer. The MiniGUI completes the drawing of the electronic map on the LED, and completes the communication through the application interface provided by the Linux kernel with the GPS receiver and the GSM/GPRS module.

Design of GPS Navigation and Positioning System Based on MiniGUI

2 graphical interface support system - MiniGUI

MiniGUI is a lightweight graphical interface support system for embedded systems. MiniGUI can provide maximum interface compatibility on different platforms, and can run on various mainstream embedded hardware platforms such as AR-M and MIPS. It provides a lightweight, low-cost embedded graphical interface.

Here use MiniGUI Ver l. Version 3.3, compiled into a lite version and ported to the ARM core-based 32-bit microprocessor S3C2410. On this basis, the MiniG-UI-based electronic map display application is developed, and the GPS signal receiver is used to realize the positioning and navigation function.

2.1 Cross Compiling MiniGUI

MiniGUI can be divided into 3 layers from the structure level. The top layer is the APT layer. The middle layer is the MiniGUI core. It is responsible for maintaining the operation of the whole window system. The bottom layer consists of two parts, namely the graphic abstraction layer (GAL) and the input abstraction layer. (IAL).

In order for MiniGUI to run on different target platforms, there must be a cross-compilation environment for the corresponding platform. According to the design of this paper, the S3C2410 device is selected. The cross-compilation environment Linux-ARM is selected. The tool chain designed and developed by Mizi for the 32-bit ARM core RISC microprocessor S3C2410 of Samsung is selected. This configuration environment makes the software and hardware better. compatibility. The specific cross-compilation steps are as follows:

1) Modify the configure file. Set the make environment variables CC, LD, AR, etc.

2) Implementation of the GAL (Graphics Engine) and IAL (Input Engine) interfaces. In MiniGUI, GAL and IAL are the two infrastructures of MinGUI. The high reliability of MiniGUI is also due to the fact that these two interfaces provide hardware-independent abstraction capabilities. The abstraction of these two interfaces is similar to the virtual file system in the Linux kernel.

When implementing an input engine (IAL), the most important one is the implementation of the event handler wait_event(). MiniGUl will continuously call this function to determine if an input event occurs on the input engine. Special attention should be paid here. Because MiniGUI implements the inter-process communication mechanism through the select system call, when implementing the wait_event function of the lite version input engine, it must be implemented by the select function or its equivalent poll function. At the same time, when implementing the touch screen driver of the target board, it is necessary to implement the pointer of the poll function in the corresponding file_operaTIons structure. Even if the touchscreen driver does not provide a poll function, call select before wait_event returns and pass the relevant parameters.
The Linux system provides an infrastructure, FrameBuffer, through which a graphical interface to Linux has a unified interface. Because MiniGUI can get a unified graphics engine interface through FrameBuffer.

Therefore, its adaptability is greatly improved, and it is rare to write a GAL driver layer for MiniGUI.

3) Run the configure, make, and make install commands in sequence to complete the configuration and compilation of MiniGUl.

After the above compilation process, the compiled MiniGUI library file will be installed in the /home/MiniGUI-lite directory. In order to reduce the size of the library file, use the config-ure command to remove some of the unnecessary functions in MiniGUI, and use the strip command in the cross-compilation toolchain to delete the symbol information and other debugging information in the MiniGUI function library.

2.2 MiniGUI transplantation to S3C2410

In the embedded system development process, after compiling the MiniGUI and the application, copy the MiniGUI library and application to the file system directory prepared for the target system, and then use the relevant tools to generate the file system image and download it to the target board.

MiniGUI requires a configuration file to configure the environment parameters required for MiniGUI to run. In this design, the configuration file MiniGUI will be used. The cfg is placed in the /etc directory of the target board. In addition, MiniGUI uses framebuffer as its input engine, so when compiling the Linux kernel, choose to compile the framebuffer-related functions into the kernel.

3 Algorithm for drawing electronic map based on MiniGUI 3.1 Algorithm implementation of extracting electronic map data

Since the GUI program is not the same as the traditional single-process program, it is not advisable to obtain GPS data in a simple loop. The system extracts data through a multi-threaded loop, and each group of data is extracted and processed in a single thread, thereby avoiding complex interactions between data and processing, and better reflecting real-time performance.

First, the coordinate system used is described: It is assumed that there is a map with a strictly rectangular shape whose origin is (O, 0), and the width in the X-axis direction of the map is W pixels, in the Y-axis direction. The height is H pixels, and the coordinates of a point on the map are (X, Y), then the normalized coordinates of the pixel are defined as (x/W, y/H). For the terminal, the geographic extent of coverage is almost infinitesimal compared to the radius of the Earth. Therefore, the latitude and longitude coordinates corresponding to the electronic map can be considered to vary linearly within the area covered by the electronic map. With the coordinate data of these two points, when the latitude and longitude coordinates are read from the GPS receiver, the normalized coordinates of the coordinates on the electronic map can be calculated according to the approximate linear mapping relationship. According to the European geometric principle, Equation (1) and Equation (2), the unknown parameters of Point A and Point B can be calculated from the known two points.

Design of GPS Navigation and Positioning System Based on MiniGUI


To get the latitude and longitude coordinates of the top left and bottom right corners of the map, you only need to know the four parameters of the two reference points in the map boundary. The coordinate data listed in Table 1 is obtained by three reference points collected in the field.

Design of GPS Navigation and Positioning System Based on MiniGUI


According to the formula, the above three reference points have three combinations, and three sets of latitude and longitude values ​​are obtained respectively, and the three groups are averaged to reduce errors and improve accuracy. Finally, the coordinate data of the upper left corner and the lower right corner are obtained, as shown in Table 2.

Thereby obtaining the reference point and saving its coordinate data to the coordinate data file taiyuan_gps. In the dat.
To increase flexibility, here is the definition of the following data structure for the coordinate source data:

Design of GPS Navigation and Positioning System Based on MiniGUI

3.2 GPS thread

A single thread is used to read, parse, and calculate a set of acquired data. Define a pthread_t type variable in the program that represents the backend thread that collects and parses the GPS data. Since the GUI front-end and back-end GPS threads have access to certain GPS data, a synchronization strategy needs to be used between threads. This is done using a thread lock, which is defined as GPSL0CK. It is a variable of type pthread_mutex_t.

Corresponding to the geographic information of the Types of Point, Pline and Region, the data structures _POINT, _PLINE and _REGION are defined respectively. Taking the road as an example, the corresponding _PLINE structure is defined in the program to describe related information. The structure is defined as follows:

Design of GPS Navigation and Positioning System Based on MiniGUI

3.3 Drawing of electronic map under MiniGUI

The entry point of the MiniGUI program is MiniGUIMain. The main function has been defined in the function library of MiniGUl. This function calls the MiniGUI-Main function after some initialization of MiniGUI. First call SetDesktopRect function to set the display area of ​​the program, then call CreateMainWindow function to create and display the main window of the program, and finally enter the message loop.

MiniGUI is a message-driven system. Everything works around messages. The MiniGUI application interacts with the outside world by receiving messages. In the process of drawing the electronic map, the window of the MiniGUI is mainly used to draw the message MSG_PAINT. This message is sent to the window procedure when a window redraw is required. MiniGUI determines whether it needs to be redrawn by judging whether the window contains invalid areas. When redrawing is needed, MiniGUI will send MSG_PAINT message to the corresponding window procedure. MSG_TIMER is mainly responsible for obtaining the current latitude and longitude information from the backend GPS thread, and outputting it to the text box after formatting.

When the MiniGUI main program receives the SIGUSR1 signal sent by its GPS communication sub-process, the corresponding signal processing function is called. In order to update the position of the anchor point in the electronic map in real time, the latest position information in the shared memory must be read in the function; at the same time, the area that needs to be redrawed is determined according to the change of the position of the positioning point, and the area is called by the lnvalidateRect function in MiniGUI. invalid. In this way, the latest location information is displayed on the electronic map in real time.

4 Conclusion

With the development of social information, the use of GPS navigation terminals has become a trend, and more and more devices are equipped with positioning or navigation functions. This design uses MiniGUI to realize the basic functions of GPS, which makes the drawing work of the map out of the cumbersome underlying hardware, greatly simplifies this work, and then realizes the real-time positioning and navigation function with the GPS signal receiver. At the same time, there are many places in the design that are worth improving, such as communication feedback accuracy and optimized display of vectorized geographic information.

Ring Type Connecting Terminals

Ring Type Connecting Terminals,Terminals,Connecting Terminals

Taixing Longyi Terminals Co.,Ltd. , https://www.txlyterminals.com