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
Pypilot compass calibration getting lost
#5
Hi Sean, I have done some more testing and have now disabled pypilot_boatimu and pypilot_web services and have pypilot_hat running from the autostart directory.  So now the only service running is pypilot.  If I stop pypilot and run it from the prompt I get:

pi@openplotter:~ $ pypilot        
autopilot start 965.860352699
world magnetic model not available
ERROR loading wind.py cannot import name 'HeadingOffset' from 'pypilot.autopilot' (/usr/local/lib/python3.7/dist-packages/pypilot/autopilot.py)   cannot import name 'HeadingOffset' from 'pypilot.autopilot' (/usr/local/lib/python3.7/dist-packages/pypilot/autopilot.py)
imu process 3592
nmea process 3596
listening on port 20220 for nmea connections
gps process 3599
loading servo calibration /home/pi/.pypilot/servocalibration
WARNING: using default servo calibration!!
Available Pilots: ['basic', 'basic2', 'basic3', 'absolute', 'simple']
warning: failed to open special file /dev/watchdog0 for writing cannot stroke the watchdog
made imu process realtime
Using settings file RTIMULib.ini
Settings file RTIMULib.ini loaded
Detected MPU9250/MPU9255 at standard address
pypilotServer process 3602
Using fusion algorithm Kalman STATE4
IMU Name: MPU-925x
min/max compass calibration not in use
Using ellipsoid compass calibration
Using accel calibration
server setup has 5 pipes
autopilot init complete 966.437365636
serialprobe removing gps device /dev/serial/by-id/usb-u-blox_AG_-_www.u-blox.com_u-blox_7_-_GPS_GNSS_Receiver-if00
autopilot iteration running too slow 0.08152242500000284
autopilot iteration running too slow 0.07350128900009167
server add socket ('127.0.0.1', 51894)
MPU-925x init complete
server add socket ('127.0.0.1', 51896)
autopilot iteration running too slow 0.1496633499999689
setting initial gyro bias [2.014, -3.165, -1.164]
imu rate set to rate 10
server add socket ('127.0.0.1', 51898)
gpsd connected
calibration loaded, starting 3590
GPSD devices ['/dev/ttyACM0']
servo probe ('/dev/ttyOP_arduino', 38400) 971.516375292
failed to open servo on: ('/dev/ttyOP_arduino', 38400) [Errno 2] could not open port /dev/ttyOP_arduino: [Errno 2] No such file or directory: '/dev/ttyOP_arduino'
server/client is running too _slowly_ 0.12416198199991868
autopilot iteration running too slow 0.1258177939999996
signalk process 3598
signalkread token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkZXZpY2UiOiJweXBpbG90LTQwMTAxNTA5MTcwIiwiaWF0IjoxNjQ4NjQwNzQ4fQ.rPAKkNnYTQoD0UI-CKNPwdj7O_t9q46Nf_GLvSdVHwk
signalk zeroconf service add openplotter._http._tcp.local. _http._tcp.local.
signalk server found 192.168.1.117:3000
signalk zeroconf service add myrouter._http._tcp.local. _http._tcp.local.
signalk zeroconf service add WiserHeat034D42._http._tcp.local. _http._tcp.local.
signalk zeroconf service add Linksys03851._http._tcp.local. _http._tcp.local.
signalk probe... 192.168.1.117:3000
signalk found ws://192.168.1.117:3000/signalk/v1/stream?subscribe=none
signalk connected to ws://192.168.1.117:3000/signalk/v1/stream?subscribe=none
sensor found gps signalk GPsignalk
nmea probe ('/dev/ttyOP_arduino', 38400)
failed to open ('/dev/ttyOP_arduino', 38400) for nmea data [Errno 2] could not open port /dev/ttyOP_arduino: [Errno 2] No such file or directory: '/dev/ttyOP_arduino'
nmea probe ('/dev/ttyOP_arduino', 4800)
failed to open ('/dev/ttyOP_arduino', 4800) for nmea data [Errno 2] could not open port /dev/ttyOP_arduino: [Errno 2] No such file or directory: '/dev/ttyOP_arduino'
Exception converting signalk->pypilot unsupported operand type(s) for /: 'NoneType' and 'float' {'pypilot': {}, 'GP': {'navigation.position': {'longitude': -4.051491166666667, 'latitude': 50.316603}, 'navigation.courseOverGroundTrue': None, 'navigation.speedOverGround': 0.09877335835591701}}
Exception converting signalk->pypilot unsupported operand type(s) for /: 'NoneType' and 'float' {'pypilot': {}, 'GP': {'navigation.position': {'longitude': -4.051491166666667, 'latitude': 50.316603}, 

All looks OK (I don't have an arduino connected at the moment) except for the SignalK error, which I have not seem before. The Calibration Loaded message seems to indicate the config file has been loaded OK.

I then calibrated the Accelerometer and then the compass (see screenshot attached) and left the system running for a while.  The compass was reading correctly all the time.  I checked the pypilot.conf file and the compass calibration reading had been updated:

imu.gyrobias=[2.170, -3.104, -1.021]
imu.accel.calibration.locked=false
imu.accel.calibration.points=[[-1.477, -0.626, -0.342], [-1.490, -0.631, -0.256], [-1.511, -0.652, -0.135], [-1.162, -1.646, -1.325], [-1.520, -1.446, 0.644], [-0.289, -1.290, -0.154], [-1.197, -0.597, -0.341], [-0.800, -1.673, -1.230], [-1.284, -2.000, -0.395], [-1.189, -1.545, 0.699], [-2.000, -1.648, -0.360], [-0.230, -1.667, -0.276]]
imu.compass.calibration.locked=false
imu.compass.calibration.points=[[22.565, -26.972, -12.068], [0.357, -20.012, -21.695], [20.611, -49.877, -18.364], [12.677, -45.714, -19.003], [11.747, -32.099, -16.014], [13.487, -24.927, -14.874], [42.104, -30.923, -13.414], [5.981, -10.747, -21.193], [36.552, -51.640, -18.912], [10.365, -20.223, -16.448], [18.705, -40.635, -14.600], [24.066, -22.528, -12.068], [38.554, -24.056, -12.707], [45.774, -38.989, -15.125], [34.193, -15.944, -13.893], [48.943, -49.759, -98.025], [20.135, 1.035, -22.402], [40.436, -46.114, -16.562], [11.342, -35.861, -16.539], [5.576, -29.559, -18.569], [35.552, -10.441, -15.992], [29.785, -3.339, -18.569], [49.658, -41.776, -101.744], [23.256, -53.122, -19.938], [34.050, -45.479, -15.398], [35.432, -52.463, -19.505], [18.300, -12.252, -15.809], [36.934, -48.865, -102.177]]

I then re-booted the pi and the compass was not working at all and calibration values lost (see screenshot).  The OpenCPN Pypilot plugin is working fine, although I do have to click on the config button and then OK to get it to connect to pypilot.

As always, any help much appreciated!
Regards
David


Attached Files Image(s)
       
Reply


Messages In This Thread
RE: Pypilot compass calibration getting lost - by drbarritt - 2022-07-31, 06:36 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)