YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
IPositionControl.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef YARP_DEV_IPOSITIONCONTROL_H
8#define YARP_DEV_IPOSITIONCONTROL_H
9
10#include <yarp/dev/api.h>
11#include <yarp/os/Vocab.h>
13
14#include <vector>
15
16namespace yarp::dev {
17class IPositionControlRaw;
18class IPositionControl;
19}
20
28{
29public:
34
41 virtual yarp::dev::ReturnValue getAxes(size_t& ax) = 0;
42
48 virtual yarp::dev::ReturnValue positionMoveRaw(int j, double ref)=0;
49
54 virtual yarp::dev::ReturnValue positionMoveRaw(const double *refs)=0;
55
62 virtual yarp::dev::ReturnValue relativeMoveRaw(int j, double delta)=0;
63
68 virtual yarp::dev::ReturnValue relativeMoveRaw(const double *deltas)=0;
69
76 virtual yarp::dev::ReturnValue checkMotionDoneRaw(int j, bool& flag)=0;
77
84
91 virtual yarp::dev::ReturnValue setTrajSpeedRaw(int j, double sp)=0;
92
98 virtual yarp::dev::ReturnValue setTrajSpeedsRaw(const double *spds)=0;
99
106 virtual yarp::dev::ReturnValue setTrajAccelerationRaw(int j, double acc)=0;
107
113 virtual yarp::dev::ReturnValue setTrajAccelerationsRaw(const double *accs)=0;
114
121 virtual yarp::dev::ReturnValue getTrajSpeedRaw(int j, double *ref)=0;
122
128
135 virtual yarp::dev::ReturnValue getTrajAccelerationRaw(int j, double *acc)=0;
136
143
149
154
160 virtual yarp::dev::ReturnValue positionMoveRaw(const int n_joint, const int *joints, const double *refs)=0;
161
167 virtual yarp::dev::ReturnValue relativeMoveRaw(const int n_joint, const int *joints, const double *deltas)=0;
168
175 virtual yarp::dev::ReturnValue checkMotionDoneRaw(const std::vector<int>& joints, bool& flag)=0;
176
183 virtual yarp::dev::ReturnValue setTrajSpeedsRaw(const int n_joint, const int *joints, const double *spds)=0;
184
191 virtual yarp::dev::ReturnValue setTrajAccelerationsRaw(const int n_joint, const int *joints, const double *accs)=0;
192
199 virtual yarp::dev::ReturnValue getTrajSpeedsRaw(const int n_joint, const int *joints, double *spds)=0;
200
207 virtual yarp::dev::ReturnValue getTrajAccelerationsRaw(const int n_joint, const int *joints, double *accs)=0;
208
213 virtual yarp::dev::ReturnValue stopRaw(const int n_joint, const int *joints)=0;
214
224 virtual yarp::dev::ReturnValue getTargetPositionRaw(const int joint, double *ref) =0;
225
236
246 virtual yarp::dev::ReturnValue getTargetPositionsRaw(const int n_joint, const int *joints, double *refs) =0;
247};
248
255{
256public:
260 virtual ~IPositionControl() {}
261
268 virtual yarp::dev::ReturnValue getAxes(size_t& ax) = 0;
269
275 virtual yarp::dev::ReturnValue positionMove(int j, double ref)=0;
276
281 virtual yarp::dev::ReturnValue positionMove(const double *refs)=0;
282
289 virtual yarp::dev::ReturnValue relativeMove(int j, double delta)=0;
290
295 virtual yarp::dev::ReturnValue relativeMove(const double *deltas)=0;
296
303 virtual yarp::dev::ReturnValue checkMotionDone(int j, bool& flag)=0;
304
311
318 virtual yarp::dev::ReturnValue setTrajSpeed(int j, double sp)=0;
319
325 virtual yarp::dev::ReturnValue setTrajSpeeds(const double *spds)=0;
326
333 virtual yarp::dev::ReturnValue setTrajAcceleration(int j, double acc)=0;
334
340 virtual yarp::dev::ReturnValue setTrajAccelerations(const double *accs)=0;
341
348 virtual yarp::dev::ReturnValue getTrajSpeed(int j, double *ref)=0;
349
354 virtual yarp::dev::ReturnValue getTrajSpeeds(double *spds)=0;
355
362 virtual yarp::dev::ReturnValue getTrajAcceleration(int j, double *acc)=0;
363
370
375 virtual yarp::dev::ReturnValue stop(int j)=0;
376
381
387 virtual yarp::dev::ReturnValue positionMove(const int n_joint, const int *joints, const double *refs)=0;
388
394 virtual yarp::dev::ReturnValue relativeMove(const int n_joint, const int *joints, const double *deltas)=0;
395
401 virtual yarp::dev::ReturnValue checkMotionDone(const std::vector<int>& joints, bool& flag)=0;
402
409 virtual yarp::dev::ReturnValue setTrajSpeeds(const int n_joint, const int *joints, const double *spds)=0;
410
417 virtual yarp::dev::ReturnValue setTrajAccelerations(const int n_joint, const int *joints, const double *accs)=0;
418
425 virtual yarp::dev::ReturnValue getTrajSpeeds(const int n_joint, const int *joints, double *spds)=0;
426
433 virtual yarp::dev::ReturnValue getTrajAccelerations(const int n_joint, const int *joints, double *accs)=0;
434
439 virtual yarp::dev::ReturnValue stop(const int n_joint, const int *joints)=0;
440
450 virtual yarp::dev::ReturnValue getTargetPosition(const int joint, double *ref) =0;
451
462
472 virtual yarp::dev::ReturnValue getTargetPositions(const int n_joint, const int *joints, double *refs) =0;
473};
474
475// Interface name
477
484
485#endif // YARP_DEV_IPOSITIONCONTROL_H
constexpr yarp::conf::vocab32_t VOCAB_REF_ACCELERATION_GROUP
constexpr yarp::conf::vocab32_t VOCAB_STOP_GROUP
constexpr yarp::conf::vocab32_t VOCAB_POSITIONCONTROL_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_RELATIVE_MOVE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_POSITION_MOVE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_MOTION_DONE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_REF_SPEED_GROUP
Interface for a generic control board device implementing position control in encoder coordinates.
virtual yarp::dev::ReturnValue relativeMoveRaw(const double *deltas)=0
Set relative position, all joints.
virtual yarp::dev::ReturnValue stopRaw()=0
Stop motion, multiple joints.
virtual yarp::dev::ReturnValue getTrajAccelerationsRaw(double *accs)=0
Get reference acceleration of all joints.
virtual yarp::dev::ReturnValue getAxes(size_t &ax)=0
Get the number of controlled axes.
virtual yarp::dev::ReturnValue getTargetPositionRaw(const int joint, double *ref)=0
Get the last position reference for the specified axis.
virtual yarp::dev::ReturnValue relativeMoveRaw(const int n_joint, const int *joints, const double *deltas)=0
Set relative position for a subset of joints.
virtual yarp::dev::ReturnValue getTrajSpeedRaw(int j, double *ref)=0
Get reference speed for a joint.
virtual yarp::dev::ReturnValue positionMoveRaw(const double *refs)=0
Set new reference point for all axes.
virtual yarp::dev::ReturnValue checkMotionDoneRaw(bool &flag)=0
Check if the current trajectory all joints is terminated.
virtual yarp::dev::ReturnValue setTrajAccelerationsRaw(const int n_joint, const int *joints, const double *accs)=0
Set reference acceleration on all joints.
virtual yarp::dev::ReturnValue getTargetPositionsRaw(const int n_joint, const int *joints, double *refs)=0
Get the last position reference for the specified group of axes.
virtual yarp::dev::ReturnValue getTrajSpeedsRaw(const int n_joint, const int *joints, double *spds)=0
Get reference speed of all joints.
virtual yarp::dev::ReturnValue stopRaw(int j)=0
Stop motion, single joint.
virtual yarp::dev::ReturnValue checkMotionDoneRaw(const std::vector< int > &joints, bool &flag)=0
Check if the current trajectory is terminated.
virtual yarp::dev::ReturnValue setTrajSpeedsRaw(const double *spds)=0
Set reference speed on all joints.
virtual yarp::dev::ReturnValue getTrajAccelerationsRaw(const int n_joint, const int *joints, double *accs)=0
Get reference acceleration for a joint.
virtual yarp::dev::ReturnValue positionMoveRaw(int j, double ref)=0
Set new reference point for a single axis.
virtual yarp::dev::ReturnValue getTrajAccelerationRaw(int j, double *acc)=0
Get reference acceleration for a joint.
virtual yarp::dev::ReturnValue setTrajSpeedRaw(int j, double sp)=0
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
virtual yarp::dev::ReturnValue checkMotionDoneRaw(int j, bool &flag)=0
Check if the current trajectory is terminated.
virtual yarp::dev::ReturnValue setTrajAccelerationRaw(int j, double acc)=0
Set reference acceleration for a joint.
virtual yarp::dev::ReturnValue stopRaw(const int n_joint, const int *joints)=0
Stop motion for subset of joints.
virtual yarp::dev::ReturnValue getTargetPositionsRaw(double *refs)=0
Get the last position reference for all axes.
virtual yarp::dev::ReturnValue setTrajAccelerationsRaw(const double *accs)=0
Set reference acceleration on all joints.
virtual yarp::dev::ReturnValue setTrajSpeedsRaw(const int n_joint, const int *joints, const double *spds)=0
Set reference speed on all joints.
virtual ~IPositionControlRaw()
Destructor.
virtual yarp::dev::ReturnValue getTrajSpeedsRaw(double *spds)=0
Get reference speed of all joints.
virtual yarp::dev::ReturnValue relativeMoveRaw(int j, double delta)=0
Set relative position.
virtual yarp::dev::ReturnValue positionMoveRaw(const int n_joint, const int *joints, const double *refs)=0
Set new reference point for a subset of joints.
Interface for a generic control board device implementing position control.
virtual yarp::dev::ReturnValue getTargetPosition(const int joint, double *ref)=0
Get the last position reference for the specified axis.
virtual yarp::dev::ReturnValue setTrajSpeed(int j, double sp)=0
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
virtual ~IPositionControl()
Destructor.
virtual yarp::dev::ReturnValue stop()=0
Stop motion, multiple joints.
virtual yarp::dev::ReturnValue getTrajAccelerations(const int n_joint, const int *joints, double *accs)=0
Get reference acceleration for a joint.
virtual yarp::dev::ReturnValue getTargetPositions(double *refs)=0
Get the last position reference for all axes.
virtual yarp::dev::ReturnValue setTrajAcceleration(int j, double acc)=0
Set reference acceleration for a joint.
virtual yarp::dev::ReturnValue setTrajAccelerations(const int n_joint, const int *joints, const double *accs)=0
Set reference acceleration on all joints.
virtual yarp::dev::ReturnValue relativeMove(int j, double delta)=0
Set relative position.
virtual yarp::dev::ReturnValue getTrajSpeeds(double *spds)=0
Get reference speed of all joints.
virtual yarp::dev::ReturnValue setTrajSpeeds(const double *spds)=0
Set reference speed on all joints.
virtual yarp::dev::ReturnValue getTrajSpeeds(const int n_joint, const int *joints, double *spds)=0
Get reference speed of all joints.
virtual yarp::dev::ReturnValue relativeMove(const int n_joint, const int *joints, const double *deltas)=0
Set relative position for a subset of joints.
virtual yarp::dev::ReturnValue positionMove(int j, double ref)=0
Set new reference point for a single axis.
virtual yarp::dev::ReturnValue checkMotionDone(bool &flag)=0
Check if the current trajectory is terminated.
virtual yarp::dev::ReturnValue getTargetPositions(const int n_joint, const int *joints, double *refs)=0
Get the last position reference for the specified group of axes.
virtual yarp::dev::ReturnValue getTrajAccelerations(double *accs)=0
Get reference acceleration of all joints.
virtual yarp::dev::ReturnValue checkMotionDone(int j, bool &flag)=0
Check if the current trajectory is terminated.
virtual yarp::dev::ReturnValue stop(const int n_joint, const int *joints)=0
Stop motion for subset of joints.
virtual yarp::dev::ReturnValue positionMove(const double *refs)=0
Set new reference point for all axes.
virtual yarp::dev::ReturnValue checkMotionDone(const std::vector< int > &joints, bool &flag)=0
Check if the current trajectory is terminated.
virtual yarp::dev::ReturnValue getAxes(size_t &ax)=0
Get the number of controlled axes.
virtual yarp::dev::ReturnValue getTrajSpeed(int j, double *ref)=0
Get reference speed for a joint.
virtual yarp::dev::ReturnValue setTrajAccelerations(const double *accs)=0
Set reference acceleration on all joints.
virtual yarp::dev::ReturnValue setTrajSpeeds(const int n_joint, const int *joints, const double *spds)=0
Set reference speed on all joints.
virtual yarp::dev::ReturnValue stop(int j)=0
Stop motion, single joint.
virtual yarp::dev::ReturnValue getTrajAcceleration(int j, double *acc)=0
Get reference acceleration for a joint.
virtual yarp::dev::ReturnValue positionMove(const int n_joint, const int *joints, const double *refs)=0
Set new reference point for a subset of joints.
virtual yarp::dev::ReturnValue relativeMove(const double *deltas)=0
Set relative position, all joints.
std::int32_t vocab32_t
Definition numeric.h:78
For streams capable of holding different kinds of content, check what they actually have.
constexpr yarp::conf::vocab32_t createVocab32(char a, char b=0, char c=0, char d=0)
Create a vocab from chars.
Definition Vocab32.h:27
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_dev_API
Definition api.h:18