/// <summary>
        /// Imports URDF based on a given filename. Filename has to contain a full path.
        /// </summary>
        /// <param name="filename"></param>
        private void ImportUrdfObject(string filename)
        {
            UrdfRobot = UrdfRobotExtensionsRuntime.Create(filename, useUrdfMaterials: false);
            UrdfRobot.transform.parent           = transform;
            UrdfRobot.transform.localPosition    = Vector3.zero;
            UrdfRobot.transform.localEulerAngles = Vector3.zero;

            UrdfRobot.SetRigidbodiesIsKinematic(true);

            RobotModel = UrdfRobot.gameObject;

            LoadLinks();

            Debug.Log("URDF: robot created (without models yet)");
        }
Example #2
0
    /// <summary>
    /// Imports URDF based on a given filename. Filename has to contain a full path.
    /// <param name="filename">Filename including path to the urdf file.</param>
    /// <param name="robotType">Type of the robot.</param>
    /// </summary>
    private void ImportUrdfObject(string filename, string robotType)
    {
        UrdfRobot urdfRobot = UrdfRobotExtensionsRuntime.Create(filename, useColliderInVisuals: true, useUrdfMaterials: true);

        urdfRobot.transform.parent           = transform;
        urdfRobot.transform.localPosition    = Vector3.zero;
        urdfRobot.transform.localEulerAngles = Vector3.zero;

        urdfRobot.SetRigidbodiesIsKinematic(true);

        RobotModel robot = new RobotModel(robotType, urdfRobot.gameObject);

        robot.LoadLinks();

        RobotModels[robotType].Add(robot);

        //Debug.Log("URDF: robot created (without models yet)");
    }