YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ITorqueControl.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_ITORQUECONTROL_H
7#define YARP_DEV_ITORQUECONTROL_H
8
9#include <yarp/os/Vocab.h>
10#include <yarp/dev/api.h>
12
13namespace yarp::dev {
14class ITorqueControlRaw;
15class ITorqueControl;
16class MotorTorqueParameters;
17}
18
20{
21 public:
22 double bemf;
23 double bemf_scale;
24 double ktau;
25 double ktau_scale;
26 double viscousPos;
27 double viscousNeg;
28 double coulombPos;
29 double coulombNeg;
31 MotorTorqueParameters() : bemf(0), bemf_scale(0), ktau(0), ktau_scale(0), viscousPos(0), viscousNeg(0), coulombPos(0), coulombNeg(0), velocityThres(0){};
32};
33
40{
41public:
45 virtual ~ITorqueControl() {}
46
52 virtual yarp::dev::ReturnValue getAxes(size_t& ax) = 0;
53
60
67 virtual yarp::dev::ReturnValue getRefTorque(int j, double *t)=0;
68
73 virtual yarp::dev::ReturnValue setRefTorques(const double *t)=0;
74
80 virtual yarp::dev::ReturnValue setRefTorque(int j, double t)=0;
81
87 virtual yarp::dev::ReturnValue setRefTorques(const int n_joint, const int *joints, const double *t) =0;
88
95
102
109 virtual yarp::dev::ReturnValue getTorque(int j, double *t)=0;
110
116 virtual yarp::dev::ReturnValue getTorques(double *t)=0;
117
124 virtual yarp::dev::ReturnValue getTorqueRange(int j, double *min, double *max)=0;
125
131 virtual yarp::dev::ReturnValue getTorqueRanges(double *min, double *max)=0;
132};
133
140{
141public:
146
153 virtual yarp::dev::ReturnValue getAxes(size_t& ax) = 0;
154
161 virtual yarp::dev::ReturnValue getTorqueRaw(int j, double *t)=0;
162
169
176 virtual yarp::dev::ReturnValue getTorqueRangeRaw(int j, double *min, double *max)=0;
177
183 virtual yarp::dev::ReturnValue getTorqueRangesRaw(double *min, double *max)=0;
184
189 virtual yarp::dev::ReturnValue setRefTorquesRaw(const double *t)=0;
190
196 virtual yarp::dev::ReturnValue setRefTorqueRaw(int j, double t)=0;
197
203 virtual yarp::dev::ReturnValue setRefTorquesRaw(const int n_joint, const int *joints, const double *t) =0;
204
211
218 virtual yarp::dev::ReturnValue getRefTorqueRaw(int j, double *t)=0;
219
226
233};
234
235// Interface name
237
241constexpr yarp::conf::vocab32_t VOCAB_TORQUES_DIRECTS = yarp::os::createVocab32('d', 't', 'q', 's'); //This implements the setRefTorques for the whole part
242constexpr yarp::conf::vocab32_t VOCAB_TORQUES_DIRECT = yarp::os::createVocab32('d', 't', 'q'); //This implements the setRefTorque for a single joint
243constexpr yarp::conf::vocab32_t VOCAB_TORQUES_DIRECT_GROUP = yarp::os::createVocab32('d', 't', 'q', 'g'); //This implements the setRefTorques with joint list
244
245#endif // YARP_DEV_ITORQUECONTROL_H
constexpr yarp::conf::vocab32_t VOCAB_TORQUE
constexpr yarp::conf::vocab32_t VOCAB_TRQ
constexpr yarp::conf::vocab32_t VOCAB_TORQUES_DIRECTS
constexpr yarp::conf::vocab32_t VOCAB_TRQS
constexpr yarp::conf::vocab32_t VOCAB_TORQUES_DIRECT_GROUP
constexpr yarp::conf::vocab32_t VOCAB_TORQUES_DIRECT
constexpr yarp::conf::vocab32_t VOCAB_TORQUECONTROL_INTERFACE
Interface for control boards implementing torque control.
virtual yarp::dev::ReturnValue setRefTorquesRaw(const int n_joint, const int *joints, const double *t)=0
Set new torque reference for a subset of joints.
virtual yarp::dev::ReturnValue getTorqueRangesRaw(double *min, double *max)=0
Get the full scale of the torque sensors of all joints.
virtual yarp::dev::ReturnValue getTorqueRangeRaw(int j, double *min, double *max)=0
Get the full scale of the torque sensor of a given joint.
virtual yarp::dev::ReturnValue setMotorTorqueParamsRaw(int j, const yarp::dev::MotorTorqueParameters params)=0
Set the motor parameters.
virtual yarp::dev::ReturnValue getRefTorqueRaw(int j, double *t)=0
Set the reference value of the torque for a given joint.
virtual ~ITorqueControlRaw()
Destructor.
virtual yarp::dev::ReturnValue getMotorTorqueParamsRaw(int j, yarp::dev::MotorTorqueParameters *params)=0
Get the motor parameters.
virtual yarp::dev::ReturnValue getAxes(size_t &ax)=0
Get the number of controlled axes.
virtual yarp::dev::ReturnValue getTorqueRaw(int j, double *t)=0
Get the value of the torque on a given joint (this is the feedback if you have a torque sensor).
virtual yarp::dev::ReturnValue getTorquesRaw(double *t)=0
Get the value of the torque for all joints (this is the feedback if you have torque sensors).
virtual yarp::dev::ReturnValue setRefTorquesRaw(const double *t)=0
Set the reference value of the torque for all joints.
virtual yarp::dev::ReturnValue getRefTorquesRaw(double *t)=0
Get the reference value of the torque for all joints.
virtual yarp::dev::ReturnValue setRefTorqueRaw(int j, double t)=0
Set the reference value of the torque for a given joint.
Interface for control boards implementing torque control.
virtual yarp::dev::ReturnValue getAxes(size_t &ax)=0
Get the number of controlled axes.
virtual yarp::dev::ReturnValue getMotorTorqueParams(int j, yarp::dev::MotorTorqueParameters *params)=0
Get a subset of motor parameters (bemf, ktau etc) useful for torque control.
virtual yarp::dev::ReturnValue getTorqueRanges(double *min, double *max)=0
Get the full scale of the torque sensors of all joints.
virtual yarp::dev::ReturnValue getTorqueRange(int j, double *min, double *max)=0
Get the full scale of the torque sensor of a given joint.
virtual yarp::dev::ReturnValue getTorque(int j, double *t)=0
Get the value of the torque on a given joint (this is the feedback if you have a torque sensor).
virtual ~ITorqueControl()
Destructor.
virtual yarp::dev::ReturnValue setMotorTorqueParams(int j, const yarp::dev::MotorTorqueParameters params)=0
Set a subset of motor parameters (bemf, ktau etc) useful for torque control.
virtual yarp::dev::ReturnValue getRefTorque(int j, double *t)=0
Get the reference value of the torque for a given joint.
virtual yarp::dev::ReturnValue setRefTorque(int j, double t)=0
Set the reference value of the torque for a given joint.
virtual yarp::dev::ReturnValue getTorques(double *t)=0
Get the value of the torque for all joints (this is the feedback if you have torque sensors).
virtual yarp::dev::ReturnValue setRefTorques(const int n_joint, const int *joints, const double *t)=0
Set new torque reference for a subset of joints.
virtual yarp::dev::ReturnValue setRefTorques(const double *t)=0
Set the reference value of the torque for all joints.
virtual yarp::dev::ReturnValue getRefTorques(double *t)=0
Get the reference value of the torque for 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