YARP
Yet Another Robot Platform
ImplementInteractionMode.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef YARP_DEV_IINTERACTIONMODEIMPL_H
7 #define YARP_DEV_IINTERACTIONMODEIMPL_H
8 
9 #include <yarp/dev/api.h>
11 #include <yarp/os/Log.h>
12 
13 namespace yarp {
14  namespace dev {
15  class ImplementInteractionMode;
16  class StubImplInteractionModeRaw;
17  }
18 }
19 
20 namespace yarp {
21 namespace dev {
22 namespace impl {
23 
24 template <typename T>
25 class FixedSizeBuffersManager;
26 
27 } // namespace impl
28 } // namespace dev
29 } // namespace yarp
30 
38 {
39 protected:
41  void *helper; // class controlBoardHelper, to handle axis map and conversion unit, where needed
42 
43  yarp::dev::impl::FixedSizeBuffersManager<yarp::dev::InteractionModeEnum> *imodeBuffManager; //This Buffer Manager handles temporary buffers of type yarp::dev::InteractionModeEnum
44  yarp::dev::impl::FixedSizeBuffersManager<int> *intBuffManager; //This Buffer Manager handles temporary buffers of type int
51  bool initialize (int size, const int *amap);
52 
62  bool initialize (int size, const int *amap, const double *enc, const double *zos);
63 
64 
69  bool uninitialize ();
70 
71 
72 public:
79 
83  virtual ~ImplementInteractionMode();
84 
85  // Methods are documented in the <yarp/dev/IInteractionMode.h> file
86  bool getInteractionMode(int axis, yarp::dev::InteractionModeEnum* mode) override;
87  bool getInteractionModes(int n_joints, int *joints, yarp::dev::InteractionModeEnum* modes) override;
89 
90  bool setInteractionMode(int axis, yarp::dev::InteractionModeEnum mode) override;
91  bool setInteractionModes(int n_joints, int *joints, yarp::dev::InteractionModeEnum* modes) override;
93 };
94 
95 
111 {
112 protected:
117  bool NOT_YET_IMPLEMENTED(const char *func = 0)
118  {
119  if (func) {
120  yError("%s: not yet implemented\n", func);
121  } else {
122  yError("Function not yet implemented\n");
123  }
124 
125  return false;
126  }
127 
128 
129 public:
134 
136  {
137  return NOT_YET_IMPLEMENTED("getInteractionModeRaw");
138  }
139 
140  bool getInteractionModesRaw(int n_joints, int *joints, yarp::dev::InteractionModeEnum* modes) override
141  {
142  return NOT_YET_IMPLEMENTED("getInteractionModesRaw");
143  }
144 
146  {
147  return NOT_YET_IMPLEMENTED("getInteractionModesRaw");
148  }
149 
151  {
152  return NOT_YET_IMPLEMENTED("setInteractionModeRaw");
153  }
154 
155  bool setInteractionModesRaw(int n_joints, int *joints, yarp::dev::InteractionModeEnum* modes) override
156  {
157  return NOT_YET_IMPLEMENTED("setInteractionModesRaw");
158  }
159 
161  {
162  return NOT_YET_IMPLEMENTED("setInteractionModesRaw");
163  }
164 };
165 
166 #endif // YARP_DEV_IINTERACTIONMODEIMPL_H
#define yError(...)
Definition: Log.h:279
Interface settings the way the robot interacts with the environment: basic interaction types are Stif...
Interface settings the way the robot interacts with the environment: basic interaction types are Stif...
Interface settings the way the robot interacts with the environment: basic interaction types are Stif...
bool setInteractionMode(int axis, yarp::dev::InteractionModeEnum mode) override
Set the interaction mode of the robot, values can be stiff or compliant.
bool getInteractionMode(int axis, yarp::dev::InteractionModeEnum *mode) override
Get the current interaction mode of the robot, values can be stiff or compliant.
yarp::dev::IInteractionModeRaw * iInteraction
bool setInteractionModes(int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override
Set the interaction mode of the robot for a set of joints, values can be stiff or compliant.
yarp::dev::impl::FixedSizeBuffersManager< int > * intBuffManager
bool getInteractionModes(int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override
Get the current interaction mode of the robot for a set of joints, values can be stiff or compliant.
bool uninitialize()
Clean up internal data and memory.
yarp::dev::impl::FixedSizeBuffersManager< yarp::dev::InteractionModeEnum > * imodeBuffManager
ImplementInteractionMode(yarp::dev::IInteractionModeRaw *Class_p)
Constructor.
bool initialize(int size, const int *amap)
Initialize the internal data and alloc memory, smaller version.
Stub implementation of IInteractionMode interface.
bool getInteractionModeRaw(int axis, yarp::dev::InteractionModeEnum *mode) override
Get the current interaction mode of the robot, values can be stiff or compliant.
bool setInteractionModesRaw(yarp::dev::InteractionModeEnum *modes) override
Set the interaction mode of the robot for a all the joints, values can be stiff or compliant.
bool NOT_YET_IMPLEMENTED(const char *func=0)
Helper for printing error message, see below.
bool setInteractionModesRaw(int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override
Set the interaction mode of the robot for a set of joints, values can be stiff or compliant.
bool getInteractionModesRaw(int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override
Get the current interaction mode of the robot for a set of joints, values can be stiff or compliant.
bool setInteractionModeRaw(int axis, yarp::dev::InteractionModeEnum mode) override
Set the interaction mode of the robot, values can be stiff or compliant.
bool getInteractionModesRaw(yarp::dev::InteractionModeEnum *modes) override
Get the current interaction mode of the robot for a all the joints, values can be stiff or compliant.
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18