-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathModule.h
55 lines (44 loc) · 1.56 KB
/
Module.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef MODULE_H
#define MODULE_H
#include <yarp/os/RFModule.h>
#include <yarp/sig/Vector.h>
#include <yarp/dev/IControlLimits.h>
#include <yarp/dev/IEncoders.h>
#include <yarp/dev/IControlMode.h>
#include <yarp/dev/IPositionControl.h>
#include <yarp/dev/ITorqueControl.h>
#include <yarp/dev/PolyDriver.h>
#include <iDynTree/KinDynComputations.h>
class Module : public yarp::os::RFModule
{
// Class to compute model quantities
iDynTree::KinDynComputations kinDynModel;
// Attributes to communicate with the robot YARP-based interface
yarp::dev::PolyDriver robotDevice;
// YARP Interfaces exposed by the remotecontrolboardremapper
yarp::dev::IControlLimits *ilim{nullptr};
yarp::dev::IEncoders *ienc{nullptr};
yarp::dev::IControlMode *imod{nullptr};
yarp::dev::ITorqueControl *itrq{nullptr};
// Quantities used by the control
yarp::sig::Vector positionsInRad;
yarp::sig::Vector velocitiesInRadS;
yarp::sig::Vector positionsInDeg;
yarp::sig::Vector velocitiesInDegS;
yarp::sig::Vector gravityCompensation;
yarp::sig::Vector referencePositionsInRad;
//write
yarp::sig::Vector errorInRad;
yarp::sig::Vector kp; // Nm/rad
yarp::sig::Vector kd; // Nm/rad
yarp::sig::Vector torquesInNm;
yarp::sig::Vector zeroDofs;
yarp::sig::Vector baseZeroDofs;
yarp::sig::Vector grav;
public:
virtual double getPeriod ();
virtual bool updateModule ();
virtual bool configure (yarp::os::ResourceFinder &rf);
virtual bool close ();
};
#endif /* end of include guard: MODULE_H */