I get the error:
'MPU6050 {aka class MPU6050_Base}' has no member named 'dmpGetQuaternion'
when I build OpenCat.ino. In the build log, there are a number of errors that seem to stem from a typedef conflict (class inheritance?)
In file included from /home/jabberwocky/Documents/LocusSolus/petoi/bittle/OpenCat/OpenCat.ino:37:0:
/home/jabberwocky/snap/arduino/current/Arduino/libraries/MPU6050/MPU6050_6Axis_MotionApps20.h: At global scope:
/home/jabberwocky/snap/arduino/current/Arduino/libraries/MPU6050/MPU6050_6Axis_MotionApps20.h:151:36: error: conflicting declaration 'typedef class MPU6050_6Axis_MotionApps20 MPU6050'
typedef MPU6050_6Axis_MotionApps20 MPU6050;
^~~~~~~
In file included from /home/jabberwocky/Documents/LocusSolus/petoi/bittle/OpenCat/OpenCat.ino:2:0:
/home/jabberwocky/snap/arduino/current/Arduino/libraries/MPU6050/MPU6050.h:845:22: note: previous declaration as 'typedef class MPU6050_Base MPU6050'
typedef MPU6050_Base MPU6050;
Board and Libraries seem to be OK. I followed all the instructions in the documentation and also checked through the forums.
Detecting libraries used...
/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10815 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/cores/arduino -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/variants/standard /tmp/arduino_build_153013/sketch/OpenCat.ino.cpp -o /dev/null
Alternatives for MPU6050.h: [MPU6050]
ResolveLibrary(MPU6050.h)
-> candidates: [MPU6050]
/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10815 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/cores/arduino -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/variants/standard -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/MPU6050 /tmp/arduino_build_153013/sketch/OpenCat.ino.cpp -o /dev/null
Alternatives for I2Cdev.h: [I2Cdev]
ResolveLibrary(I2Cdev.h)
-> candidates: [I2Cdev]
/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10815 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/cores/arduino -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/variants/standard -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/MPU6050 -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/I2Cdev /tmp/arduino_build_153013/sketch/OpenCat.ino.cpp -o /dev/null
Alternatives for Wire.h: [Wire@1.0]
ResolveLibrary(Wire.h)
-> candidates: [Wire@1.0]
/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10815 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/cores/arduino -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/variants/standard -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/MPU6050 -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/I2Cdev -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/libraries/Wire/src /tmp/arduino_build_153013/sketch/OpenCat.ino.cpp -o /dev/null
Alternatives for Adafruit_PWMServoDriver.h: [Adafruit_PWM_Servo_Driver_Library@2.4.0]
ResolveLibrary(Adafruit_PWMServoDriver.h)
-> candidates: [Adafruit_PWM_Servo_Driver_Library@2.4.0]
/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10815 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/cores/arduino -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/variants/standard -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/MPU6050 -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/I2Cdev -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/libraries/Wire/src -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/Adafruit_PWM_Servo_Driver_Library /tmp/arduino_build_153013/sketch/OpenCat.ino.cpp -o /dev/null
Alternatives for EEPROM.h: [EEPROM@2.0]
ResolveLibrary(EEPROM.h)
-> candidates: [EEPROM@2.0]
/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10815 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/cores/arduino -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/variants/standard -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/MPU6050 -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/I2Cdev -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/libraries/Wire/src -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/Adafruit_PWM_Servo_Driver_Library -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/libraries/EEPROM/src /tmp/arduino_build_153013/sketch/OpenCat.ino.cpp -o /dev/null
Alternatives for IRremote.h: [IRremote@2.6.1]
ResolveLibrary(IRremote.h)
-> candidates: [IRremote@2.6.1]
Summary at the end of the log:
Using library MPU6050 in folder: /home/jabberwocky/snap/arduino/current/Arduino/libraries/MPU6050 (legacy)
Using library I2Cdev in folder: /home/jabberwocky/snap/arduino/current/Arduino/libraries/I2Cdev (legacy)
Using library Wire at version 1.0 in folder: /home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/libraries/Wire
Using library Adafruit_PWM_Servo_Driver_Library at version 2.4.0 in folder: /home/jabberwocky/snap/arduino/current/Arduino/libraries/Adafruit_PWM_Servo_Driver_Library
Using library EEPROM at version 2.0 in folder: /home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/libraries/EEPROM
Using library IRremote at version 2.6.1 in folder: /home/jabberwocky/snap/arduino/current/Arduino/libraries/IRremote
exit status 1
'MPU6050 {aka class MPU6050_Base}' has no member named 'dmpGetQuaternion'
I'm running the Arduino IDE 1.8.15 under ubuntu 20.04. Here's the section in the log that shows which of the pertinent files are being compiled (in bold):
/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10815 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/cores/arduino -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/variants/standard -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/MPU6050 -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/I2Cdev -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/libraries/Wire/src -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/Adafruit_PWM_Servo_Driver_Library -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/libraries/EEPROM/src -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/IRremote/src /tmp/arduino_build_153013/sketch/OpenCat.ino.cpp -o /dev/null
/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10815 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/cores/arduino -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/variants/standard -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/MPU6050 -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/I2Cdev -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/libraries/Wire/src -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/Adafruit_PWM_Servo_Driver_Library -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/libraries/EEPROM/src -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/IRremote/src /home/jabberwocky/snap/arduino/current/Arduino/libraries/MPU6050/MPU6050.cpp -o /dev/null
/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10815 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/cores/arduino -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/variants/standard -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/MPU6050 -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/I2Cdev -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/libraries/Wire/src -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/Adafruit_PWM_Servo_Driver_Library -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/libraries/EEPROM/src -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/IRremote/src /home/jabberwocky/snap/arduino/current/Arduino/libraries/MPU6050/MPU6050_6Axis_MotionApps20.cpp -o /dev/null
/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10815 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/cores/arduino -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/variants/standard -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/MPU6050 -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/I2Cdev -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/libraries/Wire/src -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/Adafruit_PWM_Servo_Driver_Library -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/libraries/EEPROM/src -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/IRremote/src /home/jabberwocky/snap/arduino/current/Arduino/libraries/MPU6050/MPU6050_6Axis_MotionApps612.cpp -o /dev/null
/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10815 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/cores/arduino -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/variants/standard -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/MPU6050 -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/I2Cdev -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/libraries/Wire/src -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/Adafruit_PWM_Servo_Driver_Library -I/home/jabberwocky/snap/arduino/61/.arduino15/packages/arduino/hardware/avr/1.8.4/libraries/EEPROM/src -I/home/jabberwocky/snap/arduino/current/Arduino/libraries/IRremote/src /home/jabberwocky/snap/arduino/current/Arduino/libraries/MPU6050/MPU6050_9Axis_MotionApps41.cpp -o /dev/null
...etc...
I have successfully run ModuleTests, testI2cDevice and testMPU.
Can someone explain what is going on here and how I can fix it?
Thanks!
Hi Ronghong
I set out to create a new user as you suggested but it got too hairy so I just decided to rm -rf ~/snap/arduino and follow the instructions in the bittle documentation as I had done before. The contents of the ~/snap/arduino/current/Arduino/libraries after deleting and adding the MPU6050 and I2Cdev libs are:
Now it works and I successfully got bittle working. Thanks!
No worries! for now, bittle is my only arduino IDE project. If ever I need to add other libraries, I'll add them one by one and check after each one if bittle is still happy ;-).
Hi Rongzhong
I started creating a new user as you suggested but it got a little too hairy so I decided to simply rm -rf the contents of the ~/snap/arduino/current/Arduino/libraries and start over. I then followed the instructions in the bittle documentation as I had done before. The contents of the snap directory now look like:
I am now able to upload OpenCat.ino and proceed with calibration.
Thanks for all your help. Can't wait to see it walk!
Ok. I will do that as soon as i can. Thanks!
Sorry Rongzhong I mislabeled the screenshots. I interchanged the snap libs with the arduino libs.
Here the screenshots of the libraries:
arduino-1.8.16/libraries
snap/arduino/current/Arduino/libraries
OpenCat directory
Hi Rongzhong,
This is first time I installed MPU6050 and I2Cdev libraries. I git cloned
https://github.com/jrowberg/i2cdevlib.git
then used Arduino IDE library manager to Add .ZIP Library to find Arduino/MPU6050/ and Arduino/I2Cdev/. If there were other (possibly conflicting) copies of the libraries, wouldn't that show up in the build logs?
Hi, have you previously installed other MPU6050 or I2C libraries?