/// <summary> /// Imports the URDF Model initially to download all textures, assets and store them correctly etc. /// </summary> /// <param name="robot"></param> private void ImportInitialUrdfModel(string urdf, Robot robot) { hasUrdfAssetsImported = false; var protocol = RosConnector.Protocols.WebSocketNET; RosSharp.RosBridgeClient.TransferFromRosHandler handler = new RosSharp.RosBridgeClient.TransferFromRosHandler(); string assetPath = Path.Combine(Path.GetFullPath("."), "Assets", "Urdf", "Models", robot.name); assetsRootDirectoryName = handler.ImportAssetsFromUrdf(protocol, this.RobotName, @"ws://*****:*****@"/joint_states"; jointStateSubscriber.JointStateWriters = new List <JointStateWriter>(); jointStateSubscriber.JointNames = new List <string>(); foreach (UrdfJoint urdfJoint in RobotRootObject.GetComponentsInChildren <UrdfJoint>()) { if (urdfJoint.JointType != UrdfJoint.JointTypes.Fixed) { urdfJoint.gameObject.AddComponentIfNotExists <JointStateWriter>(out var writer); jointStateSubscriber.JointStateWriters.Add(writer); jointStateSubscriber.JointNames.Add(urdfJoint.JointName); } } if (SceneContainerGameObject != null) { RobotRootObject.transform.SetParent(SceneContainerGameObject.transform); } hasUrdfAssetsImported = true; }