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()); }
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); }
protected void Awake() { isFirstChild = SDF2Unity.IsRootModel(this.gameObject); poseControl = new PoseControl(this.transform); Reset(); }
void Awake() { tag = "Model"; isTopModel = SDF2Unity.CheckTopModel(transform); poseControl.SetTransform(transform); }