0.0.21 • Published 1 year ago

line-cross-detect v0.0.21

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year 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

1 year ago

0.0.21

1 year ago

0.0.17

1 year ago

0.0.18

1 year ago

0.0.19

1 year ago

0.0.16

1 year ago

0.0.14

1 year ago

0.0.15

1 year ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

1.0.0

2 years ago