void Start() { //define objects Ball = gameObject.transform.Find("Ball 1"); Cursor = gameObject.transform.Find("Cursor"); Grip_pos = gameObject.transform.Find("Grip_pos"); Destination = gameObject.transform.Find("Destination"); Point1 = gameObject.transform.Find("Position reference/Point1"); Point2 = gameObject.transform.Find("Position reference/Point2"); Point3 = gameObject.transform.Find("Position reference/Point3"); Segment_1 = gameObject.transform.Find("Segment 1"); Segment_2 = gameObject.transform.Find("Segment 1/Segment 2"); Segment_3 = gameObject.transform.Find("Segment 1/Segment 2/Segment 3"); Segment_4 = gameObject.transform.Find("Segment 1/Segment 2/Segment 3/Segment 4"); Hinge_1 = gameObject.transform.Find("Segment 1/Hinge 1"); Hinge_2 = gameObject.transform.Find("Segment 1/Segment 2/Hinge 2"); Hinge_3 = gameObject.transform.Find("Segment 1/Segment 2/Segment 3/Hinge 3"); Hinge_4 = gameObject.transform.Find("Segment 1/Segment 2/Segment 3/Segment 4/Hinge 4"); Grip_L = gameObject.transform.Find("Segment 1/Segment 2/Segment 3/Segment 4/L2_grip_L"); Grip_R = gameObject.transform.Find("Segment 1/Segment 2/Segment 3/Segment 4/L2_grip_R"); //scaling //epsilon = 0.000001f * transform.localScale.x; int_speed = 0.1f; int_speed = int_speed * transform.localScale.x;//scale speed with robot size //calculate parameters l1 = Point2.position.y - Point1.position.y; //calcuate the arm length l2 = Point3.position.y - Point2.position.y; //calcuate the arm length r_bound = l1 + l2; //calculate max reach and set boundary value //set initial condition pickup = 0; forward = 0; //start with the first trajectory attached = 0; //ball is not picked up by robot end effector; at_dest = 0; speed = int_speed; //starting speed activate = 0; grid = GameObject.Find("8x8 Grid Step").gameObject.GetComponent <GridNavigationController>(); //move robot to the starting position Grip_pos.position = Destination.position;; //start from bin move_robot(); }
// Controller References (Implementation Specific) // Modify parts of the controller script on those objects // start from Unity3d public void Start() { init(); grid = GameObject.Find("8x8 Grid Step").gameObject.GetComponent <GridNavigationController>(); timingBar = GameObject.Find("Timing Bar").gameObject.GetComponent <TimingBarController>(); }