Skip to content

pascalbros/OpenDoor

Repository files navigation

OpenDoor

An iOS, infrastructure-less ARKit-based Indoor Positioning System.

OpenDoor works with explicit and implicit markers. The first position fix is given by one of the markers found during the AR session, supports multiple floors building and custom injection of a location fix.

Install

Install using the Swift Package Manager:

dependencies: [
    .package(url: "https://github.com/pascalbros/OpenDoor.git", .upToNextMajor(from: "0.4.0"))
]

Example

Create an instance:

let openDoor = OpenDoorManager()
openDoor.dataSource = self
openDoor.delegate = self

Setup explicit markers:

openDoor.shouldRecognizeExplicitMarkers = true

Setup implicit markers:

let floor = ODFloor(name: "Second", floor: 2, oneMeterInPixels: 100)
let reference = ODImageReference(identifier: "my-id", image: UIImage(named: " my-asset")!, imagePath: nil, position: CGPoint(x: 100, y: 100), floor: floor, physicalWidth: 0.1)

Implement OpenDoorDataSource:

openDoor.dataSource = CustomOpenDoorDataSource()
openDoor.loadReferences([reference])
extension MyObject: OpenDoorDataSource {
    func recognizeAnchor(name: String) -> ODReference? {
        nil
    }
}

Implement the delegate OpenDoorDelegate:

extension MyObject: OpenDoorDelegate {
    func openDoor(_ manager: OpenDoorManager, didUpdateFloor floor: ODFloor) {
        print("New floor: \(floor.name)")
    }
    
    func openDoor(_ manager: OpenDoorManager, didUpdateLocation location: ODLocation) {
        print("New location: \(location)")
    }
}

Run:

openDoor.start()

License

OpenDoor is licensed under the terms of the MIT License. Please see the LICENSE.md file for full details.

About

An iOS ARKit-based Indoor Positioning System

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages