YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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
13namespace yarp::dev {
14class ImplementVelocityControl;
15class StubImplVelocityControlRaw;
16}
17
18namespace yarp::dev::impl {
19
20template <typename T>
21class FixedSizeBuffersManager;
22
23} // namespace yarp::dev::impl
24
26{
27protected:
29 void *helper;
32
42 bool initialize (int size, const int *amap, const double *enc, const double *zos);
43
48 bool uninitialize();
49
50public:
57
62
63 bool getAxes(int *axes) override;
64 bool velocityMove(int j, double sp) override;
65 bool velocityMove(const double *sp) override;
66 bool setRefAcceleration(int j, double acc) override;
67 bool setRefAccelerations(const double *accs) override;
68 bool getRefAcceleration(int j, double *acc) override;
69 bool getRefAccelerations(double *accs) override;
70 bool stop(int j) override;
71 bool stop() override;
72
73
74 // specific of IVelocityControl
75 bool velocityMove(const int n_joint, const int *joints, const double *spds) override;
76 bool getRefVelocity(const int joint, double *vel) override;
77 bool getRefVelocities(double *vels) override;
78 bool getRefVelocities(const int n_joint, const int *joints, double *vels) override;
79 bool setRefAccelerations(const int n_joint, const int *joints, const double *accs) override;
80 bool getRefAccelerations(const int n_joint, const int *joints, double *accs) override;
81 bool stop(const int n_joint, const int *joints) override;
82};
83
84
100{
101private:
106 bool NOT_YET_IMPLEMENTED(const char *func = 0)
107 {
108 if (func) {
109 yError("%s: not yet implemented\n", func);
110 } else {
111 yError("Function not yet implemented\n");
112 }
113
114 return false;
115 }
116
117public:
118 bool getAxes(int *axes) override
119 {return NOT_YET_IMPLEMENTED("getAxesRaw");}
120
121 bool velocityMoveRaw(int j, double sp) override
122 {return NOT_YET_IMPLEMENTED("velocityMoveRaw");}
123
124 bool velocityMoveRaw(const double *sp) override
125 {return NOT_YET_IMPLEMENTED("velocityMoveRaw");}
126
127 bool setRefAccelerationRaw(int j, double acc) override
128 {return NOT_YET_IMPLEMENTED("setRefAccelerationRaw");}
129
130 bool setRefAccelerationsRaw(const double *accs) override
131 {return NOT_YET_IMPLEMENTED("setRefAccelerationsRaw");}
132
133 bool getRefAccelerationRaw(int j, double *acc) override
134 {return NOT_YET_IMPLEMENTED("getRefAccelerationRaw");}
135
136 bool getRefAccelerationsRaw(double *accs) override
137 {return NOT_YET_IMPLEMENTED("getRefAccelerationsRaw");}
138
139 bool stopRaw(int j) override
140 {return NOT_YET_IMPLEMENTED("stopRaw");}
141
142 bool stopRaw() override
143 {return NOT_YET_IMPLEMENTED("stopRaw");}
144
145
146 // specific of IVelocityControl
147 bool velocityMoveRaw(const int n_joint, const int *joints, const double *spds) override
148 {return NOT_YET_IMPLEMENTED("velocityMoveRaw");}
149
150 bool getRefVelocityRaw(const int joint, double *vel) override
151 {return NOT_YET_IMPLEMENTED("getRefVelocityRaw");}
152
153 bool getRefVelocitiesRaw(double *vels) override
154 {return NOT_YET_IMPLEMENTED("getRefVelocitiesRaw");}
155
156 bool getRefVelocitiesRaw(const int n_joint, const int *joints, double *vels) override
157 {return NOT_YET_IMPLEMENTED("getRefVelocitiesRaw");}
158
159 bool setRefAccelerationsRaw(const int n_joint, const int *joints, const double *accs) override
160 {return NOT_YET_IMPLEMENTED("setRefAccelerationsRaw");}
161
162 bool getRefAccelerationsRaw(const int n_joint, const int *joints, double *accs) override
163 {return NOT_YET_IMPLEMENTED("getRefAccelerationsRaw");}
164
165 bool stopRaw(const int n_joint, const int *joints) override
166 {return NOT_YET_IMPLEMENTED("stopRaw");}
167
168};
169#endif // YARP_DEV_IVELOCITYCONTROLIMPL_H
#define yError(...)
Definition Log.h:361
Interface for control boards implementig velocity control in encoder coordinates.
Interface for control boards implementing velocity control.
yarp::dev::impl::FixedSizeBuffersManager< int > * intBuffManager
yarp::dev::impl::FixedSizeBuffersManager< double > * doubleBuffManager
bool getRefAccelerations(double *accs) override
Get reference acceleration of all joints.
bool getRefAcceleration(int j, double *acc) override
Get reference acceleration for a joint.
bool uninitialize()
Clean up internal data and memory.
bool setRefAcceleration(int j, double acc) override
Set reference acceleration for a joint.
bool stop() override
Stop motion, multiple joints.
bool initialize(int size, const int *amap, const double *enc, const double *zos)
Initialize the internal data and alloc memory.
bool setRefAccelerations(const double *accs) override
Set reference acceleration on all joints.
bool getRefVelocity(const int joint, double *vel) override
Get the last reference speed set by velocityMove for single joint.
bool getRefVelocities(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 velocityMove(int j, double sp) override
Start motion at a given speed, single joint.
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.
A manager of fixed size buffers in multi-thread environment.
For streams capable of holding different kinds of content, check what they actually have.
Definition jointData.cpp:13
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_dev_API
Definition api.h:18