Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Motivation

Many systems have data stored in GPS coordinates (latitude, longitude). To be able to integrate and showcase them in twinzo - Digital Twin platform, they need to be recalculated to local twinzo coordinates. This guide will show you how.

GPS items creation

In the twinzo portal go to bookmark Places/GPS items (documentation here). Without knowing where North is on the layout, you need at least 3 GPS items with x, y, lat, and lon Strong preference for the corners of the sector layout.

...

GPS items download

Here is a screenshot from Postman, showing how to get GPS items downloaded to your software. Three important parameters are Client, Branch, and Api-Key. If you are missing any of them please ask your contact person to provide them.

...

GPS item data structure

In the coming steps, we will show you examples from our Kotlin language implementation of a data structure and calculation.

...

Code Block
languagekotlin
class MyPoint extends Point{

  MyPoint({required double x, required double y}):  super (x, y);

  double angleTo(MyPoint in2){
    return Vector2(this.x as double, this.y as double).angleTo(Vector2(in2.x as double, in2.y as double));
  }

  MyPoint centerOfLineTo(MyPoint in2){
    return new MyPoint(
       x: ((this.x + in2.x) / 2) * 1.0,
       y: ((this.y + in2.y) / 2) * 1.0
    );
  }
}

GPS coordinates recalculation to twinzo coordinates

Now, with the established data structure we are ready to continue with the trilateration.

...

This position, in combination with the Sector from where you obtained GPS items, is enough to provide data to twinzo - Digital Twin platform.