Giter VIP home page Giter VIP logo

arkit-corelocation's People

Contributors

aaronbrethorst avatar abdullahselek avatar aclima93 avatar adrgrondin avatar andrewljohnson avatar brentvvosselen avatar dependabot[bot] avatar developerark avatar dgileadi avatar dhmspector avatar emilycheroske avatar fousa avatar halmueller avatar hi-ro-to avatar holyzard avatar intere avatar jinoketani avatar jwilson85 avatar lrsb avatar matsoftware avatar pdesantis avatar pichirichi avatar pilot-marc avatar sorianog avatar staticdreams avatar stunner avatar thexande avatar vihanb avatar yfujiki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arkit-corelocation's Issues

LocationAnnotationNode not stable at a point.

I am trying to create simple application in which i place LocationAnnotationNode at a geo coordinate and want to grow and shrink its size depending upon the distance from it.
The problem is that as i go closer to the geo coordinate the LocationAnnotationNode repositions/resizes itself.
Also the LocationAnnotationNode is not placed at the exact location( geo coordinate).
Link of the video demo and code is below.
Please help me to figure out what am i doing wrong.
Demo Video
`
import UIKit
import SceneKit
import MapKit
import ARCL
import CoreLocation

class ViewController: UIViewController {

let sceneLocationView = SceneLocationView()

@IBOutlet var distancelabel: UILabel!
override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.

        let pinCoordinate = CLLocationCoordinate2D(latitude: 19.057396, longitude: 73.004699)
        let pinLocation = CLLocation(coordinate: pinCoordinate, altitude: 10 )
        let pinImage = UIImage(named: "pin")!
        let pinLocationNode = LocationAnnotationNode(location: pinLocation, image: pinImage)
        pinLocationNode.accessibilityLabel = "garden corner"//loc["place"]
        pinLocationNode.scaleRelativeToDistance = true
        sceneLocationView.locationDelegate = self
        sceneLocationView.addLocationNodeWithConfirmedLocation(locationNode: pinLocationNode)
        self.view.addSubview(sceneLocationView)
}
override func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()
    
    sceneLocationView.frame = CGRect(
        x: 0,
        y: 0,
        width: self.view.frame.size.width,
        height: self.view.frame.size.height)
    
}
override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
  
  sceneLocationView.run()
}
override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
self.view.bringSubview(toFront: distancelabel)
}

}
`
extension ViewController:SceneLocationViewDelegate{

func sceneLocationViewDidAddSceneLocationEstimate(sceneLocationView: SceneLocationView, position: SCNVector3, location: CLLocation) {

}

func sceneLocationViewDidRemoveSceneLocationEstimate(sceneLocationView: SceneLocationView, position: SCNVector3, location: CLLocation) {

}

func sceneLocationViewDidConfirmLocationOfNode(sceneLocationView: SceneLocationView, node: LocationNode) {
   
}

func sceneLocationViewDidSetupSceneNode(sceneLocationView: SceneLocationView, sceneNode: SCNNode) {
   
}

func sceneLocationViewDidUpdateLocationAndScaleOfLocationNode(sceneLocationView: SceneLocationView, locationNode: LocationNode) {
    
    guard let currentLocation = sceneLocationView.currentLocation() else{return}
    guard let nodelocation = locationNode.location else{return}
   
    let trimCurLoc = CLLocation(latitude: self.trimround(currentLocation.coordinate.latitude, toDecimalPlaces: 7), longitude: self.trimround(currentLocation.coordinate.longitude, toDecimalPlaces: 7))
    
    let distance = trimCurLoc.distance(from: nodelocation)

    var scale = locationNode.scale.y
    switch distance {
    case 0.0...20.0:
        scale = scale * 1.0
        distancelabel.text = "\(distance)    \(scale)"
        break
    case 20.01...40.0:
        scale = scale * 0.8
        distancelabel.text = "\(distance)    \(scale)"
        break
    case 40.1...60.0:
        scale = scale * 0.6
        distancelabel.text = "\(distance)    \(scale)"
        break
    case 60.01...100.0:
        scale = scale * 0.4
        distancelabel.text = "\(distance)    \(scale)"
        break
    case 100.01...10000.0:
        scale = scale * 0.3
        distancelabel.text = "\(distance)    \(scale)"
        break
    default:
        break
    }
    
    locationNode.scale =  SCNVector3(x: scale, y: scale, z: scale)
}

}

