Search Unity

Question Proxy Objects moving around

Discussion in 'Unity MARS' started by Blinxel_AR, Dec 22, 2020.

  1. Blinxel_AR

    Blinxel_AR

    Joined:
    Jan 26, 2015
    Posts:
    67
    Hi,
    I was wondering if there was a way to make a proxy object stop moving about after it's been placed.
    It seems that each object appears in a place, then moves about as the system discovers more suitable terrain to stretch out into.
    What I'm hoping for is that once placed, the object will just stay where it appears, even as the surface detection continues doing its thing.
     
  2. Blinxel_AR

    Blinxel_AR

    Joined:
    Jan 26, 2015
    Posts:
    67
    I tried turning off "Follow Match Updates" in the hope that it might stop bouncing about.
    It seems to make the tracking more stable as the device tours the environment, but the objects appear and vanish and teleport around the space.
     
  3. mtschoen

    mtschoen

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    194
    Hi there! The behavior you are seeing is somewhat by design. MARS tries to continuously update your proxy matches based on the conditions you have defined, and find you a better match as new data comes in. There are a couple of approaches for controlling this behavior.

    • Use synthetic data
      • If you instantiate a new Synthetic Object with a Synthesized Tag and a Synthesized Pose, you can create a Proxy to match that tag, and then you have control over the location and lifecycle of that synthetic data. In this case, you'd have a proxy or replicator matching the planes you are looking for, with a script on it to instantiate the synthetic object (from a prefab or using AddComponent) on match. Then you'd have a second proxy with a semantic tag condition looking to match the tag of the Synthetic object.
    • Stop plane finding
      • If you get to a "good" point where all your proxies match, or determined by user input (a "done scanning" button or something), you can just stop updating planes. `IUsesPlaneFinding` exposes a `StopDetectingPlanes` method that you can use for this.
    • Set the evaluation mode to `WaitForRequest`
      • You can implement the `IUsesMarsSceneEvaluation` interface to get access to `SetEvaluationMode` and set it to `WaitForRequest`. In this mode, MARS will only update queries (and therefore proxy locations) when you call `RequestSceneEvaluation`.
    • Pause MARS
      • This will temporarily halt the MARS solver and other MARS behaviors like plane and point cloud visualizers while still allowing AR subsystems to function. Simply set `MARSCore.instance.paused` to true.
    Hope this helps!
     
    Gareth-Tech likes this.
  4. Blinxel_AR

    Blinxel_AR

    Joined:
    Jan 26, 2015
    Posts:
    67
    I'm getting a LOT of objects appearing in one place only to teleport to somewhere completely different. This is not just shifting a little as the table's surface gets fully detected. It's complete photonic reversal. The object will be in view for a split second, or a few seconds, then vanish and be elsewhere in the environment.

    And this happens again and again... It seems to calm down a little once I've scanned enough of the space, but it's really not a very desirable behavior.

    I really just want an object to find a spot and stay there.

    Here's a video of what happens.
     
    Last edited: Dec 24, 2020
  5. mtschoen

    mtschoen

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    194
    Can you share your project/scene? This does sound like the expected behavior: MARS evaluates the best match for all of your proxies on a fixed interval. The bit about a lot of objects in one place seems wrong, but it may just be a matter of choosing `Reserved` data exclusivity for one or more of these proxies.. It would help for us to see exactly how you have things set up so that we can recommend a fix.

    Also, it does sound like what you want is the `WaitForRequest` evaluation mode. That way you can have your app wait until scanning is complete, and then request an evaluation for all of the content to lay itself out one time. Something else you can try is to use the Compare Tool to figure out why your proxies are matching to one surface vs. another.
     
  6. Blinxel_AR

    Blinxel_AR

    Joined:
    Jan 26, 2015
    Posts:
    67
    I can't share the proj / scene, but I can share a screenshot. It's really simple.
     
  7. Pilltech101

    Pilltech101

    Joined:
    Jul 25, 2014
    Posts:
    35
    Did you ever fix this ?