Local Navigation

Related C++ Header in the Auterion SDK:<auterion_sdk/navigation/local_navigation.hpp>

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

Instantiation

You can instantiate a local navigation interface by instantiating an object of type auterion::LocalNavigationInterface:

auterion::LocalNavigationInterface nav_interface(sdk);

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

Local Position Measurements

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

  • The timestamp of your measurement sample

  • A 3D position (in meters, ENU frame)

  • The position error variance (in m²)

  • A 3D velocity (in meters, ENU frame)

  • The velocity error variance (in m²)

  • An attitude quaternion (Hamiltonian convention)

  • The attitude error variance (in rad²)

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

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

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

The LocalPositionMeasurement 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
Eigen::Vector3f position = Eigen::Vector3f {0.2F, 0.1F, 3.0F};
Eigen::Vector3f position_variance = Eigen::Vector3f {0.05F, 0.08F, 0.1F};
Eigen::Vector3f velocity = Eigen::Vector3f {0.8F, 0.7F, 0.1F};
Eigen::Vector3f velocity_variance = Eigen::Vector3f {0.07F, 0.06F, 0.03F};
Eigen::Quaternionf attitude = Eigen::Quaternionf {0.1F, -0.2F, 0.3F, 0.25F};
Eigen::Vector3f attitude_variance = Eigen::Vector3f {0.02F, 0.02F, 0.02F};

// Populate measurement with measured fields
my_measurement = my_measurement.withPosition(position, position_variance)
                               .withVelocity(velocity, velocity_variance)
                               .withAttitude(attitude, attitude_variance);

// Populate measurement with only a position
my_pos_measurement = my_pos_measurement.withPosition(position, position_variance);

// Alternatively, for local position you may specify just
// the horizontal or vertical components
my_pos_hor_measurement = my_pos_hor_measurement.withPositionHorizontal(
                               position.head<2>(), position_variance.head<2>());
my_pos_ver_measurement = my_pos_ver_measurement.withPositionVertical(
                               position.z(), position_variance.z());

// Populate measurement with only a velocity
my_vel_measurement = my_vel_measurement.withVelocity(velocity, velocity_variance);

// Populate measurement with only an attitude
my_att_measurement = my_att_measurement.withAttitude(attitude, attitude_variance);

// Optionally the variance field can be left empty if unknown
my_imprecise_measurement = my_imprecise_measurement.withPosition(position)
                                                   .withVelocity(velocity)
                                                   .withAttitude(attitude); 

Sending Measurements

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

nav_interface.update(my_measurement);

Last updated