OpenMarine
IMUTYPE gets overwritten - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: Pypilot (https://forum.openmarine.net/forumdisplay.php?fid=17)
+--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=18)
+--- Thread: IMUTYPE gets overwritten (/showthread.php?tid=1675)



IMUTYPE gets overwritten - didilodo - 2019-02-14

Hi all, 

I have an LSM303DLHC sensor. As from the file RTIMULib.ini this corresponds to IMUType 4. 

The problem I'm facing is that this value gets overwritten every time I click on apply under the pypilot tab to the value 13. 

Is anybody having an idea what could be the cause of this behavior and how I can overcome this issue?

Any help welcome.

didi


RE: IMUTYPE gets overwritten - seandepagnier - 2019-02-14

The imu should get autodetected, but maybe it is detected wrong?

Can you stop all pypilot processes, in a terminal type:

$ killlall python... a few times until no more processes running
$ rm RTIMULIB.ini
$ pypilot_boatimu

Try running a few times, make sure it works every time.

paste the output here


RE: IMUTYPE gets overwritten - didilodo - 2019-02-14

Indeed it gets detected wrong. The system detects the sensor as:
IMU Name: L3G4200D + HMC5883L

I did some further tests and hardwired the sensor type to 4 or 8 (according to the RTIMULib.ini they are the same for the LSM303 chip) but did run into the following.

I was able to fix pypilot_boat to use IMUType 4 by editing boatimu.py by disabling auto detection. However, I get the following error in the terminal where I started pypilot_boatimu.

Using settings file RTIMULib.ini
Using fusion algorithm Kalman STATE4
IMU Name: L3GD20 + LSM303DLHC
min/max compass calibration not in use
Using ellipsoid compass calibration
Using accel calibration
Incorrect L3GD20 id 60
ERROR: IMU Init Failed, no inertial data available

Any ideas?

I tested the sensor with a little python script which gives me good readings with a driver for the LSM303DLHC.

best regards
didi


RE: IMUTYPE gets overwritten - seandepagnier - 2019-02-26

Could you clone:
https://github.com/seandepagnier/rtimulib2

Try the scripts. If it doesn't work, you need to modify the source code to detect your imu correctly. It seems strange that you would have a part that uses a different i2c id, is this really true?

Once you get the library working, everything should work. Be sure to make a pull request!