Exemple #1
0
    //float getCurrentPosition()
    //{

    //    return leftPoseManager.CurHandRotationNormalized.Index.Bend.Value;
    //}
    //void ConstantForce()
    //{
    //    float[] stiffnessArray = new float[5];
    //    stiffnessArray[1] = Stiffness;
    //    float[] PositionSetPointArray = new float[5];
    //    float currentFingerPosition = getCurrentPosition();
    //    if (currentFingerPosition < offset)
    //    {
    //        PositionSetPointArray[1] = 0;
    //    }
    //    else
    //    {
    //        PositionSetPointArray[1] = currentFingerPosition - offset;
    //    }
    //    bool[] InwardControlArray = new bool[5];
    //    InwardControlArray[1] = InwardControl;
    //    ClientController.ImpedanceControlFingers(AssignedID, targets, stiffnessArray, PositionSetPointArray, InwardControlArray);
    //    isImpeding = true;

    //}
    // Update is called once per frame
    void Update()
    {
        KeyboardControll();
        if (Input.GetKeyDown(KeyCode.S))
        {
            Debug.Log("stop all force feedback");
            ClientController.StopImpedanceControlFingersAll(AssignedID);
            isImpeding = constantForceApply = false;
        }
    }
    IEnumerator WaitAndReleaseForceFeedBack(float waitTime)
    {
        yield return(new WaitForSeconds(waitTime));

        ClientController.StopImpedanceControlFingersAll(1);
    }