YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ImplementPositionControl.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_IPOSITIONCONTROLIMPL_H
7#define YARP_DEV_IPOSITIONCONTROLIMPL_H
8
10#include <vector>
11
12namespace yarp::dev {
13class ImplementPositionControl;
14class StubImplPositionControlRaw;
15}
16
17namespace yarp::dev::impl {
18
19template <typename T>
20class FixedSizeBuffersManager;
21
22} // namespace yarp::dev::impl
23
30{
31protected:
32 IPositionControlRaw* m_iraw=nullptr;
33 void* m_helper=nullptr;
34 std::vector<int> m_buffer_ints;
35 std::vector<double> m_buffer_doubles;
36 std::mutex m_imp_mutex;
37
47 bool initialize (int size, const int *amap, const double *enc, const double *zos);
48
53 bool uninitialize ();
54
55public:
62
67
68
74 yarp::dev::ReturnValue getAxes(size_t& axis) override;
75
76 yarp::dev::ReturnValue positionMove(int j, double ref) override;
77 yarp::dev::ReturnValue positionMove(const int n_joint, const int *joints, const double *refs) override;
78 yarp::dev::ReturnValue positionMove(const double *refs) override;
79 yarp::dev::ReturnValue relativeMove(int j, double delta) override;
80 yarp::dev::ReturnValue relativeMove(const int n_joint, const int *joints, const double *deltas) override;
81 yarp::dev::ReturnValue relativeMove(const double *deltas) override;
82 yarp::dev::ReturnValue checkMotionDone(bool& flag) override;
83 yarp::dev::ReturnValue checkMotionDone(const std::vector<int>& joints, bool &flags) override;
84 yarp::dev::ReturnValue checkMotionDone(int j, bool &flag) override;
85 yarp::dev::ReturnValue setTrajSpeed(int j, double sp) override;
86 yarp::dev::ReturnValue setTrajSpeeds(const int n_joint, const int *joints, const double *spds) override;
87 yarp::dev::ReturnValue setTrajSpeeds(const double *spds) override;
88 yarp::dev::ReturnValue setTrajAcceleration(int j, double acc) override;
89 yarp::dev::ReturnValue setTrajAccelerations(const int n_joint, const int *joints, const double *accs) override;
90 yarp::dev::ReturnValue setTrajAccelerations(const double *accs) override;
91 yarp::dev::ReturnValue getTrajSpeed(int j, double *ref) override;
92 yarp::dev::ReturnValue getTrajSpeeds(const int n_joint, const int *joints, double *spds) override;
93 yarp::dev::ReturnValue getTrajSpeeds(double *spds) override;
94 yarp::dev::ReturnValue getTrajAcceleration(int j, double *acc) override;
95 yarp::dev::ReturnValue getTrajAccelerations(const int n_joint, const int *joints, double *accs) override;
96 yarp::dev::ReturnValue getTrajAccelerations(double *accs) override;
97 yarp::dev::ReturnValue stop(int j) override;
98 yarp::dev::ReturnValue stop(const int n_joint, const int *joints) override;
100 yarp::dev::ReturnValue getTargetPosition(const int joint, double *ref) override;
101 yarp::dev::ReturnValue getTargetPositions(double *refs) override;
102 yarp::dev::ReturnValue getTargetPositions(const int n_joint, const int *joints, double *refs) override;
103};
104
120{
121private:
126 bool NOT_YET_IMPLEMENTED(const char *func=0);
127
128public:
130
133
134 yarp::dev::ReturnValue positionMoveRaw(int j, double ref) override
136
137 yarp::dev::ReturnValue positionMoveRaw(const int n_joint, const int *joints, const double *refs) override
139
140 yarp::dev::ReturnValue positionMoveRaw(const double *refs) override
142
143 yarp::dev::ReturnValue relativeMoveRaw(int j, double delta) override
145
146 yarp::dev::ReturnValue relativeMoveRaw(const int n_joint, const int *joints, const double *refs) override
148
149 yarp::dev::ReturnValue relativeMoveRaw(const double *deltas) override
151
154
155 yarp::dev::ReturnValue checkMotionDoneRaw(const std::vector<int>& joints, bool& flag) override
157
160
163
164 yarp::dev::ReturnValue setTrajSpeedsRaw(const int n_joint, const int *joints, const double *spds) override
166
167 yarp::dev::ReturnValue setTrajSpeedsRaw(const double *spds) override
169
172
173 yarp::dev::ReturnValue setTrajAccelerationsRaw(const int n_joint, const int *joints, const double *accs) override
175
178
179 yarp::dev::ReturnValue getTrajSpeedRaw(int j, double *ref) override
181
182 yarp::dev::ReturnValue getTrajSpeedsRaw(const int n_joint, const int *joints, double *spds) override
184
187
190
191 yarp::dev::ReturnValue getTrajAccelerationsRaw(const int n_joint, const int *joints, double *accs) override
193
196
199
200 yarp::dev::ReturnValue stopRaw(const int n_joint, const int *joints) override
202
205
206 yarp::dev::ReturnValue getTargetPositionRaw(const int joint, double *ref) override
208
211
212 yarp::dev::ReturnValue getTargetPositionsRaw(const int n_joint, const int *joints, double *refs) override
214};
215
216#endif // YARP_DEV_IPOSITIONCONTROLIMPL_H
bool NOT_YET_IMPLEMENTED(const char *txt)
#define YARP_METHOD_NOT_YET_IMPLEMENTED()
Interface for a generic control board device implementing position control in encoder coordinates.
Interface for a generic control board device implementing position control.
Default implementation of the IPositionControl interface.
yarp::dev::ReturnValue getTrajAcceleration(int j, double *acc) override
Get reference acceleration for a joint.
yarp::dev::ReturnValue stop() override
Stop motion, multiple joints.
yarp::dev::ReturnValue setTrajSpeeds(const int n_joint, const int *joints, const double *spds) override
Set reference speed on all joints.
yarp::dev::ReturnValue getTargetPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
yarp::dev::ReturnValue setTrajAcceleration(int j, double acc) override
Set reference acceleration for a joint.
yarp::dev::ReturnValue relativeMove(int j, double delta) override
Set relative position.
yarp::dev::ReturnValue getAxes(size_t &axis) override
Get the number of controlled axes.
yarp::dev::ReturnValue checkMotionDone(bool &flag) override
Check if the current trajectory is terminated.
yarp::dev::ReturnValue getTrajSpeed(int j, double *ref) override
Get reference speed for a joint.
yarp::dev::ReturnValue getTrajAccelerations(const int n_joint, const int *joints, double *accs) override
Get reference acceleration for a joint.
yarp::dev::ReturnValue positionMove(int j, double ref) override
Set new reference point for a single axis.
yarp::dev::ReturnValue setTrajSpeed(int j, double sp) override
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
yarp::dev::ReturnValue setTrajAccelerations(const int n_joint, const int *joints, const double *accs) override
Set reference acceleration on all joints.
yarp::dev::ReturnValue getTrajSpeeds(const int n_joint, const int *joints, double *spds) override
Get reference speed of all joints.
yarp::dev::ReturnValue getTargetPositions(double *refs) override
Get the last position reference for all axes.
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 IPositionControlRaw interface.
yarp::dev::ReturnValue setTrajAccelerationRaw(int j, double acc) override
Set reference acceleration for a joint.
yarp::dev::ReturnValue relativeMoveRaw(int j, double delta) override
Set relative position.
yarp::dev::ReturnValue setTrajSpeedRaw(int j, double sp) override
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
yarp::dev::ReturnValue getAxes(size_t &ax) override
Get the number of controlled axes.
yarp::dev::ReturnValue setTrajAccelerationsRaw(const int n_joint, const int *joints, const double *accs) override
Set reference acceleration on all joints.
yarp::dev::ReturnValue stopRaw(const int n_joint, const int *joints) override
Stop motion for subset of joints.
yarp::dev::ReturnValue stopRaw(int j) override
Stop motion, single joint.
yarp::dev::ReturnValue setTrajSpeedsRaw(const int n_joint, const int *joints, const double *spds) override
Set reference speed on all joints.
yarp::dev::ReturnValue getTrajSpeedsRaw(double *spds) override
Get reference speed of all joints.
yarp::dev::ReturnValue getTargetPositionRaw(const int joint, double *ref) override
Get the last position reference for the specified axis.
yarp::dev::ReturnValue setTrajAccelerationsRaw(const double *accs) override
Set reference acceleration on all joints.
yarp::dev::ReturnValue getTrajAccelerationsRaw(double *accs) override
Get reference acceleration of all joints.
yarp::dev::ReturnValue stopRaw() override
Stop motion, multiple joints.
yarp::dev::ReturnValue checkMotionDoneRaw(int j, bool &flag) override
Check if the current trajectory is terminated.
yarp::dev::ReturnValue checkMotionDoneRaw(bool &flag) override
Check if the current trajectory all joints is terminated.
yarp::dev::ReturnValue getTrajSpeedsRaw(const int n_joint, const int *joints, double *spds) override
Get reference speed of all joints.
yarp::dev::ReturnValue positionMoveRaw(int j, double ref) override
Set new reference point for a single axis.
yarp::dev::ReturnValue relativeMoveRaw(const int n_joint, const int *joints, const double *refs) override
Set relative position for a subset of joints.
yarp::dev::ReturnValue relativeMoveRaw(const double *deltas) override
Set relative position, all joints.
yarp::dev::ReturnValue getTrajAccelerationRaw(int j, double *acc) override
Get reference acceleration for a joint.
yarp::dev::ReturnValue positionMoveRaw(const double *refs) override
Set new reference point for all axes.
yarp::dev::ReturnValue checkMotionDoneRaw(const std::vector< int > &joints, bool &flag) override
Check if the current trajectory is terminated.
yarp::dev::ReturnValue getTargetPositionsRaw(double *refs) override
Get the last position reference for all axes.
yarp::dev::ReturnValue getTrajSpeedRaw(int j, double *ref) override
Get reference speed for a joint.
yarp::dev::ReturnValue positionMoveRaw(const int n_joint, const int *joints, const double *refs) override
Set new reference point for a subset of joints.
yarp::dev::ReturnValue setTrajSpeedsRaw(const double *spds) override
Set reference speed on all joints.
yarp::dev::ReturnValue getTargetPositionsRaw(const int n_joint, const int *joints, double *refs) override
Get the last position reference for the specified group of axes.
yarp::dev::ReturnValue getTrajAccelerationsRaw(const int n_joint, const int *joints, double *accs) override
Get reference acceleration for a joint.
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