31 #define make_ControlTarget1DoFActuator(type, invalid, name, varname, cmode) \
32 class name : public ControlTargetBase \
35 type varname = ControllerConstants::ValueNotSetNaN; \
37 name(const name&) = default; \
38 name(name&&) = default; \
39 name(type val) : varname{val} \
42 name& operator=(const name&) = default; \
43 name& operator=(name&&) = default; \
50 virtual const std::string& \
51 getControlMode() const override \
61 isValid() const override \
63 return std::isfinite(varname); \
65 DETAIL_ControlTargetBase_DEFAULT_METHOD_IMPLEMENTATION static ControlTargetInfo<name> \
66 GetClassMemberInfo() \
68 ControlTargetInfo<name> cti; \
69 cti.addMemberVariable(&name::varname, #varname); \
75 ControllerConstants::ValueNotSetNaN,
76 ControlTarget1DoFActuatorPosition,
78 ControlModes::Position1DoF);
80 ControllerConstants::ValueNotSetNaN,
81 ControlTarget1DoFActuatorVelocity,
83 ControlModes::Velocity1DoF);
85 ControllerConstants::ValueNotSetNaN,
86 ControlTarget1DoFActuatorTorque,
88 ControlModes::Torque1DoF);
90 ControllerConstants::ValueNotSetNaN,
91 ControlTarget1DoFActuatorZeroTorque,
93 ControlModes::ZeroTorque1DoF);
95 ControllerConstants::ValueNotSetNaN,
96 ControlTarget1DoFActuatorZeroVelocity,
98 ControlModes::ZeroVelocity1DoF);
100 ControllerConstants::ValueNotSetNaN,
101 ControlTarget1DoFActuatorCurrent,
103 ControlModes::Current1DoF);
104 #undef make_ControlTarget1DoFActuator
114 return ControlModes::VelocityTorque;
120 ControlTarget1DoFActuatorVelocity::reset();
130 static ControlTargetInfo<ControlTarget1DoFActuatorTorqueVelocity>
133 ControlTargetInfo<ControlTarget1DoFActuatorTorqueVelocity> cti;
134 cti.addBaseClass<ControlTarget1DoFActuatorVelocity>();
152 return ControlModes::ActiveImpedance;
169 static ControlTargetInfo<ActiveImpedanceControlTarget>
191 return ControlModes::PWM1DoF;
206 static ControlTargetInfo<ControlTarget1DoFActuatorPWM>
230 return ControlModes::PositionWithPwmLimit1DoF;
237 ControlTarget1DoFActuatorPosition::reset();
246 static ControlTargetInfo<ControlTarget1DoFActuatorPositionWithPWMLimit>
249 ControlTargetInfo<ControlTarget1DoFActuatorPositionWithPWMLimit> cti;
250 cti.addBaseClass<ControlTarget1DoFActuatorPosition>();
258 setPWMLimits(std::int16_t hard, std::int16_t def, ControlDeviceAccessToken)
280 return ControlModes::VelocityWithPwmLimit1DoF;
287 ControlTarget1DoFActuatorVelocity::reset();
296 static ControlTargetInfo<ControlTarget1DoFActuatorVelocityWithPWMLimit>
299 ControlTargetInfo<ControlTarget1DoFActuatorVelocityWithPWMLimit> cti;
300 cti.addBaseClass<ControlTarget1DoFActuatorVelocity>();
308 setPWMLimits(std::int16_t hard, std::int16_t def, ControlDeviceAccessToken)