18 #ifndef BVHNODEINERTIAL_H
19 #define BVHNODEINERTIAL_H
22 #include <yarp/dev/PolyDriver.h>
23 #include <yarp/dev/MultipleAnalogSensorsInterfaces.h>
26 constexpr
double DEG2RAD=3.14159265/180.0;
35 Property masConf {{
"device",Value(
"multipleanalogsensorsclient")},
36 {
"local", Value(
GUI_NAME+
"/inertials")},
37 {
"remote",Value(portIMUName.toStdString())},
38 {
"timeout",Value(0.04)},
39 {
"externalConnection",Value(
true)}};
41 if (!dd_MASClient.open(masConf))
43 yError(
"unable to open the MAS client\n");
46 if(!dd_MASClient.view(iAcc) || !dd_MASClient.view(iGyro))
48 yError(
"view of one of the MAS interfaces required failed\n");
58 qDebug(
"CLOSING INERTIAL");
63 if (dd_MASClient.isValid())
69 ok &= iAcc->getThreeAxisLinearAccelerometerMeasure(0, acc, ts);
70 ok &= iGyro->getThreeAxisGyroscopeMeasure(0, gyro, ts);
77 glTranslated(40.0,0.0,230.0);
78 glColor4f(0.4,0.4,1.0,1.0);
83 glColor4f(1.0,0.0,0.0,1.0);
85 glVertex3d(0.0,0.0,0.0);
86 glVertex3d(-10.0*acc[0],0.0,0.0);
89 glColor4f(0.0,1.0,0.0,1.0);
91 glVertex3d(0.0,0.0,0.0);
92 glVertex3d(0.0,-10.0*acc[1],0.0);
95 glColor4f(0.0,0.0,1.0,1.0);
97 glVertex3d(0.0,0.0,0.0);
98 glVertex3d(0.0,0.0,-10.0*acc[2]);
104 glDisable(GL_LINE_SMOOTH);
106 glColor4f(1.0,0.0,0.0,1.0);
108 glRotated(90.0,0.0,1.0,0.0);
112 glColor4f(0.0,1.0,0.0,1.0);
114 glRotated(-90.0,1.0,0.0,0.0);
118 glColor4f(0.0,0.0,1.0,1.0);
120 glRotated(-90.0,0.0,0.0,1.0);
124 glEnable(GL_LINE_SMOOTH);
131 yarp::dev::PolyDriver dd_MASClient;
132 yarp::dev::IThreeAxisGyroscopes* iGyro{
nullptr};
133 yarp::dev::IThreeAxisLinearAccelerometers* iAcc{
nullptr};
134 yarp::sig::Vector gyro;
135 yarp::sig::Vector acc;
void drawArc(double dOmega)
BVHNodeINERTIAL(const QString &name, double a, double d, double alpha, double theta0, const QString &portIMUName, iCubMesh *mesh=nullptr)
void drawJoint() override
virtual ~BVHNodeINERTIAL()
const QString & name() const