2020-07-07, 09:27 PM
I think I have solved the problem in the meanwhile:
Pypilot is using RTIMULib2 (https://github.com/seandepagnier/RTIMULib2.git), where the i2c addresses of the MPU-9250 are defined in the header file RTIMUDefs.h.
So in order to change the priority in which pypilot accesses the two possible i2c addresses (0x68 and 0x69) you need to modify the RTMIDefs.h file before you re-build and reinstall the library:
- open the file RTIMULib/IMUDrivers/RTIMUDefs.h
- swap the two addresses (0x68 & 0x69) in the sections 'MPU925x I2C Slave Addresses' AND 'MPU9150 I2C Slave Addresses'
- save and close the file
Now pypiot accesses first the external IMU and if it does not find it (e.g. because it is disconnected) it uses the internal IMU from the Moitessier HAT.
Works flawlessly…
Pypilot is using RTIMULib2 (https://github.com/seandepagnier/RTIMULib2.git), where the i2c addresses of the MPU-9250 are defined in the header file RTIMUDefs.h.
So in order to change the priority in which pypilot accesses the two possible i2c addresses (0x68 and 0x69) you need to modify the RTMIDefs.h file before you re-build and reinstall the library:
Code:
git clone https://github.com/seandepagnier/RTIMULib2.git
- open the file RTIMULib/IMUDrivers/RTIMUDefs.h
- swap the two addresses (0x68 & 0x69) in the sections 'MPU925x I2C Slave Addresses' AND 'MPU9150 I2C Slave Addresses'
- save and close the file
Code:
cd RTIMULib2/Linux/python
sudo python3 setup.py build
sudo python3 setup.py install
Now pypiot accesses first the external IMU and if it does not find it (e.g. because it is disconnected) it uses the internal IMU from the Moitessier HAT.
Works flawlessly…