public void Publish(String _topic, ROSBridgeMsg _msg)
 {
     if (ros._connected)
     {
         ros.Publish(_topic, _msg);
     }
 }
Exemple #2
0
        public new static void CallBack(ROSBridgeMsg msg, string ip)
        {
            var robots = Object.FindObjectsOfType <ROS>();

            foreach (ROS r in robots)
            {
                if (r.ip == ip)
                {
                    r.UnSubcribe(typeof(Client_Count_sub));
                    return;
                }
            }
        }
        public new static void CallBack(ROSBridgeMsg msg, string host)
        {
            var robot = GameObject.FindGameObjectWithTag("Robot");

            if (robot != null)
            {
                PoseWithCovarianceStampedMsg _transforms = (PoseWithCovarianceStampedMsg)msg;
                Vector3    position = _transforms.GetPose().GetPose().GetPositionUnity();
                Quaternion rotation = _transforms.GetPose().GetPose().GetRotationUnity();
                robot.transform.SetPositionAndRotation(position, rotation);
            }
            else
            {
                Debug.LogWarning("Can not find a gameobject with the tag Robot");
            }
        }
 public new static void CallBack(ROSBridgeMsg msg, string ip)
 {
     Object.FindObjectOfType <TFSystem>().NewTf((TFMsg)msg, ip);
 }
 public new static void CallBack(ROSBridgeMsg msg, string host)
 {
     Object.FindObjectOfType <TerrainConstructor>().NewOcupanceGridMsg((OccupancyGridMsg)msg);
 }
 public new static void CallBack(ROSBridgeMsg msg, string ip)
 {
     Object.FindObjectOfType <VirtualObjectSystem>().DetectedObject((DetectionArrayMsg)msg, ip);
 }