12#include "sygac-components.hpp"
23#define try_spelling(SPELLING)\
24if constexpr (requires {mimu_data.SPELLING;}) return mimu_data.SPELLING; \
25else if constexpr (requires {mimu_data.SPELLING();}) return mimu_data.SPELLING(); \
26else if constexpr (requires {mimu_data->SPELLING;}) return mimu_data->SPELLING; \
27else if constexpr (requires {mimu_data->SPELLING();}) return mimu_data->SPELLING()
32 try_spelling(accelerometer);
33 else try_spelling(acceleration);
34 else try_spelling(accel);
35 else try_spelling(accl);
36 else try_spelling(acc);
44 try_spelling(gyroscope);
45 else try_spelling(angular_rate);
46 else try_spelling(gyro);
54 try_spelling(magnetometer);
55 else try_spelling(magnetic_field);
56 else try_spelling(magn);
57 else try_spelling(mag);
66 else if constexpr (
requires {mimu_data[0];})
return mimu_data[0];
74 else if constexpr (
requires {mimu_data[1];})
return mimu_data[1];
82 else if constexpr (
requires {mimu_data[2];})
return mimu_data[2];
89 = std::remove_cvref_t<
decltype(
accl_of(std::declval<std::remove_cvref_t<T>&>()))>;
92 = std::remove_cvref_t<
decltype(
gyro_of(std::declval<std::remove_cvref_t<T>&>()))>;
95 = std::remove_cvref_t<
decltype(
magn_of(std::declval<std::remove_cvref_t<T>&>()))>;
98 = std::remove_cvref_t<
decltype(
vecx_of(std::declval<std::remove_cvref_t<T>&>()))>;
101 = std::remove_cvref_t<
decltype(
vecy_of(std::declval<std::remove_cvref_t<T>&>()))>;
104 = std::remove_cvref_t<
decltype(
vecz_of(std::declval<std::remove_cvref_t<T>&>()))>;
106template<
typename T>
concept not_void = not std::same_as<void, T>;
113 && std::same_as<vecx_t<T>, vecy_t<T>>
114 && std::same_as<vecy_t<T>, vecz_t<T>>
Definition sygac-endpoints.hpp:97
Check that the type T has an outputs struct that is a MIMU data structure whose vectors satisfy the c...
Definition sygac-mimu.hpp:132
Check that the type T has accelerometer, gyroscope, and magnetometer data at one of the expected inte...
Definition sygac-mimu.hpp:127
Check that the type T has accelerometer vector data at one of the expected interfaces.
Definition sygac-mimu.hpp:117
Check that the type T has gyroscope vector data at one of the expected interfaces.
Definition sygac-mimu.hpp:120
Check that the type T has magnetometer vector data at one of the expected interfaces.
Definition sygac-mimu.hpp:123
Check that type T is not void. Used in the definition of MimuDataStruct.
Definition sygac-mimu.hpp:106
Check that type T seems to be a MIMU data vector. Used in the definition of MimuDataStruct.
Definition sygac-mimu.hpp:110
std::remove_cvref_t< decltype(accl_of(std::declval< std::remove_cvref_t< T > & >()))> accl_t
Access the type of the accelerometer data of a presumed MIMU data structure.
Definition sygac-mimu.hpp:89
std::remove_cvref_t< decltype(vecy_of(std::declval< std::remove_cvref_t< T > & >()))> vecy_t
Access the type of the y component of a presumed MIMU data vector.
Definition sygac-mimu.hpp:101
auto & vecz_of(auto &mimu_data)
Access the third vector component of a presumed MIMU data vector.
Definition sygac-mimu.hpp:79
auto gyro_y(auto &mimu)
Access the second vector component of the gyroscope data of a MIMU data structure or MIMU component.
Definition sygac-mimu.hpp:155
auto accl_z(auto &mimu)
Access the third vector component of the accelerometer data of a MIMU data structure or MIMU componen...
Definition sygac-mimu.hpp:150
std::remove_cvref_t< decltype(vecx_of(std::declval< std::remove_cvref_t< T > & >()))> vecx_t
Access the type of the x component of a presumed MIMU data vector.
Definition sygac-mimu.hpp:98
auto & vecy_of(auto &mimu_data)
Access the second vector component of a presumed MIMU data vector.
Definition sygac-mimu.hpp:71
auto accl_y(auto &mimu)
Access the second vector component of the accelerometer data of a MIMU data structure or MIMU compone...
Definition sygac-mimu.hpp:148
auto & magn_of(auto &mimu_data)
Access the magnetometer data of a presumed MIMU data structure.
Definition sygac-mimu.hpp:52
std::remove_cvref_t< decltype(vecz_of(std::declval< std::remove_cvref_t< T > & >()))> vecz_t
Access the type of the z component of a presumed MIMU data vector.
Definition sygac-mimu.hpp:104
auto & accl_of(auto &mimu_data)
Access the accelerometer data of a presumed MIMU data structure.
Definition sygac-mimu.hpp:30
auto magn_z(auto &mimu)
Access the third vector component of the magnetometer data of a MIMU data structure or MIMU component...
Definition sygac-mimu.hpp:164
auto gyro_z(auto &mimu)
Access the third vector component of the gyroscope data of a MIMU data structure or MIMU component.
Definition sygac-mimu.hpp:157
auto magn_y(auto &mimu)
Access the second vector component of the magnetometer data of a MIMU data structure or MIMU componen...
Definition sygac-mimu.hpp:162
auto gyro_x(auto &mimu)
Access the first vector component of the gyroscope data of a MIMU data structure or MIMU component.
Definition sygac-mimu.hpp:153
auto & gyro_of(auto &mimu_data)
Access the gyroscope data of a presumed MIMU data structure.
Definition sygac-mimu.hpp:42
auto accl_x(auto &mimu)
Access the first vector component of the accelerometer data of a MIMU data structure or MIMU componen...
Definition sygac-mimu.hpp:146
std::remove_cvref_t< decltype(gyro_of(std::declval< std::remove_cvref_t< T > & >()))> gyro_t
Access the type of the gyroscope data of a presumed MIMU data structure.
Definition sygac-mimu.hpp:92
auto & vecx_of(auto &mimu_data)
Access the first vector component of a presumed MIMU data vector.
Definition sygac-mimu.hpp:63
std::remove_cvref_t< decltype(magn_of(std::declval< std::remove_cvref_t< T > & >()))> magn_t
Access the type of the magnetometer data of a presumed MIMU data structure.
Definition sygac-mimu.hpp:95
auto magn_x(auto &mimu)
Access the first vector component of the magnetometer data of a MIMU data structure or MIMU component...
Definition sygac-mimu.hpp:160