ZHomeSlice / Simple_MPU6050

Going Live
MIT License
88 stars 24 forks source link

Compilation errors #1

Closed AlexFundorin closed 3 years ago

AlexFundorin commented 5 years ago

Why do I get lots of compilation errors like this:

lib/Simple_MPU6050/DMP_Image.h:530:27: error: ISO C++ forbids declaration of 'normalize' with no type [-fpermissive]
   Quaternion :: normalize() {
lib/Simple_MPU6050/DMP_Image.h:530:3: error: extra qualification 'Quaternion::' on member 'normalize' [-fpermissive]
   Quaternion :: normalize() {
lib/Simple_MPU6050/DMP_Image.h: In member function 'Quaternion Quaternion::setQuaternion(float*)':
lib/Simple_MPU6050/DMP_Image.h:496:3: warning: no return statement in function returning non-void [-Wreturn-type]
   }
   ^
lib/Simple_MPU6050/DMP_Image.h: In member function 'int Quaternion::normalize()':
lib/Simple_MPU6050/DMP_Image.h:536:12: error: invalid conversion from 'Quaternion*' to 'int' [-fpermissive]
     return this;
            ^
lib\Simple_MPU6050\Simple_MPU6050.cpp: In member function 'bool Simple_MPU6050::view_DMP_firmware_Instance(uint16_t)':
lib\Simple_MPU6050\Simple_MPU6050.cpp:574:36: error: invalid conversion from 'uint16_t {aka short unsigned int}' to 'uint16_t* {aka short unsigned int*}' [-fpermissive]
    writeWords(devAddr, 0x6D, 1,  ii);
ZHomeSlice commented 5 years ago

While I would like to say I'm a good programmer (more of a hobby) much of my coding is not perfect but does compile when some of the official rules are ignored :) -fpermissive is: When you've written something that isn't allowed by the language standard (and therefore can't really be well-defined behavior, which is reason enough to not do it) but happens to map to some kind of executable if fed naïvely to the compiling engine

I compile with the -fpermissive option as if I didn't I would be troubleshooting forever lol Please feel free to help me correct my coding errors to better this library.

williamesp2015 commented 3 years ago

A lot of errors in the DMP_image.h and lib I just removed some:

ifndef DMP_Image_h

define DMP_Image_h

include

/ These defines are copied from dmpDefaultMPU6050.c in the general MPL releases. These defines may change for each DMP image, so be sure to modify these values when switching to a new image. /

define CFG_LP_QUAT (2712)

define END_ORIENT_TEMP (1866)

define CFG_27 (2742)

define CFG_20 (2224)

define CFG_23 (2745)

define CFG_FIFO_ON_EVENT (2690)

define END_PREDICTION_UPDATE (1761)

define CGNOTICE_INTR (2620)

define X_GRT_Y_TMP (1358)

define CFG_DR_INT (1029)

define CFG_AUTH (1035)

define UPDATE_PROP_ROT (1835)

define END_COMPARE_Y_X_TMP2 (1455)

define SKIP_X_GRT_Y_TMP (1359)

define SKIP_END_COMPARE (1435)

define FCFG_3 (1088)

define FCFG_2 (1066)

define FCFG_1 (1062)

define END_COMPARE_Y_X_TMP3 (1434)

define FCFG_7 (1073)

define FCFG_6 (1106)

define FLAT_STATE_END (1713)

define SWING_END_4 (1616)

define SWING_END_2 (1565)

define SWING_END_3 (1587)

define SWING_END_1 (1550)

define CFG_8 (2718)

define CFG_15 (2727)

define CFG_16 (2746)

define CFG_EXT_GYRO_BIAS (1189)

define END_COMPARE_Y_X_TMP (1407)

define DO_NOT_UPDATE_PROP_ROT (1839)

define CFG_7 (1205)

define FLAT_STATE_END_TEMP (1683)

define END_COMPARE_Y_X (1484)

define SKIP_SWING_END_1 (1551)

define SKIP_SWING_END_3 (1588)

define SKIP_SWING_END_2 (1566)

