public void ParseSharedMemory(TelesarVSharedMemory sh, bool RealtimeData) { for (int i = 0; i < Joints.Length; ++i) { if (type == HandType.Left) { Joints [i].SetValue(Mathf.Rad2Deg * sh.data.joints.kin_hand.left [HandMapping [i]], Mathf.Rad2Deg * sh.data.joints.rt_hand.left [HandMapping [i]]); } else { Joints [i].SetValue(Mathf.Rad2Deg * sh.data.joints.kin_hand.right [HandMapping [i]], Mathf.Rad2Deg * sh.data.joints.rt_hand.right [HandMapping [i]]); } } }
public void ParseSharedMemory(TelesarVSharedMemory sh, bool RealtimeData) { Hand.ParseSharedMemory(sh, RealtimeData); for (int i = 0; i < Joints.Length; ++i) { if (type == ArmType.Left) { Joints [i].SetValue(Mathf.Rad2Deg * sh.data.joints.kin_arm.left [i], Mathf.Rad2Deg * sh.data.joints.rt_arm.left [i]); } else { Joints [i].SetValue(Mathf.Rad2Deg * sh.data.joints.kin_arm.right [i], Mathf.Rad2Deg * sh.data.joints.rt_arm.right [i]); } } }
// Use this for initialization void Start() { _sharedMemory = new TelesarVSharedMemory(); string prefix = "Body_J"; Joints = new Simulator.IRobotJoint[9]; for (int i = 0; i < Joints.Length; ++i) { Transform t = transform.FindChildRecursive(prefix + (i + 1).ToString()); //transform.FindChild(prefix + (i+1).ToString ()); if (t != null) { Joints [i] = t.GetComponent <Simulator.IRobotJoint>(); } } }