// Use this for initialization
 void Start()
 {
     newCollisionObjectsMsg = new CollisionObjectsMsg(new List <CollisionPrimitiveMsg>()
     {
     });
     worldAnchor            = GameObject.FindGameObjectWithTag("world_anchor");
     manipulatingWithObject = false;
 }
 public void SetCollisionObjectsMsgFromROS(CollisionObjectsMsg msg)
 {
     //receive only if messages are not the same
     if (!newCollisionObjectsMsg.ToYAMLString().Equals(msg.ToYAMLString()))
     {
         collisionObjectsMsg    = msg;
         newCollisionObjectsMsg = msg;
     }
 }
    // Update is called once per frame
    void Update()
    {
        if (SystemStarter.Instance.calibrated)
        {
            if (!manipulatingWithObject)
            {
                if (collisionObjectsMsg != null)
                {
                    //Debug.Log(collisionObjectsMsg.ToYAMLString());
                    existingPrimitives.Clear();
                    foreach (CollisionPrimitiveMsg primitiveMsg in collisionObjectsMsg.GetPrimitives())
                    {
                        //get all existing primitives names
                        existingPrimitives.Add(primitiveMsg.GetName());

                        UpdatePrimitive(primitiveMsg);
                    }
                    DeleteRemovedPrimitives();
                    collisionObjectsMsg = null;
                }
            }
        }
    }
Beispiel #4
0
    public new static void CallBack(ROSBridgeMsg msg)
    {
        CollisionObjectsMsg Cmsg = (CollisionObjectsMsg)msg;

        CollisionEnvironmentManager.Instance.SetCollisionObjectsMsgFromROS(Cmsg);
    }
Beispiel #5
0
 public static string ToYAMLString(CollisionObjectsMsg msg)
 {
     return(msg.ToYAMLString());
 }