YARP
Yet Another Robot Platform
ImplementInteractionMode.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_DEV_IINTERACTIONMODEIMPL_H
10 #define YARP_DEV_IINTERACTIONMODEIMPL_H
11 
12 #include <yarp/dev/api.h>
14 #include <yarp/os/Log.h>
15 
16 namespace yarp {
17  namespace dev {
18  class ImplementInteractionMode;
19  class StubImplInteractionModeRaw;
20  }
21 }
22 
23 namespace yarp {
24 namespace dev {
25 namespace impl {
26 
27 template <typename T>
28 class FixedSizeBuffersManager;
29 
30 } // namespace impl
31 } // namespace dev
32 } // namespace yarp
33 
41 {
42 protected:
44  void *helper; // class controlBoardHelper, to handle axis map and conversion unit, where needed
45 
46  yarp::dev::impl::FixedSizeBuffersManager<yarp::dev::InteractionModeEnum> *imodeBuffManager; //This Buffer Manager handles temporary buffers of type yarp::dev::InteractionModeEnum
47  yarp::dev::impl::FixedSizeBuffersManager<int> *intBuffManager; //This Buffer Manager handles temporary buffers of type int
54  bool initialize (int size, const int *amap);
55 
65  bool initialize (int size, const int *amap, const double *enc, const double *zos);
66 
67 
72  bool uninitialize ();
73 
74 
75 public:
82 
86  virtual ~ImplementInteractionMode();
87 
88  // Methods are documented in the <yarp/dev/IInteractionMode.h> file
89  bool getInteractionMode(int axis, yarp::dev::InteractionModeEnum* mode) override;
90  bool getInteractionModes(int n_joints, int *joints, yarp::dev::InteractionModeEnum* modes) override;
92 
93  bool setInteractionMode(int axis, yarp::dev::InteractionModeEnum mode) override;
94  bool setInteractionModes(int n_joints, int *joints, yarp::dev::InteractionModeEnum* modes) override;
96 };
97 
98 
114 {
115 protected:
120  bool NOT_YET_IMPLEMENTED(const char *func = 0)
121  {
122  if (func)
123  yError("%s: not yet implemented\n", func);
124  else
125  yError("Function not yet implemented\n");
126 
127  return false;
128  }
129 
130 
131 public:
136 
138  {
139  return NOT_YET_IMPLEMENTED("getInteractionModeRaw");
140  }
141 
142  bool getInteractionModesRaw(int n_joints, int *joints, yarp::dev::InteractionModeEnum* modes) override
143  {
144  return NOT_YET_IMPLEMENTED("getInteractionModesRaw");
145  }
146 
148  {
149  return NOT_YET_IMPLEMENTED("getInteractionModesRaw");
150  }
151 
153  {
154  return NOT_YET_IMPLEMENTED("setInteractionModeRaw");
155  }
156 
157  bool setInteractionModesRaw(int n_joints, int *joints, yarp::dev::InteractionModeEnum* modes) override
158  {
159  return NOT_YET_IMPLEMENTED("setInteractionModesRaw");
160  }
161 
163  {
164  return NOT_YET_IMPLEMENTED("setInteractionModesRaw");
165  }
166 };
167 
168 #endif // YARP_DEV_IINTERACTIONMODEIMPL_H
yarp::dev::ImplementInteractionMode::helper
void * helper
Definition: ImplementInteractionMode.h:44
yarp::dev::ImplementInteractionMode::iInteraction
yarp::dev::IInteractionModeRaw * iInteraction
Definition: ImplementInteractionMode.h:43
yarp::dev::ImplementInteractionMode::imodeBuffManager
yarp::dev::impl::FixedSizeBuffersManager< yarp::dev::InteractionModeEnum > * imodeBuffManager
Definition: ImplementInteractionMode.h:46
yarp::dev::ImplementInteractionMode::setInteractionModes
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.
Definition: ImplementInteractionMode.cpp:133
yarp::dev::ImplementInteractionMode
Interface settings the way the robot interacts with the environment: basic interaction types are Stif...
Definition: ImplementInteractionMode.h:41
yarp::dev::ImplementInteractionMode::getInteractionMode
bool getInteractionMode(int axis, yarp::dev::InteractionModeEnum *mode) override
Get the current interaction mode of the robot, values can be stiff or compliant.
Definition: ImplementInteractionMode.cpp:87
yarp::dev::ImplementInteractionMode::getInteractionModes
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.
Definition: ImplementInteractionMode.cpp:93
yarp::dev::impl::FixedSizeBuffersManager< yarp::dev::InteractionModeEnum >
yarp::dev::StubImplInteractionModeRaw::getInteractionModeRaw
bool getInteractionModeRaw(int axis, yarp::dev::InteractionModeEnum *mode) override
Get the current interaction mode of the robot, values can be stiff or compliant.
Definition: ImplementInteractionMode.h:137
yarp::dev::ImplementInteractionMode::intBuffManager
yarp::dev::impl::FixedSizeBuffersManager< int > * intBuffManager
Definition: ImplementInteractionMode.h:47
yarp::dev::StubImplInteractionModeRaw::~StubImplInteractionModeRaw
virtual ~StubImplInteractionModeRaw()
Destructor.
Definition: ImplementInteractionMode.h:135
yError
#define yError(...)
Definition: Log.h:282
yarp::dev::ImplementInteractionMode::setInteractionMode
bool setInteractionMode(int axis, yarp::dev::InteractionModeEnum mode) override
Set the interaction mode of the robot, values can be stiff or compliant.
Definition: ImplementInteractionMode.cpp:127
yarp::dev::IInteractionMode
Interface settings the way the robot interacts with the environment: basic interaction types are Stif...
Definition: IInteractionMode.h:43
Log.h
yarp::dev::IInteractionModeRaw
Interface settings the way the robot interacts with the environment: basic interaction types are Stif...
Definition: IInteractionMode.h:122
yarp::dev::StubImplInteractionModeRaw
Stub implementation of IInteractionMode interface.
Definition: ImplementInteractionMode.h:114
yarp::dev::StubImplInteractionModeRaw::setInteractionModesRaw
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.
Definition: ImplementInteractionMode.h:162
yarp::dev::ImplementInteractionMode::uninitialize
bool uninitialize()
Clean up internal data and memory.
Definition: ImplementInteractionMode.cpp:65
yarp::dev::StubImplInteractionModeRaw::getInteractionModesRaw
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.
Definition: ImplementInteractionMode.h:147
yarp::dev::InteractionModeEnum
InteractionModeEnum
Definition: IInteractionMode.h:21
yarp::dev::StubImplInteractionModeRaw::NOT_YET_IMPLEMENTED
bool NOT_YET_IMPLEMENTED(const char *func=0)
Helper for printing error message, see below.
Definition: ImplementInteractionMode.h:120
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
yarp::dev::ImplementInteractionMode::ImplementInteractionMode
ImplementInteractionMode(yarp::dev::IInteractionModeRaw *Class_p)
Constructor.
Definition: ImplementInteractionMode.cpp:20
yarp::dev::StubImplInteractionModeRaw::setInteractionModesRaw
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.
Definition: ImplementInteractionMode.h:157
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::dev::StubImplInteractionModeRaw::setInteractionModeRaw
bool setInteractionModeRaw(int axis, yarp::dev::InteractionModeEnum mode) override
Set the interaction mode of the robot, values can be stiff or compliant.
Definition: ImplementInteractionMode.h:152
IInteractionMode.h
api.h
yarp::dev::StubImplInteractionModeRaw::getInteractionModesRaw
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.
Definition: ImplementInteractionMode.h:142
yarp::dev::ImplementInteractionMode::~ImplementInteractionMode
virtual ~ImplementInteractionMode()
Destructor.
Definition: ImplementInteractionMode.cpp:28
yarp::dev::ImplementInteractionMode::initialize
bool initialize(int size, const int *amap)
Initialize the internal data and alloc memory, smaller version.
Definition: ImplementInteractionMode.cpp:39