예제 #1
0
        public void Connect(string ip)
        {
            try
            {
                _motion = new MotionProxy(ip, 9559);
                // --------------- prepare limits --------------------------
                // three floats as an ArrayList for each joint in the chain
                // min,max,maxNoLoadSpeedPerCycle
                ArrayList rightArmLimits = (ArrayList)_motion.getLimits("RArm");
                ArrayList RSPitchLimits = (ArrayList)rightArmLimits[0];
                _RSminPitch = (float)RSPitchLimits[0];
                _RSmaxPitch = (float)RSPitchLimits[1];

                ArrayList RSRollLimits = (ArrayList)rightArmLimits[1];
                _RSminRoll = (float)RSRollLimits[0];
                _RSmaxRoll = (float)RSRollLimits[1];

                ArrayList REYawLimits = (ArrayList)rightArmLimits[2];
                _REminYaw = (float)REYawLimits[0];
                _REmaxYaw = (float)REYawLimits[1];

                ArrayList RERollLimits = (ArrayList)rightArmLimits[3];
                _REminRoll = (float)RERollLimits[0];
                _REmaxRoll = (float)RERollLimits[1];

                ArrayList leftArmLimits = (ArrayList)_motion.getLimits("LArm");
                ArrayList LSPitchLimits = (ArrayList)leftArmLimits[0];
                _LSminPitch = (float)LSPitchLimits[0];
                _LSmaxPitch = (float)LSPitchLimits[1];

                ArrayList LSRollLimits = (ArrayList)leftArmLimits[1];
                _LSminRoll = (float)LSRollLimits[0];
                _LSmaxRoll = (float)LSRollLimits[1];

                ArrayList LEYawLimits = (ArrayList)leftArmLimits[2];
                _LEminYaw = (float)LEYawLimits[0];
                _LEmaxYaw = (float)LEYawLimits[1];

                ArrayList LERollLimits = (ArrayList)leftArmLimits[3];
                _LEminRoll = (float)LERollLimits[0];
                _LEmaxRoll = (float)LERollLimits[1];

                // give the joints some stiffness
                _motion.stiffnessInterpolation("RArm", 1.0f, 1.0f);
                _motion.stiffnessInterpolation("LArm", 1.0f, 1.0f);

            }
            catch (Exception e)
            {
                Console.Out.WriteLine("Elbow.Connect exception: " + e);
            }
        }
예제 #2
0
        public void Connect(string ip)
        {
            try
            {
                _motion = new MotionProxy(ip,9559);
                // --------------- prepare limits --------------------------
                // three floats as an ArrayList for each joint in the chain
                // min,max,maxNoLoadSpeedPerCycle
                ArrayList limits = (ArrayList)_motion.getLimits("Head");
                ArrayList yawLimits = (ArrayList)limits[0];
                ArrayList pitchLimits = (ArrayList)limits[1];
                _minYaw = (float)yawLimits[0];
                _maxYaw = (float)yawLimits[1];
                _minPitch = (float)pitchLimits[0];
                _maxPitch = (float)pitchLimits[1];
                Console.WriteLine("MinYaw: " + _minYaw + " MaxYaw:" + _maxYaw + " MinPitch: " + _minPitch + " MaxPitch:" + _maxPitch);
                // give the joints some stiffness
                _motion.stiffnessInterpolation("Head",1.0f,1.0f);

            }
            catch(Exception e)
            {
                Console.Out.WriteLine("HeadPanning.Connect exception: " + e);
            }
        }