예제 #1
0
    private void LoadTF()
    {
        var tfLog = new StringBuilder();

        tfLog.AppendLine("Loaded TF Info : " + modelName);
        var linkHelpers = GetComponentsInChildren <SDF.Helper.Link>();

        if (GetPluginParameters().GetValues <string>("ros2/transforms/link", out var links))
        {
            foreach (var link in links)
            {
                var parentFrameId = GetPluginParameters().GetAttributeInPath <string>("ros2/transforms/link[text()='" + link + "']", "parent_frame_id", "base_link");

                (var modelName, var linkName) = SDF2Unity.GetModelLinkName(link);

                foreach (var linkHelper in linkHelpers)
                {
                    if ((string.IsNullOrEmpty(modelName) || (!string.IsNullOrEmpty(modelName) && linkHelper.Model.name.Equals(modelName))) &&
                        linkHelper.name.Equals(linkName))
                    {
                        var tf = new TF(linkHelper, link, parentFrameId);
                        tfList.Add(tf);
                        tfLog.AppendLine(modelName + "::" + linkName + " : TF added");
                        break;
                    }
                }
            }
        }

        Debug.Log(tfLog.ToString());
    }
예제 #2
0
    protected override void GenerateMessage()
    {
        try
        {
            micomWritingData = GetMessageData <messages.Twist>();
        }
        catch
        {
            Debug.LogWarning("GetMessageData: ERROR");
        }

        // Right-handed -> Left-handed direction of rotation
        linearVelocity  = -SDF2Unity.GetPosition(micomWritingData.Linear.X, micomWritingData.Linear.Y, micomWritingData.Linear.Z);
        angularVelocity = -SDF2Unity.GetPosition(micomWritingData.Angular.X, micomWritingData.Angular.Y, micomWritingData.Angular.Z);
    }
예제 #3
0
파일: Base.cs 프로젝트: lge-ros2/cloisim
 protected void Awake()
 {
     isFirstChild = SDF2Unity.IsRootModel(this.gameObject);
     poseControl  = new PoseControl(this.transform);
     Reset();
 }
예제 #4
0
 void Awake()
 {
     tag        = "Model";
     isTopModel = SDF2Unity.CheckTopModel(transform);
     poseControl.SetTransform(transform);
 }