define TILTG75_START (1672)

define CFG_6 (2753)

define TILTL75_END (1669)

define END_ORIENT (1884)

define CFG_FLICK_IN (2573)

define TILTL75_START (1643)

define CFG_MOTION_BIAS (1208)

define X_GRT_Y (1408)

define TEMPLABEL (2324)

define CFG_ANDROID_ORIENT_INT (1853)

define CFG_GYRO_RAW_DATA (2722)

define X_GRT_Y_TMP2 (1379)

define D_0_22 (22+512)

define D_0_24 (24+512)

define D_0_36 (36)

define D_0_52 (52)

define D_0_96 (96)

define D_0_104 (104)

define D_0_108 (108)

define D_0_163 (163)

define D_0_188 (188)

define D_0_192 (192)

define D_0_224 (224)

define D_0_228 (228)

define D_0_232 (232)

define D_0_236 (236)

define D_1_2 (256 + 2)

define D_1_4 (256 + 4)

define D_1_8 (256 + 8)

define D_1_10 (256 + 10)

define D_1_24 (256 + 24)

define D_1_28 (256 + 28)

define D_1_36 (256 + 36)

define D_1_40 (256 + 40)

define D_1_44 (256 + 44)

define D_1_72 (256 + 72)

define D_1_74 (256 + 74)

define D_1_79 (256 + 79)

define D_1_88 (256 + 88)

define D_1_90 (256 + 90)

define D_1_92 (256 + 92)

define D_1_96 (256 + 96)

define D_1_98 (256 + 98)

define D_1_106 (256 + 106)

define D_1_108 (256 + 108)

define D_1_112 (256 + 112)

define D_1_128 (256 + 144)

define D_1_152 (256 + 12)

define D_1_160 (256 + 160)

define D_1_176 (256 + 176)

define D_1_178 (256 + 178)

define D_1_218 (256 + 218)

define D_1_232 (256 + 232)

define D_1_236 (256 + 236)

define D_1_240 (256 + 240)

define D_1_244 (256 + 244)

define D_1_250 (256 + 250)

define D_1_252 (256 + 252)

define D_2_12 (512 + 12)

define D_2_96 (512 + 96)

define D_2_108 (512 + 108)

define D_2_208 (512 + 208)

define D_2_224 (512 + 224)

define D_2_236 (512 + 236)

define D_2_244 (512 + 244)

define D_2_248 (512 + 248)

define D_2_252 (512 + 252)

define CPASS_BIAS_X (35 * 16 + 4)

define CPASS_BIAS_Y (35 * 16 + 8)

define CPASS_BIAS_Z (35 * 16 + 12)

define CPASS_MTX_00 (36 * 16)

define CPASS_MTX_01 (36 * 16 + 4)

define CPASS_MTX_02 (36 * 16 + 8)

define CPASS_MTX_10 (36 * 16 + 12)

define CPASS_MTX_11 (37 * 16)

define CPASS_MTX_12 (37 * 16 + 4)

define CPASS_MTX_20 (37 * 16 + 8)

define CPASS_MTX_21 (37 * 16 + 12)

define CPASS_MTX_22 (43 * 16 + 12)

define D_EXT_GYRO_BIAS_X (61 * 16)

define D_EXT_GYRO_BIAS_Y (61 * 16) + 4

define D_EXT_GYRO_BIAS_Z (61 * 16) + 8

define D_ACT0 (40 * 16)

define D_ACSX (40 * 16 + 4)

define D_ACSY (40 * 16 + 8)

define D_ACSZ (40 * 16 + 12)

define FLICK_MSG (45 * 16 + 4)

define FLICK_COUNTER (45 * 16 + 8)

define FLICK_LOWER (45 * 16 + 12)

define FLICK_UPPER (46 * 16 + 12)

define D_AUTH_OUT (992)

define D_AUTH_IN (996)

define D_AUTH_A (1000)

define D_AUTH_B (1004)

define D_PEDSTD_BP_B (768 + 0x1C)

define D_PEDSTD_HP_A (768 + 0x78)

