RTLE(RealTime Location Engine) Design

The location engine is the most important part of the entire location system. It is responsible for receiving data packets from each anchor and calculating the coordinates of the tag.

For the initial version, we developed it in Java. Later, it needed to be sold as a product. Java lacked sufficient security measures and could easily be decompiled. Our intellectual property rights could not be protected. Therefore, we changed to rewrite the location engine in C++. Because our customers basically use Windows servers, the location engine currently only has the Windows version. At the beginning of the design, we considered cross-platform and considered support for Linux in some important places. In fact, when the C++ version of the location engine was first written, we successfully compiled a Linux version and ran it on Ubuntu.

We need to continuously improve the engine, add functions, or improve ease of use. Customers basically have no demand for Linux, so we no longer pay attention to Linux support. If you have this need, it should be easiest to adapt the location engine to Linux.

The core of the location engine is the calculation of coordinates. We studied several algorithms, and by default, the least squares method is used for calculations. This algorithm is fast and highly accurate.

The location engine interface supports 5 methods: TCP binary message interface, RESTful style interface, TCP text message interface, TCP custom binary message interface, and serial text message interface.

Because UWB is defined as near field communication, this means that the coverage range of UWB will be very small. In particular, the radio management department has restrictions on the signal strength of UWB sending equipment. If the equipment is to be compliant, the coverage will be very small. In addition, some environments that require location are more complex, such as obstructions such as walls. In short, we need to support multi-region location, divide a large venue into multiple location areas, and deploy location anchors in each location area. These small location areas are combined to form a complete location area.

Our location engine supports multi-region location. For example, under normal circumstances, the range of each location area is 100 meters * 100 meters. The 400 meters * 400 meters area can be divided into 4 small areas in the shape of "田", which is equivalent to deploying "4 sets of location systems" . Of course, our system supports anchor reuse on regional boundaries. For example, if a anchor is deployed at the center of the word "田", all four regions can share this anchor. Deploying a anchor at each intersection of the word "田", with a total of 9 anchors, can achieve the effect of 4 anchors in each location area.

In practice, we found that there are fixed offsets in some places. To this end, we developed an algorithm to correct fixed offsets.

The development of this algorithm benefited from the satellite photo correction I had developed before. When I was building a GIS system before, I needed to correct the satellite photos purchased from a satellite photo company. Because the ground is not flat, and when satellites take pictures, they do not always take pictures from directly above the target area. They are always taken from a side angle. In this way, the objects in the photo will be offset, with taller objects more offset and shorter objects less offset. We need an orthographic image, so we need to correct those offsets.

A key to the DW1000 chip's calculation of time is the crystal oscillator it uses. Although high-precision and high-stability crystal oscillators are used as much as possible, the output frequencies of different crystal oscillators will still have slight deviations; in addition, quartz crystal oscillators are greatly affected by the environment, such as voltage fluctuations, temperature changes, etc. For example, in some environments that require very high stability, a constant-temperature crystal oscillator is used, a box is made to wrap the crystal oscillator, and some circuits are used to ensure that the temperature in the box is constant. . . However, the cost will be higher and the volume will become larger. In short, we need to understand the clock stability of each anchor, so we wrote a program to visually display this change.

This program is for research and development use and is not provided to users. It is also used in production. Sometimes, some customers have very high accuracy requirements and can use this program to select anchors with high stability.

For the development of the CPP version of the location engine, we use Visual Studio as the development environment. Some third-party libraries are used.。

For example, ASIO/nlohmann json/corvusoft restbed/sqlite, etc., these libraries are all open source and within the scope of their license.

When using CPP to develop server-side programs, the biggest fear is memory leaks. In order to determine memory safety, in the debug version, we added object tracking counts at the constructors and destructors of each class.

We need to make sure the objects in memory are healthy. When exiting the program, we also need to ensure that all objects in the memory have been released (check whether the number of objects is 0).

In the location engine, we planned to add some features, but due to time constraints, they were not completed.

Integrated management front-end. At present, we make the management of the location engine a separate C/S project. The backend is developed in Java and communicates with the location engine through the interface. This leads to the system's dependence on Java. We want to use C++ to do what the Java backend does. In order to improve flexibility, a Lua interpreter can also be integrated into the location engine, and certain functions can be customized using Lua.
Added support for TOF location algorithm. In some scenarios, TOF has advantages over TDOA. We plan to add TOF support.
This project has been put down for a long time. I just unzipped the backed up code, installed a VS2022, compiled it, and it built normally.

Below is the user manual of the location engine. You can download it to see what functions it has.

下载《联创UWB实时定位系统使用手册V3.12.1.pdf》

Copyright

The articles on this site are all original and the copyright belongs to Zhang Xiaolong.

Anyone can reprint, but the source and author information must be indicated.