Global Navigation

Header <auterion_sdk/navigation/global_navigation.hpp>

The global navigation interface allows you to send measurements of your drone's global position to the FMU.

Instantiation

You can instantiate a global navigation interface by instantiating an object of type auterion::GlobalNavigationInterface:

auterion::GlobalNavigationInterface nav_interface(sdk);

The interface provides an update method which expects a GlobalPositionMeasurement object as an argument, and which sends your position measurements to the state estimator of the FMU.

Global Position Measurements

To send global position measurements, you must first build a GlobalPositionMeasurement object and fill in the fields you want to send updates for. A GlobalPositionMeasurement object holds the following fields:

  • The timestamp of your measurement sample

  • A horizontal position as a longitude and latitude (in degrees)

  • The horizontal position error variance (in m²)

  • A vertical position as an altitude (in meters above mean sea level)

  • The vertical position error variance (in m²)

To instantiate a global position measurement, you need to provide the time at which the measurement was captured:

rclcpp::Time measurement_time = ...
auterion::GlobalPositionMeasurement my_measurement(measurement_time);

// Optionally the measurement time can be left empty
// which will default the measurement time to the current time
auterion::GlobalPositionMeasurement my_other_measurement();

The GlobalPositionMeasurement class then provides builder methods to populate your measurement instance with the data that you have collected. You can choose which builder methods to call depending on which states you have measured:

// Collected measurement fields
double lat = 47.3769;
double lon = 8.5417;
float horizontal_variance = 0.5F;
float alt_amsl = 12.7F;
float vertical_variance = 0.3F;

// Populate measurement with measured fields
my_measurement = my_measurement.withPosition(lat, lon, horizontal_variance)
                               .withAltitude(alt_amsl, vertical_variance);

// Populate measurement with only a horizontal position
my_pos_measurement = my_pos_measurement.withPosition(lat, lon, horizontal_variance);

// Populate measurement with only a vertical position
my_alt_measurement = my_alt_measurement.withAltitude(alt_amsl, vertical_variance);

// Optionally the variance field can be left empty if unknown
my_imprecise_measurement = my_imprecise_measurement.withPosition(lat, lon)
                                                   .withAltitude(alt_amsl); 

Sending Measurements

You can now send your global position measurement by simply calling the interface's update method:

nav_interface.update(my_measurement);

Last updated