define D_PEDSTD_HP_B (768 + 0x7C)

define D_PEDSTD_BP_A4 (768 + 0x40)

define D_PEDSTD_BP_A3 (768 + 0x44)

define D_PEDSTD_BP_A2 (768 + 0x48)

define D_PEDSTD_BP_A1 (768 + 0x4C)

define D_PEDSTD_INT_THRSH (768 + 0x68)

define D_PEDSTD_CLIP (768 + 0x6C)

define D_PEDSTD_SB (768 + 0x28)

define D_PEDSTD_SB_TIME (768 + 0x2C)

define D_PEDSTD_PEAKTHRSH (768 + 0x98)

define D_PEDSTD_TIML (768 + 0x2A)

define D_PEDSTD_TIMH (768 + 0x2E)

define D_PEDSTD_PEAK (768 + 0X94)

define D_PEDSTD_STEPCTR (768 + 0x60)

define D_PEDSTD_TIMECTR (964)

define D_PEDSTD_DECI (768 + 0xA0)

define D_HOST_NO_MOT (976)

define D_ACCEL_BIAS (660)

define D_ORIENT_GAP (76)

define D_TILT0_H (48)

define D_TILT0_L (50)

define D_TILT1_H (52)

define D_TILT1_L (54)

define D_TILT2_H (56)

define D_TILT2_L (58)

define D_TILT3_H (60)

define D_TILT3_L (62)

define DMP_CODE_SIZE (3062)

define DMP_START_ADDRESS (0x0400)

define TAP_X (0x01)

define TAP_Y (0x02)

define TAP_Z (0x04)

define TAP_XYZ (0x07)

define TAP_X_UP (0x01)

define TAP_X_DOWN (0x02)

define TAP_Y_UP (0x03)

define TAP_Y_DOWN (0x04)

define TAP_Z_UP (0x05)

define TAP_Z_DOWN (0x06)

define ANDROID_ORIENT_PORTRAIT (0x00)

define ANDROID_ORIENT_LANDSCAPE (0x01)

define ANDROID_ORIENT_REVERSE_PORTRAIT (0x02)

define ANDROID_ORIENT_REVERSE_LANDSCAPE (0x03)

define DMP_INT_GESTURE (0x01)

define DMP_INT_CONTINUOUS (0x02)

define DMP_FEATURE_TAP (0x001)

define DMP_FEATURE_ANDROID_ORIENT (0x002)

define DMP_FEATURE_LP_QUAT (0x004)

define DMP_FEATURE_PEDOMETER (0x008)

define DMP_FEATURE_6X_LP_QUAT (0x010)

define DMP_FEATURE_GYRO_CAL (0x020)

define DMP_FEATURE_SEND_RAW_ACCEL (0x040)

define DMP_FEATURE_SEND_RAW_GYRO (0x080)

define DMP_FEATURE_SEND_CAL_GYRO (0x100)

define DMP_FEATURE_SEND_ANY_GYRO (DMP_FEATURE_SEND_RAW_GYRO | DMP_FEATURE_SEND_CAL_GYRO)

define INV_X_GYRO (0x40)

define INV_Y_GYRO (0x20)

define INV_Z_GYRO (0x10)

define INV_XYZ_GYRO (INV_X_GYRO | INV_Y_GYRO | INV_Z_GYRO)

define INV_XYZ_ACCEL (0x08)

define INV_XYZ_COMPASS (0x01)

define INV_WXYZ_QUAT (0x100)

define INV_FSR_2G 0

define INV_FSR_4G 1

define INV_FSR_8G 2

define INV_FSR_16G 3

define INT_SRC_TAP (0x01)

define INT_SRC_ANDROID_ORIENT (0x08)

define MAX_PACKET_LENGTH (32)

define DEFAULT_MPU_HZ (100)

/ The mounting matrix below tells the MPL how to rotate the raw data from the driver(s). The matrix below reflects the axis orientation of the MPU-6050 on the nav6 circuit board. /

/ for your understanding this is the Gyro orentation Hard coded into the MPU With this instance of the DMP static signed char gyro_orientation[9] = { 1, 0, 0, 0, 1, 0, 0, 0, 1 }; /

