Go to the documentation of this file.
13 #include <SpaceVecAlg/SpaceVecAlg>
16 #include <type_traits>
28 template<
typename GetT>
31 using ReturnT =
typename std::decay<decltype(std::declval<GetT>()())>::type;
32 return !std::is_pointer<ReturnT>::value && !std::is_same<ReturnT, void>::value;
35 template<
typename GetT>
46 template<
typename GetT>
49 return is_getter_impl<GetT>(
nullptr);
58 template<
typename GetT,
bool is_getter>
61 using type =
typename std::decay<decltype(std::declval<GetT>()())>
::type;
64 template<
typename GetT>
71 template<
typename GetT>
78 template<
typename GetT>
85 template<
typename GetT,
typename... Args>
88 static constexpr
bool value =
false;
91 template<
typename GetT,
typename T>
94 static constexpr
bool value = std::is_convertible<ReturnTypeT<GetT>,
typename std::decay<T>::type>
::value;
97 template<
typename GetT,
typename T,
typename... Args>
103 template<
typename CallbackT,
typename FunT>
122 inline static const std::vector<std::string>
labels = {};
129 inline static const std::vector<std::string>
labels = {
"x",
"y"};
136 inline static const std::vector<std::string>
labels = {
"x",
"y",
"z"};
143 inline static const std::vector<std::string>
labels = {
"x",
"y",
"z",
"w"};
150 inline static const std::vector<std::string>
labels = {
"w",
"x",
"y",
"z"};
157 inline static const std::vector<std::string>
labels = {
"wx",
"wy",
"wz",
"vx",
"vy",
"vz"};
164 inline static const std::vector<std::string>
labels = {
"cx",
"cy",
"cz",
"fx",
"fy",
"fz"};
171 inline static const std::vector<std::string>
labels = {
"cx",
"cy",
"cz",
"fx",
"fy",
"fz"};
174 template<
bool Degrees>
177 inline static const std::vector<std::string>
labels = {
"r [deg]",
"p [deg]",
"y [deg]"};
183 inline static const std::vector<std::string>
labels = {
"r [rad]",
"p [rad]",
"y [rad]"};
190 return [value]() ->
const T & {
return value; };
194 template<
bool Degrees,
typename T>
197 return [value]() -> Eigen::Vector3d
208 return [&value]() ->
const T & {
return value; };
212 template<
bool Degrees,
typename T>
215 return [&value]() -> Eigen::Vector3d
226 return [&value](
const T & v) { value = v; };
233 if constexpr(std::is_invocable_v<T>) {
return value_or_cb(); }
234 else {
return value_or_cb; }
243 template<
typename... Args>
auto read_rpy(const T &&value)
Definition: traits.h:195
static constexpr bool value
Definition: traits.h:88
static constexpr bool has_labels
Definition: traits.h:121
Definition: ArrayInput.h:14
typename ReturnTypeImpl< GetT, is_getter< GetT >()>::type type
Definition: traits.h:74
constexpr bool is_variant_v
Definition: traits.h:249
auto GetValueOrCallbackValue(const T &value_or_cb)
Definition: traits.h:231
void void_t
Definition: traits.h:25
auto read(const T &&value)
Definition: traits.h:188
typename ReturnType< GetT >::type ReturnTypeT
Definition: traits.h:79
auto write(T &value)
Definition: traits.h:224
static const std::vector< std::string > labels
Definition: traits.h:122
Eigen::Vector3d rpyFromRotation(const T &value)
Definition: rpy_utils.h:110
constexpr bool is_getter()
Definition: traits.h:47
constexpr bool has_compatible_signature_v
Definition: traits.h:104
static const std::vector< std::string > labels
Definition: traits.h:177
constexpr double PI
Definition: constants.h:18
constexpr bool is_getter_impl(void_t< decltype(std::declval< GetT >()())> *)
Definition: traits.h:29
typename std::decay< decltype(std::declval< GetT >()())>::type type
Definition: traits.h:61