27 template<
typename GetForce,
typename GetSurface>
33 :
Element(
name), get_force_fn_(get_force_fn), get_surface_fn_(get_surface_fn), config_(config)
36 "Force element force callback must return an sva::ForceVecd");
38 "Force element surface callback must return an sva::PTransformd");
46 builder.
write(get_force_fn_());
47 builder.
write(get_surface_fn_());
49 config_.
write(builder);
53 GetForce get_force_fn_;
54 GetSurface get_surface_fn_;
58 template<
typename GetForce,
typename GetSurface,
typename SetForce>
66 GetForce get_force_fn,
67 SetForce set_force_fn,
68 GetSurface get_surface_fn)
69 :
ForceRO(
name, config, get_force_fn, get_surface_fn), set_force_fn_(set_force_fn)
82 SetForce set_force_fn_;
88 template<
typename GetForce,
typename GetSurface>
89 auto Force(
const std::string & name, GetForce get_force_fn, GetSurface get_surface_fn)
95 template<
typename GetForce,
typename GetSurface>
96 auto Force(
const std::string & name,
const ForceConfig & config, GetForce get_force_fn, GetSurface get_surface_fn)
102 template<
typename GetForce,
typename GetSurface,
typename SetForce>
103 auto Force(
const std::string & name, GetForce get_force_fn, SetForce set_force_fn, GetSurface get_surface_fn)
109 template<
typename GetForce,
typename GetSurface,
typename SetForce>
110 auto Force(
const std::string & name,
112 GetForce get_force_fn,
113 SetForce set_force_fn,
114 GetSurface get_surface_fn)
Definition: Observer.h:16
auto Force(const std::string &name, GetForce get_force_fn, GetSurface get_surface_fn)
Definition: Force.h:89
Simplify access to values hold within a JSON file.
Definition: Configuration.h:166
Definition: MessagePackBuilder.h:87
Definition: elements.h:59
const std::string & name() const
Definition: elements.h:61
void write(mc_rtc::MessagePackBuilder &)
Definition: elements.h:83
static constexpr size_t write_size()
Definition: elements.h:76
void write(mc_rtc::MessagePackBuilder &out) const
Definition: types.h:313
static constexpr size_t write_size()
Definition: types.h:311
ForceImpl(const std::string &name, const ForceConfig &config, GetForce get_force_fn, SetForce set_force_fn, GetSurface get_surface_fn)
Definition: Force.h:64
static constexpr auto type
Definition: Force.h:61
bool handleRequest(const mc_rtc::Configuration &data)
Definition: Force.h:75
void write(mc_rtc::MessagePackBuilder &builder)
Definition: Force.h:73
ForceROImpl(const std::string &name, const ForceConfig &config, GetForce get_force_fn, GetSurface get_surface_fn)
Definition: Force.h:32
void write(mc_rtc::MessagePackBuilder &builder, bool ro=true)
Definition: Force.h:43
static constexpr auto type
Definition: Force.h:30
static constexpr size_t write_size()
Definition: Force.h:41