5 #ifndef CNOID_BODY_SIMPLE_CONTROLLER_H
6 #define CNOID_BODY_SIMPLE_CONTROLLER_H
9 #include "exportdecl.h"
16 virtual void enableIO(
Link* link) = 0;
17 virtual void enableInput(
Link* link) = 0;
18 virtual void enableInput(
Link* link,
int stateFlags) = 0;
19 virtual void enableOutput(
Link* link) = 0;
20 virtual void enableOutput(
Link* link,
int stateFlags) = 0;
21 virtual void enableInput(
Device* device) = 0;
24 return body()->getOrCreateCache<T>(name);
28 return body()->findCache<T>(name);
31 [[deprecated(
"Use the controllerName function.")]]
32 std::string name()
const;
33 [[deprecated(
"Use enableInput for all links.")]]
34 virtual void setJointInput(
int stateFlags);
35 [[deprecated(
"Use enableOutput and Link::setActuationMode for all links.")]]
36 virtual void setJointOutput(
int stateFlags);
37 [[deprecated(
"Use enableInput for the link.")]]
38 virtual void setLinkInput(
Link* link,
int stateFlags);
39 [[deprecated(
"Use enableOutput and Link::setActuationMode for the link.")]]
40 virtual void setLinkOutput(
Link* link,
int stateFlags);
47 [[deprecated(
"Use ControllerIO::isNoDelayMode().")]]
48 virtual bool isImmediateMode()
const = 0;
49 [[deprecated(
"Use ControllerIO::setNoDelayMode().")]]
50 virtual void setImmediateMode(
bool on) = 0;
59 virtual std::string controllerName()
const;
71 virtual std::string optionString()
const;
72 std::vector<std::string> options()
const;
73 virtual std::ostream& os()
const;
78 Signal<void()> sigChanged_;
116 virtual bool start();
125 virtual bool control();
137 virtual void unconfigure();
154 JOINT_DISPLACEMENT = JointDisplacement,
155 JOINT_ANGLE = JointAngle,
156 JOINT_VELOCITY = JointVelocity,
158 JOINT_ACCELERATION = JointAcceleration,
159 JOINT_EFFORT = JointEffort,
160 JOINT_TORQUE = JointTorque,
161 JOINT_FORCE = JointForce,
162 LINK_POSITION = LinkPosition,
163 LINK_FORCE = LinkExtWrench
175 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
176 #define CNOID_SIMPLE_CONTROLLER_EXPORT __declspec(dllexport)
178 #define CNOID_SIMPLE_CONTROLLER_EXPORT __attribute__ ((visibility("default")))
180 #define CNOID_SIMPLE_CONTROLLER_EXPORT
185 #define CNOID_IMPLEMENT_SIMPLE_CONTROLLER_FACTORY(ControllerClassName) \
186 extern "C" CNOID_SIMPLE_CONTROLLER_EXPORT cnoid::SimpleController* createSimpleController() \
188 return new ControllerClassName(); \