Custom UIView instead UIImage for LocationAnnotationNode

Hi,
I discovered this amazing library and I was wondering if it is possible to use custom UIViews, including UILabel etc, instead of a UIImage.
Is it necessary to convert the UIView to a UIImage or are there better ways to achieve that?

Thanks

SceneLocationView variable access control

Receiving these errors when trying to run the demo code from a new project with ARCL added as a Pod dependency:

'showFeaturePoints' is inaccessible due to 'internal' protection level
'bestLocationEstimate' is inaccessible due to 'internal' protection level
'locationManager' is inaccessible due to 'internal' protection level

Store and retrieve additional info/property in LocationAnnotationNode

I need to store additional information inside an LocationAnnotationNode. So I subclassed LocationAnnotationNode as MyLocationAnnotationNode, with an additional property called id.

Later when I did a hit test in sceneLocationVIew's touchBegan, I wasn't able to retrieve the additional id property, because the hit-result's SCNNode is not convertible to MyLocationAnnotationNode.

I tried another way by setting the SCNNode.name before adding them to sceneLocationView. However, when I do a hit test, the name info becomes nil.

What is the recommended way to store information in pins in the scene, and retrieve them later in hit test?

Demo on iPhone X

When I ran demo on iPhone X it starts and asks permissions then briefly shows camera view and then it hangs - anybody has same problem?

Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArray0 objectAtIndex:]: index 0 beyond bounds for empty NSArray'

i have been trying to do a UITapGesture for the node on the SceneLocationView.
However, it returns me with the error above.

` @objc func didTapped(_ recognizer: UITapGestureRecognizer) {

    let sceneView = recognizer.view as! ARSCNView
    let touchLocation = recognizer.location(in: sceneView)
    let hitResults = sceneView.hitTest(touchLocation, options: [:])
    guard let hitResult = hitResults.first  else {
        return
    }
    let node = hitResult.node
    if let name = node.childNodes[0].name {
        print(name)
        self.selectedTeam = name
    }
    performSegue(withIdentifier: "locationDetails", sender: self)
}`

Display only nodes with location < distance

Hi,
Is it possible to display only X nearest nodes or nodes in Y meters radius from user's location or should I handle removing/adding nodes each time the location changes myself?

Equivalent concepts in ARCore?

Not related to this repo, but figured I might get some guidance here -- Is there any equivalent technique for placing AR objects on lat / lon coordinates in ARCore? I'm hoping to experiment with this concept but have an Android device.

Location Issue

Hello there! thanks for the awesome lib, u rock guys!

I'm having an issue with locations as no matter what coordinates I'm using, the object always gets projected in my current location. How can I add/project my object to custom coordinates?
screen shot 2017-10-25 at 1 10 30 pm

Add LocationPolylineNode

The basis for this already exists on the feature/mapkit branch.

See the 2nd point of the comment here for more details on what’s required:
#7 (comment)

How to handle objects which are behind another object

Hi
I'm implementing a kind of POI view with ARKit-CoreLocation. In general it works great. Thanks guys. But now I came across a challenging Issue. If i have several POIs "behind" (when the user points to one direction and there are several pois). So how do I manage that i can ensure to see every POI? They should not "touch" eachother. They should stack.

Any Ideas?

Inconsistent LocationNode position

Hi,
I'd like to say thank you for such a great lib.
I'm having a problem:

  • Device used: iPhone 6S - iOS 11 beta 5

I added a SceneLocationView into my view controller's ViewDidLoad like this:

sceneLocationView = SceneLocationView()
sceneLocationView.showAxesNode = true
view.insertSubview(sceneLocationView, at: 0)
sceneLocationView.translatesAutoresizingMaskIntoConstraints = false
sceneLocationView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor).isActive = true
sceneLocationView.leftAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leftAnchor).isActive = true
sceneLocationView.rightAnchor.constraint(equalTo: view.safeAreaLayoutGuide.rightAnchor).isActive = true
sceneLocationView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor).isActive = true
sceneLocationView.locationDelegate = self

