Function latlon_to_xy(const arma::vec&, const arma::vec&)

Function Documentation

arma::vec latlon_to_xy(const arma::vec &gps, const arma::vec &gps_0)

Function to convert latitude and longitude to (x, y) coordinates.

This function takes the initial and current longitude and latitude and returns a vector of values indicating the (x, y) coordinates in meters with respect to the origin of the car’s reference frame

Parameters:
  • gps – A vector of two elements representing the current latitude and longitude in degrees

  • gps_0 – A vector of two elements representing the initial latitude and longitude in degrees

Returns:

A vector of two elements representing the (x, y) coordinates in meters