2017-08-14, 07:14 PM
(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.