Esempio n. 1
0
        /// <summary>
        /// StartDobot
        /// </summary>
        private void StartDobot()
        {
            StringBuilder fwType  = new StringBuilder(60);
            StringBuilder version = new StringBuilder(60);
            int           ret     = DobotDll.ConnectDobot("", 115200, fwType, version);

            // start connect
            if (ret != (int)DobotConnect.DobotConnect_NoError)
            {
                Console.WriteLine("Connect error", Utils.MsgInfoType.Error);
                return;
            }
            Console.WriteLine("Connect success", Utils.MsgInfoType.Info);

            _isConnectted = true;
            DobotDll.SetCmdTimeout(3000);

            // Must set when sensor is not exist
            //DobotDll.ResetPose(true, 45, 45);

            // Get name
            string deviceName = "Dobot Magician";

            DobotDll.SetDeviceName(deviceName);

            StringBuilder deviceSN = new StringBuilder(64);

            DobotDll.GetDeviceName(deviceSN, 64);

            SetParam();
        }
Esempio n. 2
0
        private void StartDobot()
        {
            StringBuilder fwType  = new StringBuilder(60);
            StringBuilder version = new StringBuilder(60);
            int           ret     = DobotDll.ConnectDobot("", 115200, fwType, version);

            // start connect
            if (ret != (int)DobotConnect.DobotConnect_NoError)
            {
                Msg("Connect error", MsgInfoType.Error);
                MessageBox.Show("Connect Error!");
                return;
            }
            Msg("Connect success", MsgInfoType.Info);
            MessageBox.Show("Connect Success!");

            isConnectted = true;
            DobotDll.SetCmdTimeout(3000);

            // Must set when sensor is not exist
            //DobotDll.ResetPose(true, 45, 45);

            // Get name
            string deviceName = "Dobot Magician";

            DobotDll.SetDeviceName(deviceName);

            StringBuilder deviceSN = new StringBuilder(64);

            DobotDll.GetDeviceName(deviceSN, 64);

            StartGetPose();

            //  SetParam();

            //EIOTest();

            //ARCTest();

            //  AlarmTest();
            EndTypeParams e = new EndTypeParams();

            DobotDll.GetEndEffectorParams(ref e);
            MessageBox.Show(e.xBias.ToString() + " " + e.yBias.ToString() + " " + e.zBias.ToString());
        }
Esempio n. 3
0
        /// <summary>
        /// StartDobot
        /// </summary>
        private void StartDobot()
        {
            int ret = DobotDll.ConnectDobot("", 115200);

            // start connect
            if (ret != (int)DobotConnect.DobotConnect_NoError)
            {
                Msg("Connect error", MsgInfoType.Error);
                return;
            }
            Msg("Connect success", MsgInfoType.Info);

            isConnectted = true;
            DobotDll.SetCmdTimeout(3000);

            // Must set when sensor is not exist
            DobotDll.ResetPose(true, 45, 45);

            // Get name
            string deviceName = "Dobot Magician";

            DobotDll.SetDeviceName(deviceName);

            StringBuilder deviceSN = new StringBuilder(64);

            DobotDll.GetDeviceName(deviceSN, 64);

            UInt64         cmdIndex = 0;
            JOGJointParams jsParam;

            jsParam.velocity     = new float[] { 200, 200, 200, 200 };
            jsParam.acceleration = new float[] { 200, 200, 200, 200 };
            DobotDll.SetJOGJointParams(ref jsParam, false, ref cmdIndex);

            JOGCommonParams jdParam;

            jdParam.velocityRatio     = 100;
            jdParam.accelerationRatio = 100;
            DobotDll.SetJOGCommonParams(ref jdParam, false, ref cmdIndex);

            PTPJointParams pbsParam;

            pbsParam.velocity     = new float[] { 200, 200, 200, 200 };
            pbsParam.acceleration = new float[] { 200, 200, 200, 200 };
            DobotDll.SetPTPJointParams(ref pbsParam, false, ref cmdIndex);

            PTPCoordinateParams cpbsParam;

            cpbsParam.xyzVelocity     = 100;
            cpbsParam.xyzAcceleration = 100;
            cpbsParam.rVelocity       = 100;
            cpbsParam.rAcceleration   = 100;
            DobotDll.SetPTPCoordinateParams(ref cpbsParam, false, ref cmdIndex);

            PTPJumpParams pjp;

            pjp.jumpHeight = 20;
            pjp.zLimit     = 100;
            DobotDll.SetPTPJumpParams(ref pjp, false, ref cmdIndex);

            PTPCommonParams pbdParam;

            pbdParam.velocityRatio     = 30;
            pbdParam.accelerationRatio = 30;
            DobotDll.SetPTPCommonParams(ref pbdParam, false, ref cmdIndex);

            //EIO
            IOMultiplexing iom;

            iom.address   = 2;                             //io index
            iom.multiplex = (byte)IOFunction.IOFunctionDO; // ioType
            DobotDll.SetIOMultiplexing(ref iom, false, ref cmdIndex);

            IODO iod;

            iod.address = 2;
            iod.level   = 1; // set io index 2 to open
            DobotDll.SetIODO(ref iod, false, ref cmdIndex);

            // arc
            //ptp((byte)1, 67.99f, 216.4f, -27.99f, 0);
            //arc(154.92f, 182.41f, -62.89f, 0f, 216.07f, 85.54f, -8.34f, 0f);
        }
