Function is_valid_gps

Function Documentation

bool is_valid_gps(const arma::vec &gps, const arma::vec &previous_gps, double low_threshold, double high_threshold)

Checks if the GPS data is valid based on distance thresholds.

This function checks if the distance between the current and previous GPS positions is within specified thresholds.

Parameters:
  • gps – A vector of two elements representing the current GPS position [latitude, longitude].

  • previous_gps – A vector of two elements representing the previous GPS position [latitude, longitude].

  • low_threshold – The minimum distance threshold for valid GPS data.

  • high_threshold – The maximum distance threshold for valid GPS data.

Returns:

A boolean indicating whether the GPS data is valid (true) or not (false).