Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent LocationNode position #27

Closed
fleuverouge opened this issue Aug 21, 2017 · 10 comments
Closed

Inconsistent LocationNode position #27

fleuverouge opened this issue Aug 21, 2017 · 10 comments

Comments

@fleuverouge
Copy link

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.

@simoneconnola
Copy link

I'm having the same problem! Maybe we're doing something wrong? I'm using the current location's coordinates and altitude to add a new LocationAnnotationNode, but it moves around with me when I get up and walk about…
My code is basically the same as fleuverouge

@AndrewHartAR
Copy link
Owner

Thanks for reporting this. What happens if you move a fair distance away from it? Does it continue to follow you? If so, could you perhaps provide a video of this occurring? You can use Streamable, or Vid.me, or a dropbox link etc.

On the altitude issue, it's possible that the CoreLocation location is updating and your own altitude is moving lower, thus the object appears to move further up.

@AbrahamArun
Copy link

I've noticed the same

@spinach
Copy link

spinach commented Sep 11, 2017

Same here

@jdleo
Copy link

jdleo commented Sep 18, 2017

Also having this issue. Specifically the issue with the image following me as I get up and walk around as @simoneconnola mentioned !

@francisjervis
Copy link

francisjervis commented Sep 18, 2017

I think this is why I am seeing this behavior (expected, not surprisingly, is that each plane should be in front of the corresponding address):
img_0627
Edit: added images which show the "following" effect more clearly.
img_0630
img_0628

It looks like the planes are in the right position relative to each other (check the house numbers), but they seem to be laid out in too small an area, and that space seems to be defined relative to the user.

Note that 1: I am using CLLocation only, as my code crashes if this is not set to true, and 2: I cannot enable showFeaturePoints as I get an "internal" protection level error.

Attempted to record a video using SceneKitVideoRecorder, but encountered a bug (which may be due to how ARCL is handling color spaces):
svhawks/SceneKitVideoRecorder#12

@jagatfx
Copy link

jagatfx commented Sep 19, 2017

maybe helpful in capturing recordings: iOS 11 supports screen recording native https://www.cnet.com/how-to/how-to-use-ios-11-built-in-screen-recording-feature/

@MattSich
Copy link

The problem here is that at best the device GPS will be off by 2-8m. That's with the best conditions. So if you're in a building, it's even worse.
The bigger problem is altitude - it's +/- 30m
The solution to the jumpiness is to stop updating location after you're pretty sure you have the users location and then as the user to find the horizontal plane. At that point you can actually just keep coreLocation off.
Maybe we'll add something that will allow switching between modes. Right now it's more suited for distant markers so the jumpiness isn't as big of an issue as the true north issues is.

@xaphod
Copy link

xaphod commented Nov 1, 2017

Hi @MattSich I don't understand why CoreLocation should need to be turned off, please can you explain? Like others, i'm seeing that a LocationNode "moves with me". Ie. walking towards it "pushes it away", walking backwards "pulls it towards me".

Here is what I want to achieve, broken down in parts - perhaps this isn't supposed to be possible with this lib? The user is expected to be outside with good GPS/signal.

  1. As the user moves, the app knows user's lat/lon and uses this to get data from server; the data describes addresses near to the user's location
  2. As a user nears an address->lat/lon known by the server, the app displays the information "on" or "at" the building in question
  3. As the user moves in relation to the building, the displayed information appears to "stay still", meaning that in the camera/video feed, it appears to not move in relation to the address it describes.

The problem is with #3 at the moment; although nodes are made with static lat/lon, they move as the user moves. This is true even if CoreLocation already has a super accurate understanding of your location, and isn't changing it erroneously

@intere
Copy link
Collaborator

intere commented May 17, 2019

Closing this issue - it's old and stale.

@intere intere closed this as completed May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests