public void SetRoom(SemanticRoom room) { if (room != null && this.Room == null) { this.Room = room; OntologySystem.instance.ObjectInRoom(Id, room.id); } }
//private void FindRobot() //{ // ros = FindObjectOfType<ROS>(); // if (ros != null) // { // robot = ros.transform; // if (sendResultsToROS) // { // ros.RegisterPubPackage("RoomScores_pub"); // ros.RegisterPubPackage("ObjectsInRoom_pub"); // } // } //} public SemanticRoom GetCurrentRoom() { RaycastHit hit; Vector3 position = robot.position; position.y = -100; if (Physics.Raycast(position, robot.TransformDirection(Vector3.up), out hit)) { SemanticRoom room = hit.transform.GetComponent <SemanticRoom>(); if (room != null) { currentRoom = room.id; return(room); } else { currentRoom = "Unknown"; } } return(null); }