Search Unity

Question Understanding Underlying Data in the Scene

Discussion in 'Unity MARS' started by wickedwaring, Jun 27, 2020.

  1. wickedwaring

    wickedwaring

    Joined:
    Feb 5, 2014
    Posts:
    32
    Hi,

    How do I get more underlying "data" from a Proxy when it matches in my scene.

    For example, things like

    - the size of the plane it has matched
    - the height from the floor
    - the bounding rect etc?

    Thanks for your help.
     
  2. leweyg_unity

    leweyg_unity

    Unity Technologies

    Joined:
    Jan 29, 2020
    Posts:
    38
    "Window / MARS / Developer / Database Viewer" shows the underlying properties associated with each synthetic object.
     
    wickedwaring likes this.
  3. unity_andrewm

    unity_andrewm

    Unity Technologies

    Joined:
    Jun 25, 2015
    Posts:
    73
    wickedwaring likes this.
  4. wickedwaring

    wickedwaring

    Joined:
    Feb 5, 2014
    Posts:
    32
    Thank you, I will take a look at those actions. I had not seen the database viewer yet either :)

    I had gotten as far as:

    Code (CSharp):
    1. public void OnMatchAcquire(QueryResult queryResult)
    2.     {
    3.         Debug.Log($"OnMatchAcquire {queryResult.DataID}");
    4.  
    5.         // get traits?
    6.         // get semantics tags?
    7.  
    8.         //var mrPlane = queryResult.ResolveValue(...
    But I could not find quick examples of how to use the QueryResult (I read the queries section of the docs, but couldn't see anything there) to access traits, semantic tags, plane data etc like is detailed here -

    "In the database, observations about the world are broken down into data, which consists of single variables of any type, and described with a trait, which is a string identifier for the data. Some data and traits are passive (for example, semantic tags, like labeling a plane as a 'wall' or 'floor'). Others are active (for example, the pose of a face is an active trait with a value that is constantly changing)."

    I will dig further into the referenced actions / documentation, as I try to understand this relationship between database > synthetic objects > conditions / relations / actions etc

    It looks like writing a reasoning API to assess my scene is the ultimate end result I need, but will work towards that.

    This is just general feedback as I look at the API / docs in early stages as non expert AR developer.
     
  5. leweyg_unity

    leweyg_unity

    Unity Technologies

    Joined:
    Jan 29, 2020
    Posts:
    38
    If you know the specific trait name and type, you can use:
    queryResult.TryGetTrait("traitName", out TRAIT_TYPE traitValue);

    The "DataID" associated with the result can also be used to manually look in the "Window > MARS > Developer > Database Viewer". Sadly for performance reasons it is not easy to get the list of associated traits, we are working on this.
     
    wickedwaring likes this.