35 #include <Eigen/Eigen>
43 enum class SubscriptionType {
153 TRANSITION_TO_FIXED_WING,
154 TRANSITION_TO_MULTICOPTER,
171 Eigen::Matrix<float, 6, 1>
aux;
190 template <SubscriptionType S,
typename DataType>
191 class SubscriptionImpl;
193 class SystemStateImpl;
205 template <SubscriptionType S,
typename DataType>
208 Subscription(
const std::shared_ptr<SubscriptionImpl<S, DataType>>& impl);
218 void onUpdate(std::function<
void(DataType)> callback);
245 std::shared_ptr<SubscriptionImpl<S, DataType>> _impl;
304 SystemState& subscribeAttitude(std::function<
void(Eigen::Quaternionf)> callback =
nullptr) {
314 SystemState& subscribeArmed(std::function<
void(
bool)> callback =
nullptr) {
345 std::shared_ptr<SystemStateImpl> _impl;
SDK execution class. All callbacks are called on the same thread.
Definition: auterion.hpp:45
A template class for managing subscriptions to data coming from the vehicle.
Definition: system_state.hpp:206
void subscribe(std::function< void(DataType)> callback)
Activates the subscription process and registers a callback function if provided.
bool isLastValid() const
Checks if the last received data is valid.
DataType last() const
Retrieves the last received data.
void onUpdate(std::function< void(DataType)> callback)
Regsiters a callback function to be called when the data is updated.
Provides access to the system's state, including flight controller telemetry.
Definition: system_state.hpp:278
VtolState
Represents the VTOL state.
Definition: system_state.hpp:151
Represents angular rates and accelerations in the ENU coordinate system.
Definition: system_state.hpp:104
Eigen::Vector3f angular_velocity_enu_rad_s
Definition: system_state.hpp:105
Eigen::Vector3f angular_acceleration_enu_rad_s
Definition: system_state.hpp:106
Represents the status of the battery.
Definition: system_state.hpp:134
float discharged_mah
Definition: system_state.hpp:138
float remaining
Definition: system_state.hpp:139
float voltage_v
Definition: system_state.hpp:135
int cell_count
Definition: system_state.hpp:141
Eigen::VectorXf cell_voltage_v
Definition: system_state.hpp:142
float current_a
Definition: system_state.hpp:136
Represents global position using latitude, longitude, and altitude.
Definition: system_state.hpp:83
double longitude_deg
Definition: system_state.hpp:85
Eigen::Vector3d toEigenVector() const
Converts the global position to an Eigen vector.
Definition: system_state.hpp:93
double altitude_amsl_m
Definition: system_state.hpp:86
double latitude_deg
Definition: system_state.hpp:84
Represents the home position in both local ENU and global coordinates.
Definition: system_state.hpp:116
bool was_set_manually
Definition: system_state.hpp:125
double yaw
Definition: system_state.hpp:119
bool global_position_valid
Definition: system_state.hpp:122
bool local_position_valid
Definition: system_state.hpp:123
bool altitude_valid
Definition: system_state.hpp:121
Eigen::Vector3f local_position_enu_m
Definition: system_state.hpp:117
GlobalPosition global_position
Definition: system_state.hpp:118
Represents landed state of the vehicle.
Definition: system_state.hpp:182
bool in_descend
Definition: system_state.hpp:184
Represents local position, velocity, and acceleration in the ENU coordinate system.
Definition: system_state.hpp:62
bool horizontal_position_valid
Definition: system_state.hpp:70
bool horizontal_velocity_valid
Definition: system_state.hpp:72
bool vertical_velocity_valid
Definition: system_state.hpp:73
double heading
Definition: system_state.hpp:67
Eigen::Vector3f velocity_enu_m
Definition: system_state.hpp:64
Eigen::Vector3f acceleration_enu_m
Definition: system_state.hpp:65
Eigen::Vector3f position_enu_m
Definition: system_state.hpp:63
bool dist_bottom_valid
Definition: system_state.hpp:74
bool vertical_position_valid
Definition: system_state.hpp:71