OpenMarine

Full Version: MPU9250 heading is slowly drifting
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10
Here my test in fresh Raspbian for python 2 and python 3. Pypilot does not work on any of them

python3
#######

sudo apt autoremove sense-hat

sudo apt install python3-serial libpython3-dev python3-numpy python3-scipy swig python3-ujson  python3-pyudev python3-pil python3-flask python3-opengl python3-pip python3-dev python3-setuptools python3-flask-socketio libatlas-base-dev python3-wxgtk4.0

sudo pip3 install pywavefront pyglet gps gevent-websocket python-socketio tensorflow

git clone https://github.com/seandepagnier/RTIMULib2.git
cd RTIMULib2/Linux
cd python
sudo python3 setup.py build
sudo python3 setup.py install
cd
git clone https://github.com/pypilot/pypilot
git clone https://github.com/pypilot/pypilot_data
cp -rv pypilot_data/* pypilot
cd pypilot
sudo python3 setup.py build
sudo python3 setup.py install
cd
mkdir .pypilot

result
------------------------------------------------------------------------
2020-01-18 16:05:53.666728: E tensorflow/core/platform/hadoop/hadoop_file_system.cc:132] HadoopFileSystem load error: libhdfs.so: cannot open shared object file: No such file or directory
Settings file RTIMULib.ini loaded
Using settings file RTIMULib.ini
Detected MPU9250/MPU9255 at standard address
Using fusion algorithm Kalman STATE4
IMU Name: MPU-925x
min/max compass calibration not in use
Using ellipsoid compass calibration
Using accel calibration
MPU-925x init complete

Fast drifting
pitch 6.324074922525247 roll -91.53618928287831 heading 75.27876668630839   
pitch -44.22218193641304 roll 175.96489709053526 heading 6.5329903265509754

Alignment reset in calibration window does not work.
Boat is not rendered


python2
#######

sudo apt autoremove sense-hat

sudo apt install python-serial libpython-dev python-numpy python-scipy swig python-ujson  python-pyudev python-pil python-flask python-opengl python-pip python-dev python-setuptools python-wxgtk3.0

sudo pip install pywavefront pyglet gps gevent-websocket python-socketio flask-socketio

# unable to install tensorflow for python2

git clone https://github.com/seandepagnier/RTIMULib2.git
cd RTIMULib2/Linux
cd python
sudo python setup.py build
sudo python setup.py install
cd
git clone https://github.com/pypilot/pypilot
git clone https://github.com/pypilot/pypilot_data
cp -rv pypilot_data/* pypilot
cd pypilot
sudo python setup.py build
sudo python setup.py install
cd
mkdir .pypilot

result
------------------------------------------------------------------------
ERROR loading learning.py No module named tensorflow ,  No module named learning
ERROR loading learning.py No module named tensorflow ,  No module named learning
Settings file RTIMULib.ini loaded
Using settings file RTIMULib.ini
Detected MPU9250/MPU9255 at standard address
Using fusion algorithm Kalman STATE4
IMU Name: MPU-925x
min/max compass calibration not in use
Using ellipsoid compass calibration
Using accel calibration
MPU-925x init complete

Slow but continous drifting:
pitch -1.02317380473 roll -92.9565552682 heading 76.9911142959
pitch -1.24983757477 roll -91.073889727 heading 78.5113350684

Alignment reset in calibration window does not work.
Boat is rendered
with python3 the drift is fast and with python2 the drift is slow??
(2020-01-18, 08:21 PM)seandepagnier Wrote: [ -> ]with python3 the drift is fast and with python2 the drift is slow??

Yes, if I uninstall tensorflow in python3, drift  and initial values are similar in python2 and python3.
I have just now found and fixed a bug in python-rtimulib2 that affects only python3:

tensorflow should not have any effect.

let me know if this fixes the drifting issue:

https://github.com/seandepagnier/RTIMULi...e7d0f1d29d
I fixed the issue with alignment just now. Please pull both RTIMULib2 and pypilot from git again.
Yes, it is stable! Great job!
Although, I don't get a compass calibration...
Thanks Sean, it seems that drift has gone and alignment is working again. Now I get this error when calibrating and a fit is achieved:


Code:
Settings file RTIMULib.ini loaded
Using settings file RTIMULib.ini
Detected MPU9250/MPU9255 at standard address
Using fusion algorithm Kalman STATE4
IMU Name: MPU-925x
min/max compass calibration not in use
Using ellipsoid compass calibration
Using accel calibration
MPU-925x init complete
Process Process-2:090598 roll 179.87547722303637 heading 277.6334899075731    
Traceback (most recent call last):
 File "/usr/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
   self.run()
 File "/usr/lib/python3.7/multiprocessing/process.py", line 99, in run
   self._target(*self._args, **self._kwargs)
 File "/usr/local/lib/python3.7/dist-packages/pypilot-0.14-py3.7-linux-armv7l.egg/pypilot/calibration_fit.py", line 617, in CalibrationProcess
   fit = FitCompass(compass_cal, compass_calibration, norm)
 File "/usr/local/lib/python3.7/dist-packages/pypilot-0.14-py3.7-linux-armv7l.egg/pypilot/calibration_fit.py", line 499, in FitCompass
   fit = FitPointsCompass(p, compass_calibration, norm)
 File "/usr/local/lib/python3.7/dist-packages/pypilot-0.14-py3.7-linux-armv7l.egg/pypilot/calibration_fit.py", line 196, in FitPointsCompass
   initial = vector.add(current[:3], vector.project(vector.sub(guess[:3], current[:3]), norm))
TypeError: 'map' object is not subscriptable
got signal 17 cleaning up
got signal 15 cleaning up
got signal 15 cleaning up
Process Process-1:
Process Process-3:
Traceback (most recent call last):
Traceback (most recent call last):
Traceback (most recent call last):
 File "/usr/local/bin/pypilot_boatimu", line 11, in <module>
 File "/usr/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
   self.run()
 File "/usr/lib/python3.7/multiprocessing/process.py", line 99, in run
   self._target(*self._args, **self._kwargs)
 File "/usr/local/lib/python3.7/dist-packages/pypilot-0.14-py3.7-linux-armv7l.egg/pypilot/boatimu.py", line 147, in imu_process
   time.sleep(t)
 File "/usr/local/lib/python3.7/dist-packages/pypilot-0.14-py3.7-linux-armv7l.egg/pypilot/boatimu.py", line 487, in cleanup
   raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
   load_entry_point('pypilot==0.14', 'console_scripts', 'pypilot_boatimu')()
 File "/usr/local/lib/python3.7/dist-packages/pypilot-0.14-py3.7-linux-armv7l.egg/pypilot/boatimu.py", line 530, in main
 File "/usr/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
   self.run()
 File "/usr/lib/python3.7/multiprocessing/process.py", line 99, in run
   self._target(*self._args, **self._kwargs)
 File "/usr/local/lib/python3.7/dist-packages/pypilot-0.14-py3.7-linux-armv7l.egg/signalk/pipeserver.py", line 157, in pipe_server_process
   time.sleep(.1)
 File "/usr/local/lib/python3.7/dist-packages/pypilot-0.14-py3.7-linux-armv7l.egg/pypilot/boatimu.py", line 487, in cleanup
   raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
   boatimu.iteration()
 File "/usr/local/lib/python3.7/dist-packages/pypilot-0.14-py3.7-linux-armv7l.egg/pypilot/boatimu.py", line 522, in iteration
   time.sleep(dt)
 File "/usr/local/lib/python3.7/dist-packages/pypilot-0.14-py3.7-linux-armv7l.egg/pypilot/boatimu.py", line 487, in cleanup
got signal 17 cleaning up
KeyboardInterrupt
got signal atexit cleaning up
got signal 17 cleaning up
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
 File "/usr/lib/python3.7/multiprocessing/popen_fork.py", line 28, in poll
   pid, sts = os.waitpid(self.pid, flag)
 File "/usr/local/lib/python3.7/dist-packages/pypilot-0.14-py3.7-linux-armv7l.egg/pypilot/boatimu.py", line 487, in cleanup
   raise KeyboardInterrupt # to get backtrace on all processes
KeyboardInterrupt
terminate imu process
terminate calibration process
python3 is still broken for calibration, but very close.. I'll look at it tomorrow.
Ok, in the meantime I will apply your latest changes in RTIMULib2 and pypilot web to OP.

Error with tensorflow has gone in python 3 too

thanks
looks much better my pitch and roll are mixed up but it is stable and levels out
Pages: 1 2 3 4 5 6 7 8 9 10