Local Navigation
{% hint style="info" %}
Related C++ Header in the Auterion SDK:<auterion_sdk/navigation/local_navigation.hpp>
{% endhint %}
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
:
cpp
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:
```cpp 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:
{% code fullWidth="false" %} ```cpp // 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); ``` {% endcode %}
Sending Measurements
You can now send your local position measurement by simply calling the interface's update
method:
cpp
nav_interface.update(my_measurement);
Comments
0 comments
Please sign in to leave a comment.