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
#21
(2017-07-10, 06:23 PM)Sailoog Wrote: It is important for us that we could use more than one IMU model. Despite being optimized for MPU-9255, it seems to me that I am getting good result with LSM9DS0.

After following your moving instructions I get a first fix after less than a minute and I keep getting fixes.
Code:
{"imu/compass_calibration": {"value": [[-4.188, -1.277, 4.439, 42.134, 0.839], [-4.192, -1.287, 4.04, 42.462], [-4.192, -1.287, 4.04, 42.462, 1.0, 1.0]]}}



Do you think this is acceptable? I do.
I have no way of judging just from the calibration. If you get good compass readings maybe it's good?
Quote:I have already an idea to implement pypilot to openplotter. The plan is to fully implement pypilot in 2 steps.

First I will add a new tab "compass" for pypilot compass/imu management. I will run boatimu.py and I will connect to signalk python server to get values to the main signalk node server. Could you point me to the best way to get data from signalk python server?

You can look at the source code to any script that uses the SignalkClient class...

You can watch certain values. It will then receive updates when they change. Alternately you can poll the values if you don't need as fast a rate, it can save some bandwidth. The autopilot runs at 10hz by default, but could run faster.




Quote:Seconf I will add a tool "Autopilot" for the rest of scripts. I will do this when I get the hardware.

e-sailing has developed a way to create the deviation table for your boat and add values to data coming from the IMU. Do you have plans to implement deviations on pypilot or can I apply e-sailing method?

What deviations? You can certainly reajust the autopilot gains from a client. This is what the autogain client does. Eventually I might implement all kinds of autofiltering etc, but for now, manually tuning the P and D gains isn't that hard and gives good results.
Reply
#22
The first implementation of pypilot is in the wild on OP 0.14.3!!!! I have just implemented the compass part and it is working right, waiting for users feedback. Thanks a lot.

When Compass is enabled, processing is 26% on Raspberry 3, do you think that could be optimized?
Reply
#23
This is the documentation for pypilot compass
https://sailoog.gitbooks.io/openplotter-...mpass.html
Reply
#24
Do you have plans to internationalize code?
Reply
#25
(2017-08-08, 07:04 PM)Sailoog Wrote: Do you have plans to internationalize code?

Yes.  The lcd interface already is.

As for processing power at 25%...   Is this with the calibration locked?   Otherwise the calibration process runs periodically, every few minutes and uses a lot of cpu.

Good to see OP has pypilot supported, I will try to test it.   I have tested the autopilot with success on other boats now, it is working well.
Reply
#26
(2017-08-10, 08:38 PM)seandepagnier Wrote:
(2017-08-08, 07:04 PM)Sailoog Wrote: Do you have plans to internationalize code?


As for processing power at 25%...   Is this with the calibration locked?   Otherwise the calibration process runs periodically, every few minutes and uses a lot of cpu.

Yes, it is locked but still at 25%

I use:

Code:
        while True:
            t0 = time.time()
            data = boatimu.IMURead()
            if data:
                #sending data to signal k node server here
            server.HandleRequests()
            dt = time.time() - t0
            if dt > .1:
                time.sleep(dt);
Reply
#27
read_sensors_d.py is killing me. Even if I remove all the sensors and restart, it is still ties up one proc at 100%. (Not to mention turning the Pi into a small heater) ;-)
Reply
#28
Code:
        while True:
            t0 = time.time()
            data = boatimu.IMURead()
            if data:
                #sending data to signal k node server here
            server.HandleRequests()
            dt = time.time() - t0
            if dt > .1:
                time.sleep(dt);

25% usage sounds like one of the four raspberry pi cores is completely blocked. And looking at the code, this makes sense. The while does not sleep at all, if IMURead and HandleRequests are faster than 0.1 second.
I guess the other way around was meant?
if dt < .1:
  time.sleep(dt)

Still i find the variable sleep time amount weird.
Maybe time.sleep(.1-dt) makes more sense? Therefore IMURead() and HandleRequest are only called at most every .1 seconds.
Sorry, but i am not able to test this at the moment.
Reply
#29
25% usage sounds like one of the four raspberry pi cores is completely blocked. And looking at the code, this makes sense. The while does not sleep at all, if IMURead and HandleRequests are faster than 0.1 second.
I guess the other way around was meant?
if dt < .1:
time.sleep(dt)

Still i find the variable sleep time amount weird.
Maybe time.sleep(.1-dt) makes more sense? Therefore IMURead() and HandleRequest are only called at most every .1 seconds.
______________________________

Testing the first change, read_sensors_d goes from 100% of one core to ~35%, adding in the second change brings it down to ~1%. No adverse effects on the visible sensor response. Sean, any adverse effects on pypilot calculations?
Reply
#30
(2017-08-12, 03:54 PM)waterman480 Wrote: 25% usage sounds like one of the four raspberry pi cores is completely blocked. And looking at the code, this makes sense. The while does not sleep at all, if IMURead and HandleRequests are faster than 0.1 second.
I guess the other way around was meant?
if dt < .1:
 time.sleep(dt)

Still i find the variable sleep time amount weird.
Maybe time.sleep(.1-dt) makes more sense? Therefore IMURead() and HandleRequest are only called at most every .1 seconds.
______________________________

Testing the first change, read_sensors_d goes from 100% of one core to ~35%,   adding in the second change brings it down to ~1%.    No adverse effects on the visible sensor response.   Sean, any adverse effects on pypilot calculations?



Sorry, you fixed it the correct way.   This is a demo script that tests only the imu, not the complete autopilot.

The autopilot implementation doesn't have the bug.    openplotter should either run the complete autopilot,
or have an option to select either boatimu, or autopilot.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)