• njm

    @Drizzel, I think the issue is that after starting location updates, it takes some time for it to stabilize. I found that usually after 8 seconds the lat/long readings were no longer jumping around. I initially thought that it might be that your law of cosines equation was not well conditioned so I tried the haversine form and found little difference. Here is my mangle of your code:
    gps_logger.py
    To show what is going on, change the initial sleep interval to something small like 0.1sec and see just how much it bounces around.

    posted in Pythonista read more
  • njm

    Thanks @cvp
    I gave it a try. Here is a simple comparison of UIDevice.orientation to motion.get_attitude:
    facedown.py

    The 6 only comes up when completely upside down. The transition from flat to "vertical" happens near a pitch or roll of 30deg. Still not as reliable as the gravity term and ui.WebView

    posted in Pythonista read more
  • njm

    repository now public

    posted in Pythonista read more
  • njm

    As a work around, using the yaw component from motion.get_attitude works. Apple calibrates it with the magnetometer some how. Acceleration, attitude and gravity all seem to be unchanged. The attached code works in both 12.1 and 12.2.

    mag_test.py

    Screenshots in the gist show the magnetometer results for 12.1 at N,E,S and W.
    For 12.2 the magnetometer results appear to be random.

    The device orientation comes from ui.WebView (Thanks @JonB https://forum.omz-software.com/topic/997/get-current-screen-or-orientation-width).

    In portrait mode when the screen is held high (or low) enough to be face down, yaw and roll flip 180deg. This can be detected by the sign of a gravity component. The original Swift example (https://medium.com/swiftly-swift/how-to-build-a-compass-app-in-swift-2b6647ae25e8) uses a CoreMotion component not easily obtained by Pythonista to flag a face down orientation.

    edit: By face down I mean past vertical. The pitch component must be in the range [+90,-90]

    posted in Pythonista read more
  • njm

    Hello everyone. I’m a long time lurker and thanks for all your posts. I’m developing a gps app and it appears motion on iOS 12.2 gives random results. My testflight and Pythonista versions work fine at 12.1. Google helped me find chatter on other sites saying that the privacy settings for motion are now being enforced the way location settings are.
    Is anyone else having a problem? Workarounds?

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!