Esempio n. 4
0
        /// <summary>
        /// StartDobot
        /// </summary>
        private void StartDobot()
        {
            int ret = DobotDll.ConnectDobot("", 115200);

            // start connect
            if (ret != (int)DobotConnect.DobotConnect_NoError)
            {
                Msg("Connect error", MsgInfoType.Error);
                return;
            }
            Msg("Connect success", MsgInfoType.Info);

            isConnectted = true;
            DobotDll.SetCmdTimeout(3000);

            // Must set when sensor is not exist
            DobotDll.ResetPose(true, 45, 45);

            // Get name
            string deviceName = "Dobot Magician";

            DobotDll.SetDeviceName(deviceName);

            StringBuilder deviceSN = new StringBuilder(64);

            DobotDll.GetDeviceName(deviceSN, 64);

            UInt64         cmdIndex = 0;
            JOGJointParams jsParam;

            jsParam.velocity     = new float[] { 200, 200, 200, 200 };
            jsParam.acceleration = new float[] { 200, 200, 200, 200 };
            DobotDll.SetJOGJointParams(ref jsParam, false, ref cmdIndex);

            JOGCommonParams jdParam;

            jdParam.velocityRatio     = 100;
            jdParam.accelerationRatio = 100;
            DobotDll.SetJOGCommonParams(ref jdParam, false, ref cmdIndex);

            PTPJointParams pbsParam;

            pbsParam.velocity     = new float[] { 200, 200, 200, 200 };
            pbsParam.acceleration = new float[] { 200, 200, 200, 200 };
            DobotDll.SetPTPJointParams(ref pbsParam, false, ref cmdIndex);

            PTPCoordinateParams cpbsParam;

            cpbsParam.xyzVelocity     = 100;
            cpbsParam.xyzAcceleration = 100;
            cpbsParam.rVelocity       = 100;
            cpbsParam.rAcceleration   = 100;
            DobotDll.SetPTPCoordinateParams(ref cpbsParam, false, ref cmdIndex);

            PTPJumpParams pjp;

            pjp.jumpHeight = 20;
            pjp.zLimit     = 100;
            DobotDll.SetPTPJumpParams(ref pjp, false, ref cmdIndex);

            PTPCommonParams pbdParam;

            pbdParam.velocityRatio     = 30;
            pbdParam.accelerationRatio = 30;
            DobotDll.SetPTPCommonParams(ref pbdParam, false, ref cmdIndex);
        }