YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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
13namespace yarp::dev {
14class ImplementInteractionMode;
15class StubImplInteractionModeRaw;
16}
17
18namespace yarp::dev::impl {
19
20template <typename T>
21class FixedSizeBuffersManager;
22
23} // namespace yarp::dev::impl
24
32{
33protected:
35 void *helper; // class controlBoardHelper, to handle axis map and conversion unit, where needed
36
37 yarp::dev::impl::FixedSizeBuffersManager<yarp::dev::InteractionModeEnum> *imodeBuffManager; //This Buffer Manager handles temporary buffers of type yarp::dev::InteractionModeEnum
38 yarp::dev::impl::FixedSizeBuffersManager<int> *intBuffManager; //This Buffer Manager handles temporary buffers of type int
45 bool initialize (int size, const int *amap);
46
56 bool initialize (int size, const int *amap, const double *enc, const double *zos);
57
58
63 bool uninitialize ();
64
65
66public:
73
78
79 // Methods are documented in the <yarp/dev/IInteractionMode.h> file
80 bool getInteractionMode(int axis, yarp::dev::InteractionModeEnum* mode) override;
81 bool getInteractionModes(int n_joints, int *joints, yarp::dev::InteractionModeEnum* modes) override;
83
84 bool setInteractionMode(int axis, yarp::dev::InteractionModeEnum mode) override;
85 bool setInteractionModes(int n_joints, int *joints, yarp::dev::InteractionModeEnum* modes) override;
87};
88
89
105{
106protected:
111 bool NOT_YET_IMPLEMENTED(const char *func = 0)
112 {
113 if (func) {
114 yError("%s: not yet implemented\n", func);
115 } else {
116 yError("Function not yet implemented\n");
117 }
118
119 return false;
120 }
121
122
123public:
128
130 {
131 return NOT_YET_IMPLEMENTED("getInteractionModeRaw");
132 }
133
134 bool getInteractionModesRaw(int n_joints, int *joints, yarp::dev::InteractionModeEnum* modes) override
135 {
136 return NOT_YET_IMPLEMENTED("getInteractionModesRaw");
137 }
138
140 {
141 return NOT_YET_IMPLEMENTED("getInteractionModesRaw");
142 }
143
145 {
146 return NOT_YET_IMPLEMENTED("setInteractionModeRaw");
147 }
148
149 bool setInteractionModesRaw(int n_joints, int *joints, yarp::dev::InteractionModeEnum* modes) override
150 {
151 return NOT_YET_IMPLEMENTED("setInteractionModesRaw");
152 }
153
155 {
156 return NOT_YET_IMPLEMENTED("setInteractionModesRaw");
157 }
158};
159
160#endif // YARP_DEV_IINTERACTIONMODEIMPL_H
#define yError(...)
Definition Log.h:361
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
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.
A manager of fixed size buffers in multi-thread environment.
For streams capable of holding different kinds of content, check what they actually have.
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_dev_API
Definition api.h:18