Struct LocationFix

Struct Documentation

struct LocationFix

A navigation satellite fix for any Global Navigation Satellite System.

Public Types

enum class PositionCovarianceType : uint8_t

Type of position covariance.

Values:

enumerator UNKNOWN

Unknown position covariance type.

enumerator APPROXIMATED

Position covariance is approximated.

enumerator DIAGONAL_KNOWN

Position covariance is per-axis, so put it along the diagonal.

enumerator KNOWN

Position covariance of the fix is known.

Public Functions

FoxgloveError encode(uint8_t *ptr, size_t len, size_t *encoded_len)

Encoded the LocationFix as protobuf to the provided buffer.

On success, writes the serialized length to *encoded_len. If the provided buffer has insufficient capacity, writes the required capacity to *encoded_len and returns FoxgloveError::BufferTooShort. If the message cannot be encoded, writes the reason to stderr and returns FoxgloveError::EncodeError.

Parameters:
  • ptr – the destination buffer. must point to at least len valid bytes.

  • len – the length of the destination buffer.

  • encoded_len – where the serialized length or required capacity will be written to.

Public Members

std::optional<Timestamp> timestamp

Timestamp of the message.

std::string frame_id

Frame for the sensor. Latitude and longitude readings are at the origin of the frame.

double latitude = 0

Latitude in degrees.

double longitude = 0

Longitude in degrees.

double altitude = 0

Altitude in meters.

std::array<double, 9> position_covariance

Position covariance (m^2) defined relative to a tangential plane through the reported position. The components are East, North, and Up (ENU), in row-major order.

PositionCovarianceType position_covariance_type

If position_covariance is available, position_covariance_type must be set to indicate the type of covariance.

std::optional<Color> color

Color used to visualize the location.

Public Static Functions

static Schema schema()

Get the LocationFix schema.

The schema data returned is statically allocated.