Code Monkey home page Code Monkey logo

Comments (6)

elozada-dev avatar elozada-dev commented on July 17, 2024 4

This is something that we used to be able to do with Tango, by saving and loading area definition files. Is something similar in the roadmap for ARCore? Or is the plan to utilize the (upcoming) Visual Positioning Service instead?

from arcore-unity-sdk.

pablisho avatar pablisho commented on July 17, 2024 1

Hi, Cloud Anchors was released in ARCore SDK for Unity v1.2.0. Although it does not allow long lived anchors (they live up to 24 hours), it may help with some of these session to session use cases.

from arcore-unity-sdk.

chaosemer avatar chaosemer commented on July 17, 2024

There is currently no built in way to persist anchors from session to session. If you want to keep anchors around between sessions, you'll need to add your own localization code and then make sure to properly offset the camera position and the anchors when they get placed in the world.

from arcore-unity-sdk.

winnicki avatar winnicki commented on July 17, 2024

I'm also trying to persist anchors from session to session, but I'm confused over a couple things. So far, I can cache and reload anchors between sessions, but although they retain their relative rotations and distance to each other, they aren't being placed in the same physical location as the previous session. Interestingly, if I fire up a blank session, add some anchors, save them, detach all anchors, and reload them from the cache, they will retain their physical location and rotation, regardless of where the camera is when I load them. Why is that? I thought that I would've had to offset the translation and rotation values of the anchors to account for the new camera position? It seems like I need to persist data from the session object so that it can be restored in the next session.

Based off your comment @chaosemer, I created a PoseSnapshot class with two members: ObjectPosition and CameraPosition. Both hold the Translation and Rotation values at the time the anchor was created through a user tap. These PoseSnapshots is what I'm caching, and then I'm creating Session Anchors from them on load. From reading the docs, my understanding is that the Translation and Rotation values can change drastically as ARCore's understanding of the world improves. Because of this, I'm surprised my objects retain their physical location so well in the same session considering any updates to the coordinates will be lost as the snapshot only holds the ObjectPosition from the time the the user taps Save.

Also can you clarify what you mean by localization code?
Is there an equation you can provide to help me with getting this camera offset correct to persist the physical locations between sessions (if that is in fact what I need to do)

Update: I'm noticing that even during the same session, if the planes I'm tracking get lost and then I load the anchors once they're back, the physical locations aren't perfect. If I get some trackables, place anchors, and move around but still have the same trackables, the anchors are loaded perfectly regardless of camera position.

from arcore-unity-sdk.

kushal98 avatar kushal98 commented on July 17, 2024

can you provide some reference for how can we add localization using arcore?Some code snippet or some way to start with localization?

from arcore-unity-sdk.

chaosemer avatar chaosemer commented on July 17, 2024

Please look at the Cloud Anchors sample in our SDK for examples of how to localize two people to the same space.

from arcore-unity-sdk.

Related Issues (20)

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.