35 #include <Eigen/Eigen>
43 enum class SubscriptionType {
167 TRANSITION_TO_FIXED_WING,
168 TRANSITION_TO_MULTICOPTER,
185 Eigen::Matrix<float, 6, 1>
aux;
204 template <SubscriptionType S,
typename DataType>
205 class SubscriptionImpl;
207 class SystemStateImpl;
219 template <SubscriptionType S,
typename DataType>
222 Subscription(
const std::shared_ptr<SubscriptionImpl<S, DataType>>& impl);
232 void onUpdate(std::function<
void(DataType)> callback);
259 std::shared_ptr<SubscriptionImpl<S, DataType>> _impl;
319 SystemState& subscribeAttitude(std::function<
void(Eigen::Quaternionf)> callback =
nullptr) {
334 SystemState& subscribeArmed(std::function<
void(
bool)> callback =
nullptr) {
365 std::shared_ptr<SystemStateImpl> _impl;
SDK execution class. All callbacks are called on the same thread.
Definition: auterion.hpp:47
A template class for managing subscriptions to data coming from the vehicle.
Definition: system_state.hpp:220
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:292
VtolState
Represents the VTOL state.
Definition: system_state.hpp:165
Represents angular rates and accelerations in the FLU body frame.
Definition: system_state.hpp:118
Eigen::Vector3f angular_acceleration_flu_rad_s
Definition: system_state.hpp:120
Eigen::Vector3f angular_velocity_flu_rad_s
Definition: system_state.hpp:119
Represents the status of the battery.
Definition: system_state.hpp:148
float discharged_mah
Definition: system_state.hpp:152
float remaining
Definition: system_state.hpp:153
float voltage_v
Definition: system_state.hpp:149
int cell_count
Definition: system_state.hpp:155
Eigen::VectorXf cell_voltage_v
Definition: system_state.hpp:156
float current_a
Definition: system_state.hpp:150
Represents global position using latitude, longitude, and altitude.
Definition: system_state.hpp:84
double longitude_deg
Definition: system_state.hpp:86
Eigen::Vector3d toEigenVector() const
Converts the global position to an Eigen vector.
Definition: system_state.hpp:94
double altitude_amsl_m
Definition: system_state.hpp:87
double latitude_deg
Definition: system_state.hpp:85
Represents the home position in both local ENU and global coordinates.
Definition: system_state.hpp:130
bool was_set_manually
Definition: system_state.hpp:139
double yaw
Definition: system_state.hpp:133
bool global_position_valid
Definition: system_state.hpp:136
bool local_position_valid
Definition: system_state.hpp:137
bool altitude_valid
Definition: system_state.hpp:135
Eigen::Vector3f local_position_enu_m
Definition: system_state.hpp:131
GlobalPosition global_position
Definition: system_state.hpp:132
Represents landed state of the vehicle.
Definition: system_state.hpp:196
bool in_descend
Definition: system_state.hpp:198
Represents local position, velocity, and acceleration in the ENU coordinate system.
Definition: system_state.hpp:63
bool horizontal_position_valid
Definition: system_state.hpp:71
bool horizontal_velocity_valid
Definition: system_state.hpp:73
bool vertical_velocity_valid
Definition: system_state.hpp:74
double heading
Definition: system_state.hpp:68
Eigen::Vector3f velocity_enu_m
Definition: system_state.hpp:65
Eigen::Vector3f acceleration_enu_m
Definition: system_state.hpp:66
Eigen::Vector3f position_enu_m
Definition: system_state.hpp:64
bool dist_bottom_valid
Definition: system_state.hpp:75
bool vertical_position_valid
Definition: system_state.hpp:72
Represents odometry data including attitude and angular rates.
Definition: system_state.hpp:105
Eigen::Vector3f velocity
Definition: system_state.hpp:109
Eigen::Vector3f position
Definition: system_state.hpp:108
Eigen::Vector3f angular_velocity
Definition: system_state.hpp:107
Eigen::Quaternionf attitude
Definition: system_state.hpp:106