Example #1
0
        public void RotateLegs(double[] thetas, Boolean areDegrees)
        {
            double angle1_d, angle2_d, angle3_d;

            if (areDegrees == false)
            {
                angle1_d = serviceConverter.ConvertRadiansToDegrees(thetas[0]);
                angle2_d = serviceConverter.ConvertRadiansToDegrees(thetas[1]);
                angle3_d = serviceConverter.ConvertRadiansToDegrees(thetas[2]);
            }
            else
            {
                angle1_d = thetas[0];
                angle2_d = thetas[1];
                angle3_d = thetas[2];
            }

            float angle1 = serviceConverter.ConvertDoubleToFloat(angle1_d);
            float angle2 = serviceConverter.ConvertDoubleToFloat(angle2_d);
            float angle3 = serviceConverter.ConvertDoubleToFloat(angle3_d);

            topLPivots[0].rotation = Quaternion.Euler(new Vector3(-angle1, topLPivots[0].eulerAngles.y, topLPivots[0].eulerAngles.z));
            topLPivots[1].rotation = Quaternion.Euler(new Vector3(-angle2, topLPivots[1].eulerAngles.y, topLPivots[1].eulerAngles.z));
            topLPivots[2].rotation = Quaternion.Euler(new Vector3(-angle3, topLPivots[2].eulerAngles.y, topLPivots[2].eulerAngles.z));
        }
Example #2
0
        public void InitSliderValuesFK()
        {
            for (int i = 0; i < DeltaRobotFKUtils.NO_OF_LEGS; i++)
            {
                sliders[i].minValue = DeltaRobotFKUtils.SLIDER_MIN_VALUE;
                sliders[i].maxValue = DeltaRobotFKUtils.SLIDER_MAX_VALUE;
            }
            sliders[0].value = serviceConverter.ConvertDoubleToFloat(DeltaRobotFKUtils.VALUE_THETA_1);
            sliders[1].value = serviceConverter.ConvertDoubleToFloat(DeltaRobotFKUtils.VALUE_THETA_2);
            sliders[2].value = serviceConverter.ConvertDoubleToFloat(DeltaRobotFKUtils.VALUE_THETA_3);

            /*sliders[0].value = serviceConverter.ConvertDoubleToFloat(thetas[0]);
            *  sliders[1].value = serviceConverter.ConvertDoubleToFloat(thetas[1]);
            *  sliders[2].value = serviceConverter.ConvertDoubleToFloat(thetas[2]);*/
        }
Example #3
0
        private void InvisibleSpheresSameHeight(Vector3[] centresSpheres, double[] thetas)
        {
            InitSingularityVariables(centresSpheres, thetas);

            double[] coefs = new double[3] {
                C, B, A
            };
            System.Numerics.Complex[] roots = FindRoots.Polynomial(coefs);
            for (int i = 0; i < roots.Length; i++)
            {
                if (roots[i].Imaginary == 0 && roots[i].Real < 0)
                {
                    endEffectorPosition = new Vector3(serviceConverter.ConvertDoubleToFloat(x_), serviceConverter.ConvertDoubleToFloat(roots[i].Real),
                                                      serviceConverter.ConvertDoubleToFloat(y_));
                }
            }
        }
Example #4
0
        private void SetCircleCenter1(double radian1)
        {
            float x = 0.0f;
            float y = serviceConverter.ConvertDoubleToFloat(-W_B - L * Math.Cos(radian1) + U_P);
            float z = serviceConverter.ConvertDoubleToFloat(-L * Math.Sin(radian1));

            SetCentreOfSpecificCircle(0, x, y, z);
        }