After user tapped on a button, I added a new LocationNode whose coordinate is the same to current location's, but altitude is 0.5m lower:

if let currentLocation = sceneLocationView.currentLocation() {
	let location = CLLocation(coordinate: currentLocation.coordinate, altitude: currentLocation.altitude - 0.5)
	let annotationNode = LocationAnnotationNode(location: location, image: #imageLiteral(resourceName: "pin"))
	sceneLocationView.addLocationNodeWithConfirmedLocation(locationNode: locationNode)
}

The node displayed correctly at first. However, when I moved the device around, the node also moved, sometimes its vertical position even jumps to about the same to the axes node's, even though its y-axis was about from -0.7 to -0.5

I wonder if I did something wrong.

Add locations

Hello people, how are you? Without a doubt, it is an excellent library, thank you for sharing with the community, I am new to AR development, and I am amazed at the possibilities.

So, I'm trying to include several location points, but I did not have success, could give me some help, right now, thank you.

Improve SceneKit lighting for navigational nodes

There’s some work going on on the /feature/mapkit branch which involves adding navigational nodes. Right now, because my knowledge of SceneKit and lighting is lacking, I’ve added a number of lights to each of these. This may be the cause of some slowness once you add a certain amount of them, and is also the cause of some side effects such as over lighting of other elements.

Perhaps we just need either a few lights for the entire scene? The goal is just to create some shadowing so you can differentiate the different sides, where if we don’t have lights then each side is equally lit and thus you just see the whole 3D shape as the same colour.

If someone with knowledge of SceneKit and lighting could contribute to this then that’d be great.

No such module `ARCL`

After following the steps mentioned in the setup using cocoapods, I get the following error.

screen shot 2017-08-30 at 9 53 08 am

What could be wrong?

Customize subview on Arkit

Hi All,
I want to add subview on Arkit as attachment image, Will I add subview to SCNNode or another way?
screen shot 2017-12-08 at 09 56 41

Thanks All.

Possibility to use third-party location provider ?

This project depends on geolocalisation's accuracy / quality.
Location Manager is fine for most outdoor usages, but it quickly becomes out of usage in dense city areas (multipaths) or indoor.
In theses situations, buildings / areas are getting equipped with third-party geolocation systems, often relying on BLE.
In order to use ARKit-CoreLocation indoor, it would be interesting to be able to input location / orientation.
The idea would be if delegate is specified, use it, otherwise use location manager.

unable to see annotationNode after adding

screen shot 2017-08-30 at 5 48 34 pm

I'm trying to do a basic example ^ where I would like to place a pin on a hardcoded co-ordinate near to me. This does not seem to work, any idea what could be wrong?

Support for Obj-C

I would suggest adding @objc tags so that the library can be called from Obj-C. If you agree I could PR on this.

Altitude offset when adding bigger image

Hey,

someone else experienced the altitude offset when you add a bigger image by "addLocationNodeWithConfirmedLocation" than 100 x 100?
How to get rid of that?
I attached some screenshot so you know what i mean:
First picture image size 50x50, 200x50, 400x50, 800x50
Best regards,
Thomas

img_0086
img_0087
img_0088
img_0089

Add custom coordinates instead of current position

In demo-app new points occur at your current position while tapping on the screen. I can find lines in code responsible for this.
I want to change the current location while tapping for another location and don't understand which variables are responsible for this
Do anybody know how to solve this issue?

Support for Carthage

This project is awesome. My team are trying to integrate it in a currently existing project that manages all its dependencies using Carthage. Is this something you would be interested in? we would be happy to collaborate to add support for Carthage if that's something you are happy with.

Thanks!

CocoaPod is outdated

Last code commit it dated September 6th while ARCL pod last release was made in August. Thus, pod lacks some latest changes, including such useful feature as init(coder) in SceneLocationView.

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.