public void Start() { rosSocket = transform.GetComponent <RosConnector>().RosSocket; rosSocket.Subscribe("/odom", "nav_msgs/Odometry", updateOdometry, UpdateTime); odometryTransformManager = UrdfModel.GetComponent <OdometryTransformManager>(); }
//private static string OdometryObjectName = "base_footprint"; public void patch() { OdometryTransformManager odometryTransformApplyer = UrdfModel.GetComponent <OdometryTransformManager>(); if (odometryTransformApplyer != null) { DestroyImmediate(odometryTransformApplyer); } UrdfModel.AddComponent <OdometryTransformManager>(); }
public static void patch(GameObject UrdfModel) { GameObject gameObject = UrdfModel.transform.Find(OdometryObjectName).gameObject; OdometryTransformManager odometryTransformApplyer = gameObject.GetComponent <OdometryTransformManager>(); if (odometryTransformApplyer != null) { Object.DestroyImmediate(odometryTransformApplyer); } gameObject.AddComponent <OdometryTransformManager>(); }