Пример #1
0
    // public float dtheta_dt0,dtheta_dt1;

    // Start is called before the first frame update

    void Start()
    {
        scale_fact = 0.5f;
        // Robot1=new DeltaRobot(scale_fact*4.773502f,scale_fact*10f,scale_fact*21.96040974f,scale_fact*3.58013f);
        Robot1 = new DeltaRobot(2f, 5f, 9f, 1f);
        Robot1.assign_end_point_pisition(scale_fact * new Vector3(0, -24f, 0));
        time = 0f;
        //inv_jaco= Robot1.differential_inverse_kinematics(end_point);
        Robot1.dtheta_dt_l = new float[] { 0, 0, 0 };

        // float[] joint_angle_l= {(Mathf.PI)/3f,(Mathf.PI)/4f,(Mathf.PI)/5f} ;
        // Vector3[] frwd_jaco=Robot1.differential_forward_kinematics(joint_angle_l,true);
    }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        // Vector3 dy_dt_to_assign=new Vector3((float) Mathf.Cos(time)*0.3f,(float) Mathf.Cos(time*0.6f)*(-0.25f),(float) Mathf.Cos(time*1.2f)*0.35f);
        // Vector3 dy_dt_to_assign=new Vector3(0,0,(float) Mathf.Cos(time*0.6f)*(-0.45f));
        Vector3 dy_dt_to_assign = scale_fact * new Vector3(0, (float)-1f * Mathf.Cos(time * 0.6f) * (-0.25f), (float)Mathf.Sin(time * 0.6f) * (-0.25f));

        Robot1.assign_end_point_velocity(dy_dt_to_assign);
        // Debug.Log(Robot1.end_point);
        // Debug.Log(Robot1.dy_dt);
        Robot1.assign_end_point_pisition(Robot1.end_point + dy_dt_to_assign);

        theta_l     = Robot1.inverse_kinematics();
        dtheta_dt_l = Robot1.inverse_kinematics_velocity();
        // dtheta_dt0=dtheta_dt_l[0];dtheta_dt1=dtheta_dt_l[1];
        //  Debug.Log(dtheta_dt_l);
        // for (int i = 0; i < 3; i++){
        //     Debug.Log(dtheta_dt_l[i]);
        //     }
        Robot1.update_framework();
        time += Mathf.PI * 0.05f;
    }