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 using the Swift Package Manager:
dependencies: [
.package(url: "https://github.com/pascalbros/OpenDoor.git", .upToNextMajor(from: "0.4.0"))
]
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()
OpenDoor is licensed under the terms of the MIT License. Please see the LICENSE.md
file for full details.
link |
Stars: 3 |
Last commit: 1 year ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics