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

ARKit image detection & Vertical Plane Detection #155

Merged
merged 11 commits into from
Feb 27, 2018
Merged

Conversation

macrozone
Copy link
Collaborator

@macrozone macrozone commented Feb 24, 2018

Image detection

Usage:

<ARKit 
  detectionImages={[{ resourceGroupName: 'DetectionImages' }]}
  onAnchorDetected={onAnchorUpdated}
  onAnchorUpdated={onAnchorUpdated}
  onAnchorRemoved={onAnchorRemoved}
/>

  • detectionImages is an array of objects. Currently only images from assets are possible, but in future, we also want to enable images from filesystem, remote, etc.
  • to add an image to detect to xcode, see https://developer.apple.com/documentation/arkit/arreferenceimage?language=objc
  • see also https://developer.apple.com/documentation/arkit/recognizing_images_in_an_ar_experience?language=objc for best practises
  • onAnchorDetected, onAnchorUpdated and onAnchorRemoved is the more generic version of onPlaneDetected, etc. onAnchorDetected will notfiy about every anchor (plane and image currently).
  • these callbacks passes an object with the same properties as in the onPlane-callbacks (position, positionAbsolute, eulerAngles, id)
  • the object has a new type-property that specifies the type of the anchor (currently plane and image)
  • depending on the type, there are additional properties on the anchor
  • If you specify the onPlane-versions, onAnchor won't notify about planes atm. but i will review this decision. I am unsure whether we should have a onXXXAnchor... for every anchor type or just one generic onAnchor-callback for every anchor type (i favour the later).
  • onPlaneUpdate has been renamed to onPlaneUpdated (more consistent)

Vertical plane detection

Usage:

<ARKit 
  planeDetection={ARKit.ARPlaneDetection.HorizontalVertical}
/>

Will notify about vertical planes as well in onPlaneDetected. You can distinguish with planeAnchor.alignment === ARKit.ARPlaneAnchorAlignment.Vertical

@macrozone macrozone changed the title WIP: ARKit image detection ARKit image detection Feb 27, 2018
@macrozone macrozone changed the title ARKit image detection ARKit image detection & Vertical Plane Detection Feb 27, 2018
@macrozone macrozone merged commit 8d3d965 into master Feb 27, 2018
@elderbas
Copy link

I'm on "react-native-arkit": "0.9.0-beta.3".
Have a fresh create-react-native install, followed the steps for manual install. and trying to get a basic asset showing on the screen

and I'm getting undefined is not an object (evaluating 'ARKitManager.ARPlaneDetection')

image

@macrozone
Copy link
Collaborator Author

@elderbas it's ARKit.ARPlaneDetection. ARKitManager is used internally. Was this mentioned somewhere in the readme? maybe i did a mistake

@elderbas
Copy link

This is the only mention of ARKit.ARPlaneDetection in the docs

image

Also, FYI, if I don't put a value for planeDetection prop, to let it go to default, I still get the same error.

@macrozone
Copy link
Collaborator Author

@elderbas I fixed the typo in the example in the Readme.

I also tried to not give a value for planeDetection and it worked. I am not sure what went wrong, can you try to reproduce it and file an issue?

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

Successfully merging this pull request may close these issues.

2 participants