35 #include <Eigen/Eigen>
44 enum class SubscriptionType {
171 TRANSITION_TO_FIXED_WING,
172 TRANSITION_TO_MULTICOPTER,
189 Eigen::Matrix<float, 6, 1>
aux;
237 template <SubscriptionType S,
typename DataType>
238 class SubscriptionImpl;
240 class SystemStateImpl;
252 template <SubscriptionType S,
typename DataType>
255 Subscription(
const std::shared_ptr<SubscriptionImpl<S, DataType>>& impl);
265 void onUpdate(std::function<
void(DataType)> callback);
292 std::shared_ptr<SubscriptionImpl<S, DataType>> _impl;
355 SystemState& subscribeAttitude(std::function<
void(Eigen::Quaternionf)> callback =
nullptr) {
370 SystemState& subscribeArmed(std::function<
void(
bool)> callback =
nullptr) {
375 SystemState& subscribeSystemId(std::function<
void(uint8_t)> callback =
nullptr) {
405 SystemState& subscribeWind(std::function<
void(
Wind)> callback =
nullptr) {
416 std::shared_ptr<SystemStateImpl> _impl;
SDK execution class. All callbacks are called on the same thread.
Definition: auterion.hpp:97
A template class for managing subscriptions to data coming from the vehicle.
Definition: system_state.hpp:253
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:325
VtolState
Represents the VTOL state.
Definition: system_state.hpp:169
Represents validated airspeed.
Definition: system_state.hpp:226
std::optional< float > true_airspeed_m_s
Definition: system_state.hpp:231
std::optional< float > calibrated_airspeed_m_s
Definition: system_state.hpp:229
std::optional< float > indicated_airspeed_m_s
Definition: system_state.hpp:228
Represents angular rates and accelerations in the FLU body frame.
Definition: system_state.hpp:122
Eigen::Vector3f angular_acceleration_flu_rad_s
Definition: system_state.hpp:124
Eigen::Vector3f angular_velocity_flu_rad_s
Definition: system_state.hpp:123
Represents the status of the battery.
Definition: system_state.hpp:152
float discharged_mah
Definition: system_state.hpp:156
float remaining
Definition: system_state.hpp:157
float voltage_v
Definition: system_state.hpp:153
int cell_count
Definition: system_state.hpp:159
Eigen::VectorXf cell_voltage_v
Definition: system_state.hpp:160
float current_a
Definition: system_state.hpp:154
Represents global position using latitude, longitude, and altitude.
Definition: system_state.hpp:88
double longitude_deg
Definition: system_state.hpp:90
Eigen::Vector3d toEigenVector() const
Converts the global position to an Eigen vector.
Definition: system_state.hpp:98
double altitude_amsl_m
Definition: system_state.hpp:91
double latitude_deg
Definition: system_state.hpp:89
Represents the home position in both local ENU and global coordinates.
Definition: system_state.hpp:134
bool was_set_manually
Definition: system_state.hpp:143
double yaw
Definition: system_state.hpp:137
bool global_position_valid
Definition: system_state.hpp:140
bool local_position_valid
Definition: system_state.hpp:141
bool altitude_valid
Definition: system_state.hpp:139
Eigen::Vector3f local_position_enu_m
Definition: system_state.hpp:135
GlobalPosition global_position
Definition: system_state.hpp:136
Represents landed state of the vehicle.
Definition: system_state.hpp:200
bool in_descend
Definition: system_state.hpp:202
Represents local position, velocity, and acceleration in the ENU coordinate system.
Definition: system_state.hpp:67
bool horizontal_position_valid
Definition: system_state.hpp:75
bool horizontal_velocity_valid
Definition: system_state.hpp:77
bool vertical_velocity_valid
Definition: system_state.hpp:78
double heading
Definition: system_state.hpp:72
Eigen::Vector3f velocity_enu_m
Definition: system_state.hpp:69
Eigen::Vector3f acceleration_enu_m
Definition: system_state.hpp:70
Eigen::Vector3f position_enu_m
Definition: system_state.hpp:68
bool dist_bottom_valid
Definition: system_state.hpp:79
bool vertical_position_valid
Definition: system_state.hpp:76
Represents odometry data including attitude and angular rates.
Definition: system_state.hpp:109
Eigen::Vector3f velocity
Definition: system_state.hpp:113
Eigen::Vector3f position
Definition: system_state.hpp:112
Eigen::Vector3f angular_velocity
Definition: system_state.hpp:111
Eigen::Quaternionf attitude
Definition: system_state.hpp:110
Represents wind speed and direction.
Definition: system_state.hpp:211
float windspeed_north
Definition: system_state.hpp:212
std::optional< float > variance_east
Definition: system_state.hpp:216
float windspeed_east
Definition: system_state.hpp:213
std::optional< float > variance_north
Definition: system_state.hpp:214