Git Product home page Git Product logo

Comments (5)

sobri909 avatar sobri909 commented on June 3, 2024

Hi @annawidera! Unfortunately the docs are woefully out of date 😞

The best way forward these days is to pull a local copy of Arc Mini (https://github.com/sobri909/ArcMini) and use that as example code.

Arc Mini is a fully functioning app that makes use of almost all of LocoKit's functionality. It's also got a bunch of classes that I'm planning to move upstream to LocoKit (those tasks are tracked here).

I'd also possibly recommend using LocoKit's develop branch, depending on your needs. I haven't had time to do another LocoKit stable release in a few months, so develop branch is ahead in some specific areas. Though hopefully they haven't diverged far in terms of API yet...

from locokit.

sobri909 avatar sobri909 commented on June 3, 2024

This is the full setup I'm using in Arc Mini's AppDelegate at the moment:

LocoKitService.apiKey = "<api key>"
ActivityTypesCache.highlander.store = RecordingManager.store
LocomotionManager.highlander.coordinateAssessor = CoordinateTrustManager(store: RecordingManager.store)
LocomotionManager.highlander.appGroup = AppGroup(appName: .arcMini, suiteName: "group.ArcApp")
LocomotionManager.highlander.appGroup?.timelineRecorder = RecordingManager.highlander.recorder

Though all of those lines are optional. The first two lines are only if you're using LocoKit server API provided activity type models for sample activity type classification.

The third line is only useful if you're allowing users to manually classify samples / timeline items (UI to allow them to correct their recorded timelines). The coordinateAssessor provides "Trust Factor" values for coordinates, based on samples that have been classified as "stationary" at/near that coordinate. Basically "stationary" samples that have non-zero speeds indicate that location data is less trustworthy at that coordinate. The higher the speed of stationary samples, the less trustworthy the location data at/near that coordinate.

The last two lines are only useful if you're running multiple LocoKit based apps in parallel that are sharing their databases. So that's really niche and almost certainly not necessary.

from locokit.

sobri909 avatar sobri909 commented on June 3, 2024

In Arc Mini's code, have a look at the RecordingManager class. That's my high level manager class for wrapping up the data store, timeline recorder, and various related activities.

from locokit.

sobri909 avatar sobri909 commented on June 3, 2024

Oh and a little history on why PersistentTimelineManager isn't around anymore: The old non persistent timeline manager class went away, after it became too difficult to juggle and keep up to date both persistent and non persistent stores. So now all stores are persistent, SQLite backed, and PersistentTimelineManager got renamed to TimelineManager after the old one went away.

from locokit.

sobri909 avatar sobri909 commented on June 3, 2024

Oh, I should mention ArcStore too. That's Arc Mini's subclass of TimelineStore, which is something that's necessary to do if you want to subclass TimelineObjects. In Mini's case that's ArcVisit / ArcPath as subclasses of Visit and Path.

ArcStore also provides the Place models that aren't part of LocoKit yet. Plus some other stuff. There's a lot going on in there. It's perhaps not a great idea to jump into a TimelineStore subclass initially 😏 Best to save that for when it's needed.

from locokit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.