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#include <vector>
13
14namespace yarp::dev {
15class ImplementVelocityControl;
16class StubImplVelocityControlRaw;
17}
18
19namespace yarp::dev::impl {
20
21template <typename T>
22class FixedSizeBuffersManager;
23
24} // namespace yarp::dev::impl
25
27{
28protected:
29 IVelocityControlRaw* m_iraw=nullptr;
30 void* m_helper=nullptr;
31 std::vector<int> m_buffer_ints;
32 std::vector<double> m_buffer_doubles;
33 std::mutex m_imp_mutex;
34
44 bool initialize (int size, const int *amap, const double *enc, const double *zos);
45
50 bool uninitialize();
51
52public:
59
64
65 yarp::dev::ReturnValue getAxes(size_t& axes) override;
66 yarp::dev::ReturnValue velocityMove(int j, double sp) override;
67 yarp::dev::ReturnValue velocityMove(const double *sp) override;
68 yarp::dev::ReturnValue setTrajAcceleration(int j, double acc) override;
69 yarp::dev::ReturnValue setTrajAccelerations(const double *accs) override;
70 yarp::dev::ReturnValue getTrajAcceleration(int j, double *acc) override;
71 yarp::dev::ReturnValue getTrajAccelerations(double *accs) override;
72 yarp::dev::ReturnValue stop(int j) override;
74 yarp::dev::ReturnValue velocityMove(const int n_joint, const int *joints, const double *spds) override;
75 yarp::dev::ReturnValue getTargetVelocity(const int joint, double *vel) override;
76 yarp::dev::ReturnValue getTargetVelocities(double *vels) override;
77 yarp::dev::ReturnValue getTargetVelocities(const int n_joint, const int *joints, double *vels) override;
78 yarp::dev::ReturnValue setTrajAccelerations(const int n_joint, const int *joints, const double *accs) override;
79 yarp::dev::ReturnValue getTrajAccelerations(const int n_joint, const int *joints, double *accs) override;
80 yarp::dev::ReturnValue stop(const int n_joint, const int *joints) override;
81};
82
83
99{
100public:
101 yarp::dev::ReturnValue getAxes(size_t& axes) override
103
106
109
112
115
118
121
124
127
128 yarp::dev::ReturnValue velocityMoveRaw(const int n_joint, const int *joints, const double *spds) override
130
131 yarp::dev::ReturnValue getTargetVelocityRaw(const int joint, double *vel) override
133
136
137 yarp::dev::ReturnValue getTargetVelocitiesRaw(const int n_joint, const int *joints, double *vels) override
139
140 yarp::dev::ReturnValue setTrajAccelerationsRaw(const int n_joint, const int *joints, const double *accs) override
142
143 yarp::dev::ReturnValue getTrajAccelerationsRaw(const int n_joint, const int *joints, double *accs) override
145
146 yarp::dev::ReturnValue stopRaw(const int n_joint, const int *joints) override
148
149};
150#endif // YARP_DEV_IVELOCITYCONTROLIMPL_H
#define YARP_METHOD_NOT_YET_IMPLEMENTED()
Interface for control boards implementing velocity control in encoder coordinates.
Interface for control boards implementing velocity control.
yarp::dev::ReturnValue getTargetVelocity(const int joint, double *vel) override
Get the last reference speed set by velocityMove for single joint.
yarp::dev::ReturnValue stop() override
Stop motion, multiple joints.
yarp::dev::ReturnValue getTrajAcceleration(int j, double *acc) override
Get reference acceleration for a joint.
bool uninitialize()
Clean up internal data and memory.
yarp::dev::ReturnValue velocityMove(int j, double sp) override
Start motion at a given speed, single joint.
bool initialize(int size, const int *amap, const double *enc, const double *zos)
Initialize the internal data and alloc memory.
yarp::dev::ReturnValue getAxes(size_t &axes) override
Get the number of controlled axes.
yarp::dev::ReturnValue getTargetVelocities(double *vels) override
Get the last reference speed set by velocityMove for all joints.
yarp::dev::ReturnValue setTrajAcceleration(int j, double acc) override
Set reference acceleration for a joint.
yarp::dev::ReturnValue setTrajAccelerations(const double *accs) override
Set reference acceleration on all joints.
yarp::dev::ReturnValue getTrajAccelerations(double *accs) override
Get reference acceleration of all joints.
Stub implementation of IPositionControl2Raw interface.
yarp::dev::ReturnValue getTrajAccelerationsRaw(const int n_joint, const int *joints, double *accs) override
Get reference acceleration for a subset of joints.
yarp::dev::ReturnValue setTrajAccelerationsRaw(const double *accs) override
Set reference acceleration on all joints.
yarp::dev::ReturnValue getAxes(size_t &axes) override
Get the number of controlled axes.
yarp::dev::ReturnValue getTargetVelocitiesRaw(double *vels) override
Get the last reference speed set by velocityMove for all joints.
yarp::dev::ReturnValue velocityMoveRaw(const int n_joint, const int *joints, const double *spds) override
Start motion at a given speed for a subset of joints.
yarp::dev::ReturnValue setTrajAccelerationsRaw(const int n_joint, const int *joints, const double *accs) override
Set reference acceleration for a subset of joints.
yarp::dev::ReturnValue getTargetVelocitiesRaw(const int n_joint, const int *joints, double *vels) override
Get the last reference speed set by velocityMove for a group of joints.
yarp::dev::ReturnValue stopRaw() override
Stop motion, multiple joints.
yarp::dev::ReturnValue stopRaw(const int n_joint, const int *joints) override
Stop motion for a subset of joints.
yarp::dev::ReturnValue velocityMoveRaw(const double *sp) override
Start motion at a given speed, multiple joints.
yarp::dev::ReturnValue velocityMoveRaw(int j, double sp) override
Start motion at a given speed, single joint.
yarp::dev::ReturnValue getTrajAccelerationRaw(int j, double *acc) override
Get reference acceleration for a joint.
yarp::dev::ReturnValue getTrajAccelerationsRaw(double *accs) override
Get reference acceleration of all joints.
yarp::dev::ReturnValue setTrajAccelerationRaw(int j, double acc) override
Set reference acceleration for a joint.
yarp::dev::ReturnValue stopRaw(int j) override
Stop motion, single joint.
yarp::dev::ReturnValue getTargetVelocityRaw(const int joint, double *vel) override
Get the last reference speed set by velocityMove for single 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