/* This is a pre Configured Version of the Embedded MotionDriver 6.12 Firmware instance.

// Helper Math Classes class Quaternion { public: float w; float x; float y; float z;

Quaternion() { w = 1.0f; x = 0.0f; y = 0.0f; z = 0.0f; } Quaternion(float n) { setQuaternion(n[0], n[1], n[2], n[3]); } Quaternion(long n) { setQuaternion((float)n[0], (float)n[1], (float)n[2], (float)n[3]); } Quaternion setQuaternion(float n) { setQuaternion(n[0], n[1], n[2], n[3]); } Quaternion setQuaternion(long n) { setQuaternion((float)n[0], (float)n[1], (float)n[2], (float)n[3]); } Quaternion(float nw, float nx, float ny, float nz) { setQuaternion(nw, nx, ny, nz); } Quaternion setQuaternion(float nw, float nx, float ny, float nz) { w = nw; x = nx; y = ny; z = nz; } Quaternion getProduct(Quaternion q) { // Quaternion multiplication is defined by: // (Q1 Q2).w = (w1w2 - x1x2 - y1y2 - z1z2) // (Q1 Q2).x = (w1x2 + x1w2 + y1z2 - z1y2) // (Q1 Q2).y = (w1y2 - x1z2 + y1w2 + z1x2) // (Q1 Q2).z = (w1z2 + x1y2 - y1x2 + z1w2 return Quaternion( wq.w - xq.x - yq.y - zq.z, // new w wq.x + xq.w + yq.z - zq.y, // new x wq.y - xq.z + yq.w + zq.x, // new y wq.z + xq.y - yq.x + zq.w); // new z }

Quaternion getConjugate() { return Quaternion(w, -x, -y, -z); }

float getMagnitude() { return sqrt(ww + xx + yy + zz); }

//Quaternion :: normalize() { Quaternion normalize() { float m = getMagnitude(); // w /= m; // x /= m; // y /= m; // z /= m; //return this; return Quaternion( w /= m, // new w x /= m, // new x y /= m, // new y z /= m); // new z }

Quaternion getNormalized() { Quaternion r(w, x, y, z); r.normalize(); return r; } };

class VectorInt16 { public: int16_t x; int16_t y; int16_t z;

VectorInt16() { x = 0; y = 0; z = 0; }

VectorInt16(int16_t nx, int16_t ny, int16_t nz) { x = nx; y = ny; z = nz; }

float getMagnitude() { return sqrt((float)x(float)x + (float)y(float)y + (float)z*(float)z); }

//VectorInt16 :: normalize() { VectorInt16 normalize() { float m = getMagnitude(); // x /= m; // y /= m; // z /= m; //return this; return VectorInt16(x /= m,y /= m,z /= m); }

VectorInt16 getNormalized() { VectorInt16 r(x, y, z); r.normalize(); return r; }

VectorInt16 rotate(Quaternion *q) { // http://www.cprogramming.com/tutorial/3d/quaternions.html // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/transforms/index.htm // http://content.gpwiki.org/index.php/OpenGL:Tutorials:Using_Quaternions_to_represent_rotation // ^ or: http://webcache.googleusercontent.com/search?q=cache:xgJAp3bDNhQJ:content.gpwiki.org/index.php/OpenGL:Tutorials:Using_Quaternions_to_represent_rotation&hl=en&gl=us&strip=1

// P_out = q * P_in * conj(q)
// - P_out is the output vector
// - q is the orientation quaternion
// - P_in is the input vector (a*aReal)
// - conj(q) is the conjugate of the orientation quaternion (q=[w,x,y,z], q*=[w,-x,-y,-z])
Quaternion p(0, x, y, z);

// quaternion multiplication: q * p, stored back in p
p = q -> getProduct(p);

// quaternion multiplication: p * conj(q), stored back in p
p = p.getProduct(q -> getConjugate());

// p quaternion is now [0, x', y', z']

// x = p.x; // y = p.y; // z = p.z; // return this; return VectorInt16(p.x,p.y,p.z); }

VectorInt16 getRotated(Quaternion *q) { VectorInt16 r(x, y, z); r.rotate(q); return r; } };

class VectorFloat { public: float x; float y; float z;

VectorFloat() { x = 0; y = 0; z = 0; }

VectorFloat(float nx, float ny, float nz) { x = nx; y = ny; z = nz; }

float getMagnitude() { return sqrt(xx + yy + z*z); }

VectorFloat normalize() { float m = getMagnitude(); // x /= m; // y /= m; // z /= m; // return this; return VectorFloat( x /= m,y /= m,z /= m); }

VectorFloat getNormalized() { VectorFloat r(x, y, z); r.normalize(); return r; }

VectorFloat rotate(Quaternion *q) { Quaternion p(0, x, y, z);

// quaternion multiplication: q * p, stored back in p
p = q -> getProduct(p);

// quaternion multiplication: p * conj(q), stored back in p
p = p.getProduct(q -> getConjugate());

// p quaternion is now [0, x', y', z']

// x = p.x; // y = p.y; // z = p.z; //return this; return VectorFloat( p.x,p.y,p.z); }

VectorFloat getRotated(Quaternion *q) { VectorFloat r(x, y, z); r.rotate(q); return r; } };

endif

ZHomeSlice commented 3 years ago

Thank you williamesp2015, I quickly scanned through Your attached code and transferred the changes I spotted to the project. Please see if I missed any. Thanks again Z

Diegoraulderosa commented 3 years ago

Hello. I still find some errors in DMP_Image.h. I could not even compile the example file. Here I copy the errors I have received:

In file included from /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/Simple_MPU6050.h:7:0, from /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/Examples/Simple_MPU6050_Example/Simple_MPU6050_Example.ino:3: /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/DMP_Image.h: In member function 'int VectorInt16::normalize()': /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/DMP_Image.h:581:44: error: cannot convert 'VectorInt16' to 'int' in return return VectorInt16(x /= m,y /= m,z /= m); ^ In file included from /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/Simple_MPU6050.h:7:0, from /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/Examples/Simple_MPU6050_Example/Simple_MPU6050_Example.ino:3: /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/DMP_Image.h: In member function 'int VectorInt16::rotate(Quaternion)': /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/DMP_Image.h:613:35: error: cannot convert 'VectorInt16' to 'int' in return return VectorInt16(p.x,p.y,p.z); ^ /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/DMP_Image.h: In member function 'int VectorFloat::normalize()': /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/DMP_Image.h:651:45: error: cannot convert 'VectorFloat' to 'int' in return return VectorFloat( x /= m,y /= m,z /= m); ^ /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/DMP_Image.h: In member function 'int VectorFloat::rotate(Quaternion)': /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/DMP_Image.h:674:37: error: cannot convert 'VectorFloat' to 'int' in return return VectorFloat( p.x,p.y,p.z); ^ exit status 1 Error compiling for board Arduino Uno.

Andres-Araujo commented 3 years ago

Hi, I still have errors with the compilation:

In file included from C:\Users\PC\Documents\Arduino\sketch_sep18c\sketch_sep18c.ino:3:0: C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/MPU_WriteMacros.h:313:0: warning: "EXT_I2C_ST1_READ_BYTE" redefined

define EXT_I2C_ST1_READ_BYTE(Data) MPUi2cReadByte(0x4D, (uint8_t *)Data)

C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/MPU_WriteMacros.h:309:0: note: this is the location of the previous definition

define EXT_I2C_ST1_READ_BYTE(Data) MPUi2cReadByte(0x49, (uint8_t *)Data)

C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/MPU_WriteMacros.h:413:0: warning: "AKM_POWER_DOWN" redefined

define AKM_POWER_DOWN (0x00)

C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/MPU_WriteMacros.h:363:0: note: this is the location of the previous definition

define AKM_POWER_DOWN(HIGHS_SENS) (0b0000|(HIGHS_SENS & 1)<<4)

C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/MPU_WriteMacros.h:415:0: warning: "AKM_FUSE_ROM_ACCESS" redefined

define AKM_FUSE_ROM_ACCESS (0x0F)

C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/MPU_WriteMacros.h:369:0: note: this is the location of the previous definition

define AKM_FUSE_ROM_ACCESS(HIGHS_SENS) (0b1111|(HIGHS_SENS & 1)<<4)

In file included from C:\Users\PC\Documents\Arduino\sketch_sep18c\sketch_sep18c.ino:1:0: C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/DMP_Image.h:575:28: warning: ISO C++ forbids declaration of 'normalize' with no type [-fpermissive] VectorInt16 :: normalize() { ^ C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/DMP_Image.h:575:3: warning: extra qualification 'VectorInt16::' on member 'normalize' [-fpermissive] VectorInt16 :: normalize() { ^~~ C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/DMP_Image.h:590:38: warning: ISO C++ forbids declaration of 'rotate' with no type [-fpermissive] VectorInt16 :: rotate(Quaternion q) { ^ C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/DMP_Image.h:590:3: warning: extra qualification 'VectorInt16::' on member 'rotate' [-fpermissive] VectorInt16 :: rotate(Quaternion q) { ^~~ C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/DMP_Image.h: In member function 'int VectorInt16::normalize()': C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/DMP_Image.h:581:44: error: cannot convert 'VectorInt16' to 'int' in return return VectorInt16(x /= m,y /= m,z /= m); ^ In file included from C:\Users\PC\Documents\Arduino\sketch_sep18c\sketch_sep18c.ino:1:0: C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/DMP_Image.h: In member function 'int VectorInt16::rotate(Quaternion)': C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/DMP_Image.h:613:35: error: cannot convert 'VectorInt16' to 'int' in return return VectorInt16(p.x,p.y,p.z); ^ C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/DMP_Image.h: At global scope: C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/DMP_Image.h:645:28: warning: ISO C++ forbids declaration of 'normalize' with no type [-fpermissive] VectorFloat :: normalize() { ^ C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/DMP_Image.h:645:3: warning: extra qualification 'VectorFloat::' on member 'normalize' [-fpermissive] VectorFloat :: normalize() { ^~~ C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/DMP_Image.h:660:38: warning: ISO C++ forbids declaration of 'rotate' with no type [-fpermissive] VectorFloat :: rotate(Quaternion q) { ^ C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/DMP_Image.h:660:3: warning: extra qualification 'VectorFloat::' on member 'rotate' [-fpermissive] VectorFloat :: rotate(Quaternion q) { ^~~ C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/DMP_Image.h: In member function 'int VectorFloat::normalize()': C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/DMP_Image.h:651:45: error: cannot convert 'VectorFloat' to 'int' in return return VectorFloat( x /= m,y /= m,z /= m); ^ C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/DMP_Image.h: In member function 'int VectorFloat::rotate(Quaternion)': C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/DMP_Image.h:674:37: error: cannot convert 'VectorFloat' to 'int' in return return VectorFloat( p.x,p.y,p.z); ^ In file included from C:\Users\PC\Documents\Arduino\sketch_sep18c\sketch_sep18c.ino:4:0: C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/Simple_MPU6050.h: At global scope: C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/Simple_MPU6050.h:21:5: warning: 'typedef' was ignored in this declaration typedef struct SensorList_s { ^~~ C:\Users\PC\Documents\Arduino\libraries\Simple_MPU6050-master/Simple_MPU6050.h:33:5: warning: 'typedef' was ignored in this declaration typedef union AccelGyro_u { ^~~ exit status 1 Error compilando para la tarjeta Arduino Nano.

Piero15 commented 3 years ago

Hola. Todavía encuentro algunos errores en DMP_Image.h. Ni siquiera pude compilar el archivo de ejemplo. Aquí copio los errores que he recibido:

En archivo incluido de /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/Simple_MPU6050.h:7:0, de /Users/ diego/Documents/Arduino/libraries/ Simple_MPU6050- master/Examples/ Simple_MPU6050_Example : 3: /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/DMP_Image.h: En la función miembro 'int VectorInt16 :: normalize ()': / Users / diego / Documents / Arduino / libraries / Simple_MPU6050-master / DMP_Image.h: 581: 44: error: no se puede convertir 'VectorInt16' a 'int' a cambio return VectorInt16 (x / = m, y / = m, z / = m); ^ En archivo incluido de /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/Simple_MPU6050.h:7:0, de /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/Examples/Simple_MPU6050_Example/Simple_MPU6050_Example.ino:3: / Users/ diego/ Documents/ Arduino/ libraries/ Simple_Masterh/ DU6050 miembro VectorInt16 :: rotate (Quaternion ) ': /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/DMP_Image.h:613:35: error: no se puede convertir' VectorInt16 'a' int 'a cambio return VectorInt16 (px , py, pz); ^ /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/DMP_Image.h: En la función miembro 'int VectorFloat :: normalize ()': / Users / diego / Documents / Arduino / libraries / Simple_MPU6050-master / DMP_Image. h: 651: 45: error: no se puede convertir 'VectorFloat' a 'int' ^ /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/DMP_Image.h: En la función miembro 'int VectorFloat :: rotate (Quaternion )': / Users / diego / Documents / Arduino / libraries / Simple_MPU6050-master / DMP_Image.h: 674: 37: error: no se puede convertir 'VectorFloat' a 'int' a cambio return VectorFloat (px, py, pz); ^ estado de salida 1 Error al compilar para la placa Arduino Uno.

Hola por favor me podrias ayudar a resolver ese problema, me pasale exactamente igual no encuentro forma de solucionarlo :(

ZHomeSlice commented 3 years ago

Try the latest version of the library i just uploaded Z

On Sat, Oct 2, 2021 at 4:34 PM Piero15 @.***> wrote:

Hola. Todavía encuentro algunos errores en DMP_Image.h. Ni siquiera pude compilar el archivo de ejemplo. Aquí copio los errores que he recibido:

En archivo incluido de /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/Simple_MPU6050.h:7:0, de /Users/ diego/Documents/Arduino/libraries/ Simple_MPU6050- master/Examples/ Simple_MPU6050_Example : 3: /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/DMP_Image.h: En la función miembro 'int VectorInt16 :: normalize ()': / Users / diego / Documents / Arduino / libraries / Simple_MPU6050-master / DMP_Image.h: 581: 44: error: no se puede convertir 'VectorInt16' a 'int' a cambio return VectorInt16 (x / = m, y / = m, z / = m); ^ En archivo incluido de /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/Simple_MPU6050.h:7:0, de /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/Examples/Simple_MPU6050_Example/Simple_MPU6050_Example.ino:3: / Users/ diego/ Documents/ Arduino/ libraries/ Simple_Masterh/ DU6050 miembro VectorInt16 :: rotate (Quaternion ) ': /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/DMP_Image.h:613:35: error: no se puede convertir' VectorInt16 'a' int 'a cambio return VectorInt16 (px , py, pz); ^ /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/DMP_Image.h: En la función miembro 'int VectorFloat :: normalize ()': / Users / diego / Documents / Arduino / libraries / Simple_MPU6050-master / DMP_Image. h: 651: 45: error: no se puede convertir 'VectorFloat' a 'int' ^ /Users/diego/Documents/Arduino/libraries/Simple_MPU6050-master/DMP_Image.h: En la función miembro 'int VectorFloat :: rotate (Quaternion )': / Users / diego / Documents / Arduino / libraries / Simple_MPU6050-master / DMP_Image.h: 674: 37: error: no se puede convertir 'VectorFloat' a 'int' a cambio return VectorFloat (px, py, pz); ^ estado de salida 1 Error al compilar para la placa Arduino Uno.

Hola por favor me podrias ayudar a resolver ese problema, me pasale exactamente igual no encuentro forma de solucionarlo :(

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ZHomeSlice/Simple_MPU6050/issues/1#issuecomment-932829011, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA5GYKBWMS6LMWBRZRU65DUE6CGXANCNFSM4IQWAKTQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.