YARP
Yet Another Robot Platform
ImplementTorqueControl.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_DEV_IMPLEMENTTORQUECONTROL_H
10 #define YARP_DEV_IMPLEMENTTORQUECONTROL_H
11 
13 #include <yarp/dev/api.h>
14 
15 namespace yarp {
16  namespace dev {
17  class ImplementTorqueControl;
18  }
19 }
20 
21 namespace yarp {
22 namespace dev {
23 namespace impl {
24 
25 template <typename T>
26 class FixedSizeBuffersManager;
27 
28 } // namespace impl
29 } // namespace dev
30 } // namespace yarp
31 
33 {
34 protected:
36  void *helper;
47  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);
48 
53  bool uninitialize ();
54 
55 public:
56  /* Constructor.
57  * @param y is the pointer to the class instance inheriting from this
58  * implementation.
59  */
61 
65  virtual ~ImplementTorqueControl();
66 
67  bool getAxes(int *ax) override;
68  bool getRefTorque(int j, double *) override;
69  bool getRefTorques(double *t) override;
70  bool setRefTorques(const double *t) override;
71  bool setRefTorque(int j, double t) override;
72  bool setRefTorques(const int n_joint, const int *joints, const double *t) override;
73  bool getTorques(double *t) override;
74  bool getTorque(int j, double *t) override;
75  bool setMotorTorqueParams(int j, const yarp::dev::MotorTorqueParameters params) override;
76  bool getMotorTorqueParams(int j, yarp::dev::MotorTorqueParameters *params) override;
77  bool getTorqueRange(int j, double *min, double *max) override;
78  bool getTorqueRanges(double *min, double *max) override;
79 };
80 
81 #endif // YARP_DEV_IMPLEMENTTORQUECONTROL_H
yarp::dev::ImplementTorqueControl::helper
void * helper
Definition: ImplementTorqueControl.h:36
yarp::dev::ImplementTorqueControl::doubleBuffManager
yarp::dev::impl::FixedSizeBuffersManager< double > * doubleBuffManager
Definition: ImplementTorqueControl.h:38
yarp::dev::ImplementTorqueControl::intBuffManager
yarp::dev::impl::FixedSizeBuffersManager< int > * intBuffManager
Definition: ImplementTorqueControl.h:37
t
float t
Definition: FfmpegWriter.cpp:74
yarp::dev::MotorTorqueParameters
Definition: ITorqueControl.h:24
yarp::dev::ITorqueControlRaw
Interface for control boards implementing torque control.
Definition: ITorqueControl.h:139
yarp::dev::ITorqueControl::getTorque
virtual bool 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).
yarp::dev::impl::FixedSizeBuffersManager< int >
yarp::dev::ITorqueControl::getAxes
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
yarp::dev::ImplementTorqueControl::ImplementTorqueControl
ImplementTorqueControl(yarp::dev::ITorqueControlRaw *y)
Definition: ImplementTorqueControl.cpp:19
yarp::dev::ITorqueControl::getTorqueRanges
virtual bool getTorqueRanges(double *min, double *max)=0
Get the full scale of the torque sensors of all joints.
ITorqueControl.h
yarp::dev::ITorqueControl::getRefTorques
virtual bool getRefTorques(double *t)=0
Get the reference value of the torque for all joints.
yarp::dev::ImplementTorqueControl::initialize
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.
Definition: ImplementTorqueControl.cpp:31
yarp::dev::ITorqueControl::setRefTorques
virtual bool setRefTorques(const double *t)=0
Set the reference value of the torque for all joints.
yarp::dev::ITorqueControl::setMotorTorqueParams
virtual bool setMotorTorqueParams(int j, const yarp::dev::MotorTorqueParameters params)
Set a subset of motor parameters (bemf, ktau etc) useful for torque control.
Definition: ITorqueControl.h:100
yarp::dev::ImplementTorqueControl::iTorqueRaw
yarp::dev::ITorqueControlRaw * iTorqueRaw
Definition: ImplementTorqueControl.h:35
yarp::dev::ITorqueControl::getTorques
virtual bool getTorques(double *t)=0
Get the value of the torque for all joints (this is the feedback if you have torque sensors).
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::dev::ImplementTorqueControl::~ImplementTorqueControl
virtual ~ImplementTorqueControl()
Destructor.
Definition: ImplementTorqueControl.cpp:26
yarp::dev::ITorqueControl
Interface for control boards implementing torque control.
Definition: ITorqueControl.h:39
yarp::dev::ImplementTorqueControl
Definition: ImplementTorqueControl.h:33
yarp::dev::ImplementTorqueControl::uninitialize
bool uninitialize()
Clean up internal data and memory.
Definition: ImplementTorqueControl.cpp:48
yarp::dev::ITorqueControl::setRefTorque
virtual bool setRefTorque(int j, double t)=0
Set the reference value of the torque for a given joint.
api.h
yarp::dev::ITorqueControl::getRefTorque
virtual bool getRefTorque(int j, double *t)=0
Get the reference value of the torque for a given joint.
yarp::dev::ITorqueControl::getMotorTorqueParams
virtual bool getMotorTorqueParams(int j, yarp::dev::MotorTorqueParameters *params)
Get a subset of motor parameters (bemf, ktau etc) useful for torque control.
Definition: ITorqueControl.h:93
yarp::dev::ITorqueControl::getTorqueRange
virtual bool getTorqueRange(int j, double *min, double *max)=0
Get the full scale of the torque sensor of a given joint.