This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MPU9250 heading is slowly drifting
#41
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
Reply
#42
with python3 the drift is fast and with python2 the drift is slow??
Reply
#43
(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.
Reply
#44
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
Reply
#45
I fixed the issue with alignment just now. Please pull both RTIMULib2 and pypilot from git again.
Reply
#46
Yes, it is stable! Great job!
Although, I don't get a compass calibration...
Reply
#47
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
Reply
#48
python3 is still broken for calibration, but very close.. I'll look at it tomorrow.
Reply
#49
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
Reply
#50
looks much better my pitch and roll are mixed up but it is stable and levels out
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)