YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ImplementTorqueControl.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_IMPLEMENTTORQUECONTROL_H
7#define YARP_DEV_IMPLEMENTTORQUECONTROL_H
8
10#include <yarp/dev/api.h>
11
12namespace yarp::dev {
13class ImplementTorqueControl;
14}
15
16namespace yarp::dev::impl {
17
18template <typename T>
19class FixedSizeBuffersManager;
20
21} // namespace yarp::dev::impl
22
24{
25protected:
27 void* m_helper=nullptr;
28 std::vector<int> m_buffer_ints;
29 std::vector<double> m_buffer_doubles;
30 std::vector<double> m_buffer_doubles2;
31 std::mutex m_imp_mutex;
32
41 bool initialize (int size, const int *amap, const double *enc, const double *zos, const double *nw, const double* amps, const double* dutys, const double* bemfs, const double* ktaus);
42
47 bool uninitialize ();
48
49public:
50 /* Constructor.
51 * @param y is the pointer to the class instance inheriting from this
52 * implementation.
53 */
55
60
61 yarp::dev::ReturnValue getAxes(size_t& ax) override;
62 yarp::dev::ReturnValue getRefTorque(int j, double *) override;
63 yarp::dev::ReturnValue getRefTorques(double *t) override;
64 yarp::dev::ReturnValue setRefTorques(const double *t) override;
65 yarp::dev::ReturnValue setRefTorque(int j, double t) override;
66 yarp::dev::ReturnValue setRefTorques(const int n_joint, const int *joints, const double *t) override;
67 yarp::dev::ReturnValue getTorques(double *t) override;
68 yarp::dev::ReturnValue getTorque(int j, double *t) override;
71 yarp::dev::ReturnValue getTorqueRange(int j, double *min, double *max) override;
72 yarp::dev::ReturnValue getTorqueRanges(double *min, double *max) override;
73};
74
75#endif // YARP_DEV_IMPLEMENTTORQUECONTROL_H
Interface for control boards implementing torque control.
Interface for control boards implementing torque control.
yarp::dev::ReturnValue setRefTorque(int j, double t) override
Set the reference value of the torque for a given joint.
yarp::dev::ReturnValue setRefTorques(const double *t) override
Set the reference value of the torque for all joints.
yarp::dev::ReturnValue getMotorTorqueParams(int j, yarp::dev::MotorTorqueParameters *params) override
Get a subset of motor parameters (bemf, ktau etc) useful for torque control.
yarp::dev::ReturnValue setMotorTorqueParams(int j, const yarp::dev::MotorTorqueParameters params) override
Set a subset of motor parameters (bemf, ktau etc) useful for torque control.
yarp::dev::ReturnValue getTorqueRanges(double *min, double *max) override
Get the full scale of the torque sensors of all joints.
yarp::dev::ReturnValue getRefTorques(double *t) override
Get the reference value of the torque for all joints.
yarp::dev::ReturnValue getTorqueRange(int j, double *min, double *max) override
Get the full scale of the torque sensor of a given joint.
bool initialize(int size, const int *amap, const double *enc, const double *zos, const double *nw, const double *amps, const double *dutys, const double *bemfs, const double *ktaus)
Initialize the internal data and alloc memory.
yarp::dev::ReturnValue getTorque(int j, double *t) override
Get the value of the torque on a given joint (this is the feedback if you have a torque sensor).
bool uninitialize()
Clean up internal data and memory.
yarp::dev::ReturnValue getAxes(size_t &ax) override
Get the number of controlled axes.
yarp::dev::ReturnValue getRefTorque(int j, double *) override
Get the reference value of the torque for a given joint.
yarp::dev::ReturnValue getTorques(double *t) override
Get the value of the torque for all joints (this is the feedback if you have torque sensors).
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