Exemplo 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();
        }
        /// <summary>
        /// StartDobot
        /// </summary>
        private void StartDobot()
        {
            int ret;

            // start connect
            if ((ret = DobotDll.ConnectDobot()) >= (int)DobotResult.DobotResult_Error_Min)
            {
                Msg("Connect error ,code:" + ret.ToString(), MsgInfoType.Error);
                return;
            }

            isConnectted = true;
            // reset and start
            //DobotDll.ResetDobot();
            DobotDll.SetCmdTimeout(500);
            DobotDll.SetEndType(EndType.EndTypePump);

            // Must set when sensor is not exist
            InitialPose initialPose;

            initialPose.joint2Angle = 45;
            initialPose.joint3Angle = 45;
            DobotDll.SetInitialPose(ref initialPose);


            JogStaticParams jsParam;

            jsParam.jointMaxVelocity      = 15;
            jsParam.jointMaxAcceleration  = 50;
            jsParam.servoMaxVelocity      = 30;
            jsParam.servoMaxAcceleration  = 10;
            jsParam.linearMaxVelocity     = 40;
            jsParam.linearMaxAcceleration = 40;
            DobotDll.SetJogStaticParams(ref jsParam);

            JogDynamicParams jdParam;

            jdParam.velocityRatio = 30;
            DobotDll.SetJogDynamicParams(ref jdParam);

            PlaybackStaticParams pbsParam;

            pbsParam.jointMaxVelocity      = 200;
            pbsParam.jointMaxAcceleration  = 200;
            pbsParam.servoMaxVelocity      = 200;
            pbsParam.servoMaxAcceleration  = 200;
            pbsParam.linearMaxVelocity     = 800;
            pbsParam.linearMaxAcceleration = 1000;
            pbsParam.pauseTime             = 100;
            pbsParam.jumpHeight            = 20;
            DobotDll.SetPlaybackStaticParams(ref pbsParam);

            PlaybackDynamicParams pbdParam;

            pbdParam.velocityRatio     = 30;
            pbdParam.accelerationRatio = 30;
            DobotDll.SetPlaybackDynamicParams(ref pbdParam);
        }
Exemplo n.º 3
0
        /// <summary>
        /// StartDobot
        /// </summary>
        private void StartDobot()
        {
            int ret = DobotDll.ConnectDobot("", 115200);

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

            isConnectted = true;
            DobotDll.SetCmdTimeout(3000);

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


            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);
        }
Exemplo n.º 4
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());
        }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
0
        private void StartDobot()
        {
            //ret ist eine normale Zahl, die einen Fehlercode repräsentiert
            int ret;

            //Überprüft ob eine Verbindung zum Roboter gefunden wurde.Wenn nicht, wird die Form sofort geschlossen und es erscheint eine Benachrichtigung
            if ((ret = DobotDll.ConnectDobot()) >= (int)DobotResult.DobotResult_Error_Min)
            {
                MessageBox.Show("Kein Roboter gefunden");
                this.Close();
                return;
            }

            //Ist eine Verbindung vorhanden wird die Form aufgerufen und der Status isconnectted auf true gesetzt
            else
            {
                this.Show();
                isConnectted = true;
            }



            //Time-out für die comands
            DobotDll.SetCmdTimeout(500);


            //Gibt die Stellung in Winkelpositionen zwischen "Oberarm" und "Unterarm" an, die max. angefahren werden kann
            InitialPose initialPose;

            initialPose.joint2Angle = 45;
            initialPose.joint3Angle = 45;
            DobotDll.SetInitialPose(ref initialPose);

            //Statische Paramter die Beschleunigung und Geschwidigkeit der Joints, der Servormotoren und des liniearen Abfahrens angeben, gilt für die Jogs (Anfahren über Winkelpositionen)
            JogStaticParams jsParam;

            jsParam.jointMaxVelocity      = 15;
            jsParam.jointMaxAcceleration  = 50;
            jsParam.servoMaxVelocity      = 30;
            jsParam.servoMaxAcceleration  = 10;
            jsParam.linearMaxVelocity     = 40;
            jsParam.linearMaxAcceleration = 40;
            DobotDll.SetJogStaticParams(ref jsParam);

            //Dynamischer Parameter, der die Beschleunigung angibt
            JogDynamicParams jdParam;

            jdParam.velocityRatio = 30;
            DobotDll.SetJogDynamicParams(ref jdParam);

            //Statische Paramter die Beschleunigung und Geschwidigkeit der Joints, der Servormotoren und des liniearen Abfahrens angeben, gilt für die Playbackcomands (Anfahren über Koordinaten)
            PlaybackStaticParams pbsParam;

            pbsParam.jointMaxVelocity      = 100;
            pbsParam.jointMaxAcceleration  = 100;
            pbsParam.servoMaxVelocity      = 100;
            pbsParam.servoMaxAcceleration  = 100;
            pbsParam.linearMaxVelocity     = 100;
            pbsParam.linearMaxAcceleration = 100;
            pbsParam.pauseTime             = 100;
            pbsParam.jumpHeight            = 20;
            DobotDll.SetPlaybackStaticParams(ref pbsParam);

            //Dynamischer Parameter, der die Beschleunigung und die Geschwindigkeit angibt
            PlaybackDynamicParams pbdParam;

            pbdParam.velocityRatio     = 30;
            pbdParam.accelerationRatio = 30;
            DobotDll.SetPlaybackDynamicParams(ref pbdParam);

            //Funktion zum Umrechnen der aufgenommenen Koordinaten
            Koordinaten_umrechnen();
        }