public static void Create() { CreateTag(); GameObject robotGameObject = new GameObject("Robot"); SetTag(robotGameObject); robotGameObject.AddComponent <UrdfRobot>(); robotGameObject.AddComponent <Unity.Robotics.UrdfImporter.Control.Controller>(); UrdfPlugins.Create(robotGameObject.transform); UrdfLink urdfLink = UrdfLinkExtensions.Create(robotGameObject.transform).GetComponent <UrdfLink>(); urdfLink.name = "base_link"; urdfLink.IsBaseLink = true; }
// Creates the robot game object. private static void ImportPipelineCreateObject(ImportPipelineData im) { im.robotGameObject = new GameObject(im.robot.name); importsettings = im.settings; im.settings.totalLinks = im.robot.links.Count; CreateTag(); SetTag(im.robotGameObject); im.robotGameObject.AddComponent <UrdfRobot>(); im.robotGameObject.AddComponent <Unity.Robotics.UrdfImporter.Control.Controller>(); if (RuntimeUrdf.IsRuntimeMode()) {// In runtime mode, we have to disable controller while robot is being constructed. im.robotGameObject.GetComponent <Unity.Robotics.UrdfImporter.Control.Controller>().enabled = false; } im.robotGameObject.GetComponent <UrdfRobot>().SetAxis(im.settings.choosenAxis); UrdfAssetPathHandler.SetPackageRoot(Path.GetDirectoryName(im.robot.filename)); UrdfMaterial.InitializeRobotMaterials(im.robot); UrdfPlugins.Create(im.robotGameObject.transform, im.robot.plugins); }