16 #include <type_traits>
28 template<
typename GetT>
31 using ReturnT =
typename std::decay<decltype(std::declval<GetT>()())>::type;
35 template<
typename GetT>
44 template<
typename GetT>
46 {
return is_getter_impl<GetT>(
nullptr); }
54 template<
typename GetT,
bool is_getter>
57 using type =
typename std::decay<decltype(std::declval<GetT>()())>
::type;
60 template<
typename GetT>
67 template<
typename GetT>
74 template<
typename GetT>
81 template<
typename GetT,
typename... Args>
84 static constexpr
bool value =
false;
87 template<
typename GetT,
typename T>
90 static constexpr
bool value = std::is_convertible<ReturnTypeT<GetT>,
typename std::decay<T>::type>
::value;
93 template<
typename GetT,
typename T,
typename... Args>
99 template<
typename CallbackT,
typename FunT>
118 inline static const std::vector<std::string>
labels = {};
125 inline static const std::vector<std::string>
labels = {
"x",
"y"};
132 inline static const std::vector<std::string>
labels = {
"x",
"y",
"z"};
139 inline static const std::vector<std::string>
labels = {
"x",
"y",
"z",
"w"};
146 inline static const std::vector<std::string>
labels = {
"w",
"x",
"y",
"z"};
153 inline static const std::vector<std::string>
labels = {
"wx",
"wy",
"wz",
"vx",
"vy",
"vz"};
160 inline static const std::vector<std::string>
labels = {
"cx",
"cy",
"cz",
"fx",
"fy",
"fz"};
167 inline static const std::vector<std::string>
labels = {
"cx",
"cy",
"cz",
"fx",
"fy",
"fz"};
170 template<
bool Degrees>
173 inline static const std::vector<std::string>
labels = {
"r [deg]",
"p [deg]",
"y [deg]"};
179 inline static const std::vector<std::string>
labels = {
"r [rad]",
"p [rad]",
"y [rad]"};
186 return [
value]() ->
const T & {
return value; };
190 template<
bool Degrees,
typename T>
193 return [
value]() -> Eigen::Vector3d
207 return [&
value]() ->
const T & {
return value; };
211 template<
bool Degrees,
typename T>
214 return [&
value]() -> Eigen::Vector3d
235 if constexpr(std::is_invocable_v<T>) {
return value_or_cb(); }
248 template<
typename... Args>
std::optional< Eigen::VectorXd > value
Eigen::Vector3d rpyFromRotation(const T &value)
Definition: rpy_utils.h:102
constexpr double PI
Definition: constants.h:18
Definition: ArrayInput.h:15
auto GetValueOrCallbackValue(const T &value_or_cb)
Definition: traits.h:233
constexpr bool is_variant_v
Definition: traits.h:254
constexpr bool is_getter()
Definition: traits.h:45
void void_t
Definition: traits.h:25
auto read_rpy(const T &&value)
Definition: traits.h:191
typename ReturnType< GetT >::type ReturnTypeT
Definition: traits.h:75
constexpr bool has_compatible_signature_v
Definition: traits.h:100
constexpr bool is_getter_impl(void_t< decltype(std::declval< GetT >()())> *)
Definition: traits.h:29
auto read(const T &&value)
Definition: traits.h:184
auto write(T &value)
Definition: traits.h:226
ForceVec< double > ForceVecd
ImpedanceVec< double > ImpedanceVecd
MotionVec< double > MotionVecd
static constexpr bool value
Definition: traits.h:84
static constexpr bool has_labels
Definition: traits.h:117
static const std::vector< std::string > labels
Definition: traits.h:118
static const std::vector< std::string > labels
Definition: traits.h:173
typename std::decay< decltype(std::declval< GetT >()())>::type type
Definition: traits.h:57
typename ReturnTypeImpl< GetT, is_getter< GetT >()>::type type
Definition: traits.h:70