Tuesday 1 August 2017

TrafficControl: Mapping Position on Track to Coordinates

TrafficControl is supposed to present the train positions on the tracks in real-time. To achieve this, the trains needs to get their locations, when providing their location on the tracks.

I'll implement a function in tcTrack that will work in three steps:
  1. In the track constructor, the coordinates are already provided. A Haversine formula will calculate the accumulated distances between the first waypoint of the track and all following waypoints.
    1. Import coordinates to constructor - DONE
    2. Implement Haversine function - DONE
    3. Use Haversine function to generate list of accumulated distances - DONE
  2. A function will take an integer as input parameter (position on track in meters). The function will return the last waypoint that is before the input position. - DONE
  3. Another function that interpolates to provide the accurate coordinate.


The result can be seen in the video below. The color of the tracks are: Green (empty), Yellow (occupied). The color of the border of the station circles are: Green (empty), Yellow (populated) and Red (full).



After upgrading Qt from 5.7 to 5.9.1, that came two weeks ago, the map issue with tiles is resolved.
The road map forQt 5.9 canbe found on the web site.

No comments:

Post a Comment