0.0.21 • Published 4 months ago

line-cross-detect v0.0.21

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

Vetkuro - detect crossing track line form GPS

TelemetryProcessor Library

Overview

A library for processing GPS data for determining laps around a track, with the track's start and finish line defined as a straight line between two GPS coordinates.

Classes

Lap Class

Represents a lap around a track.

Public Methods

  • tick(currentTick: Tick, prevTick?: Tick): void - Update the lap information based on the current tick.

  • getIsFinished(): boolean - Get whether the lap is finished or not.

  • getDistance(): number - Get the total distance of the lap.

  • getEndTime(): number | undefined - Get the end time of the lap.

  • getStartTime(): number | undefined - Get the start time of the lap.

  • lapTime(): number | undefined - Get the duration of the lap.

  • estimatedLapTime(): number | undefined - Get the estimated lap time.

TelemetryProcessor Class

Processes ticks (individual data points of GPS coordinates) to determine laps around a track.

Public Methods

  • processTick(tick: Tick): number - Process a tick, check if it crosses the start/finish line, complete the current lap and start a new one if necessary.

  • getCurrentLap(): Lap - Get the current lap.

  • getLap(lapNumber: number): Lap | undefined - Get the lap with the given lap number.

  • getLaps(): Lap[] - Get all laps.

  • getTicks(): Tick[] - Get all ticks.

Interfaces

Tick Interface

A tick represents a single data point and contains the following properties:

  • speed: The speed at the current tick.
  • timestamp: The timestamp of the current tick.
  • longitude: The longitude of the current tick.
  • latitude: The latitude of the current tick.

TelemetryPosition Interface

Represents a GPS coordinate with properties for longitude and latitude.

Installation

  1. Create directory to store sessions files
mkdir sessions_files
  1. Insert session csv data to sessions_files directory
cp _session.example.csv sessions_files/test_session.csv
  1. Install dependencies
yarn install
  1. Run dev prject
yarn dev
0.0.20

4 months ago

0.0.21

4 months ago

0.0.17

4 months ago

0.0.18

4 months ago

0.0.19

4 months ago

0.0.16

4 months ago

0.0.14

4 months ago

0.0.15

4 months ago

0.0.13

5 months ago

0.0.12

5 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

11 months ago

0.0.6

11 months ago

0.0.5

12 months ago

0.0.4

12 months ago

1.0.0

12 months ago