line-cross-detect v0.0.21
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
- Create directory to store sessions files
mkdir sessions_files- Insert session csv data to sessions_files directory
cp _session.example.csv sessions_files/test_session.csv- Install dependencies
yarn install- Run dev prject
yarn dev2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago