YARP
Yet Another Robot Platform
ImplementVelocityControl.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_IVELOCITYCONTROLIMPL_H
7 #define YARP_DEV_IVELOCITYCONTROLIMPL_H
8 
9 
11 #include <yarp/os/Log.h>
12 
13 namespace yarp {
14  namespace dev {
15  class ImplementVelocityControl;
16  class StubImplVelocityControlRaw;
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 
32 {
33 protected:
35  void *helper;
38 
48  bool initialize (int size, const int *amap, const double *enc, const double *zos);
49 
54  bool uninitialize();
55 
56 public:
63 
67  virtual ~ImplementVelocityControl();
68 
69  bool getAxes(int *axes) override;
70  bool velocityMove(int j, double sp) override;
71  bool velocityMove(const double *sp) override;
72  bool setRefAcceleration(int j, double acc) override;
73  bool setRefAccelerations(const double *accs) override;
74  bool getRefAcceleration(int j, double *acc) override;
75  bool getRefAccelerations(double *accs) override;
76  bool stop(int j) override;
77  bool stop() override;
78 
79 
80  // specific of IVelocityControl
81  bool velocityMove(const int n_joint, const int *joints, const double *spds) override;
82  bool getRefVelocity(const int joint, double *vel) override;
83  bool getRefVelocities(double *vels) override;
84  bool getRefVelocities(const int n_joint, const int *joints, double *vels) override;
85  bool setRefAccelerations(const int n_joint, const int *joints, const double *accs) override;
86  bool getRefAccelerations(const int n_joint, const int *joints, double *accs) override;
87  bool stop(const int n_joint, const int *joints) override;
88 };
89 
90 
106 {
107 private:
112  bool NOT_YET_IMPLEMENTED(const char *func = 0)
113  {
114  if (func) {
115  yError("%s: not yet implemented\n", func);
116  } else {
117  yError("Function not yet implemented\n");
118  }
119 
120  return false;
121  }
122 
123 public:
124  bool getAxes(int *axes) override
125  {return NOT_YET_IMPLEMENTED("getAxesRaw");}
126 
127  bool velocityMoveRaw(int j, double sp) override
128  {return NOT_YET_IMPLEMENTED("velocityMoveRaw");}
129 
130  bool velocityMoveRaw(const double *sp) override
131  {return NOT_YET_IMPLEMENTED("velocityMoveRaw");}
132 
133  bool setRefAccelerationRaw(int j, double acc) override
134  {return NOT_YET_IMPLEMENTED("setRefAccelerationRaw");}
135 
136  bool setRefAccelerationsRaw(const double *accs) override
137  {return NOT_YET_IMPLEMENTED("setRefAccelerationsRaw");}
138 
139  bool getRefAccelerationRaw(int j, double *acc) override
140  {return NOT_YET_IMPLEMENTED("getRefAccelerationRaw");}
141 
142  bool getRefAccelerationsRaw(double *accs) override
143  {return NOT_YET_IMPLEMENTED("getRefAccelerationsRaw");}
144 
145  bool stopRaw(int j) override
146  {return NOT_YET_IMPLEMENTED("stopRaw");}
147 
148  bool stopRaw() override
149  {return NOT_YET_IMPLEMENTED("stopRaw");}
150 
151 
152  // specific of IVelocityControl
153  bool velocityMoveRaw(const int n_joint, const int *joints, const double *spds) override
154  {return NOT_YET_IMPLEMENTED("velocityMoveRaw");}
155 
156  bool getRefVelocityRaw(const int joint, double *vel) override
157  {return NOT_YET_IMPLEMENTED("getRefVelocityRaw");}
158 
159  bool getRefVelocitiesRaw(double *vels) override
160  {return NOT_YET_IMPLEMENTED("getRefVelocitiesRaw");}
161 
162  bool getRefVelocitiesRaw(const int n_joint, const int *joints, double *vels) override
163  {return NOT_YET_IMPLEMENTED("getRefVelocitiesRaw");}
164 
165  bool setRefAccelerationsRaw(const int n_joint, const int *joints, const double *accs) override
166  {return NOT_YET_IMPLEMENTED("setRefAccelerationsRaw");}
167 
168  bool getRefAccelerationsRaw(const int n_joint, const int *joints, double *accs) override
169  {return NOT_YET_IMPLEMENTED("getRefAccelerationsRaw");}
170 
171  bool stopRaw(const int n_joint, const int *joints) override
172  {return NOT_YET_IMPLEMENTED("stopRaw");}
173 
174 };
175 #endif // YARP_DEV_IVELOCITYCONTROLIMPL_H
#define yError(...)
Definition: Log.h:279
Interface for control boards implementig velocity control in encoder coordinates.
Interface for control boards implementing velocity control.
virtual bool setRefAcceleration(int j, double acc)=0
Set reference acceleration for a joint.
virtual bool getRefVelocity(const int joint, double *vel)
Get the last reference speed set by velocityMove for single joint.
virtual bool stop()=0
Stop motion, multiple joints.
virtual bool setRefAccelerations(const double *accs)=0
Set reference acceleration on all joints.
virtual bool getAxes(int *axes)=0
Get the number of controlled axes.
virtual bool getRefAcceleration(int j, double *acc)=0
Get reference acceleration for a joint.
virtual bool getRefAccelerations(double *accs)=0
Get reference acceleration of all joints.
virtual bool velocityMove(int j, double sp)=0
Start motion at a given speed, single joint.
virtual bool getRefVelocities(double *vels)
Get the last reference speed set by velocityMove for all joints.
yarp::dev::impl::FixedSizeBuffersManager< int > * intBuffManager
yarp::dev::impl::FixedSizeBuffersManager< double > * doubleBuffManager
ImplementVelocityControl(yarp::dev::IVelocityControlRaw *y)
Constructor.
bool uninitialize()
Clean up internal data and memory.
bool initialize(int size, const int *amap, const double *enc, const double *zos)
Initialize the internal data and alloc memory.
Stub implementation of IPositionControl2Raw interface.
bool getRefAccelerationsRaw(double *accs) override
Get reference acceleration of all joints.
bool stopRaw(int j) override
Stop motion, single joint.
bool getRefVelocitiesRaw(const int n_joint, const int *joints, double *vels) override
Get the last reference speed set by velocityMove for a group of joints.
bool stopRaw(const int n_joint, const int *joints) override
Stop motion for a subset of joints.
bool getRefVelocitiesRaw(double *vels) override
Get the last reference speed set by velocityMove for all joints.
bool getAxes(int *axes) override
Get the number of controlled axes.
bool velocityMoveRaw(const double *sp) override
Start motion at a given speed, multiple joints.
bool velocityMoveRaw(int j, double sp) override
Start motion at a given speed, single joint.
bool getRefAccelerationRaw(int j, double *acc) override
Get reference acceleration for a joint.
bool getRefAccelerationsRaw(const int n_joint, const int *joints, double *accs) override
Get reference acceleration for a subset of joints.
bool setRefAccelerationsRaw(const int n_joint, const int *joints, const double *accs) override
Set reference acceleration for a subset of joints.
bool velocityMoveRaw(const int n_joint, const int *joints, const double *spds) override
Start motion at a given speed for a subset of joints.
bool setRefAccelerationRaw(int j, double acc) override
Set reference acceleration for a joint.
bool getRefVelocityRaw(const int joint, double *vel) override
Get the last reference speed set by velocityMove for single joint.
bool stopRaw() override
Stop motion, multiple joints.
bool setRefAccelerationsRaw(const double *accs) override
Set reference acceleration on all joints.
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18