Example #1
0
        static void Main(string[] args)
        {
            KukaRsi.MessageSerialization <AgilusMessageToRobot, AgilusMessageFromRobot> ms = new KukaRsi.MessageSerialization <AgilusMessageToRobot, AgilusMessageFromRobot>();
            AgilusMessageToRobot msg = new AgilusMessageToRobot();


            String s = ms.Serialize(msg);


            double velocity     = 100;
            double acceleration = 100;
            //AxisPosition target = new AxisPosition(0, -50, 90, 0, 90, 0);
            TcpCoordinate tcpTarget1 = new TcpCoordinate(445, 0, 900, -180, 0, -180);
            TcpCoordinate tcpTarget2 = new TcpCoordinate(445, 0, 800, -180, 0, -180);

/*            msg.DoubleParameters.Values[0] = tcpTarget.X;
 *          msg.DoubleParameters.Values[1] = tcpTarget.Y;
 *          msg.DoubleParameters.Values[2] = tcpTarget.Z;
 *          msg.DoubleParameters.Values[3] = tcpTarget.A;
 *          msg.DoubleParameters.Values[4] = tcpTarget.B;
 *          msg.DoubleParameters.Values[5] = tcpTarget.C;*/
            //IPAddress ipAddress = new IPAddress(2252147995); // für 134.61.13.28, 2252147996
            //Testen 127.0.0.1
            //IPAddress ipAddress = new IPAddress(new byte[4] { 134, 61, 13, 30});

            IPEndPoint ipEndPoint = new IPEndPoint(IPAddress.Any, 41975);
            Robot      agilus     = new Robot(ipEndPoint);

            //agilus.MoveAbsoluteLinear(tcpTarget);

            //agilus.movePTP(1, new List<double> { 0, -50, 90, 0, 90, 0 }, 10, 100);
            agilus.MoveAbsoluteLinear(tcpTarget1);
            agilus.Start();

            //agilus.MoveAbsoluteLinear(tcpTarget);


            //agilus.MoveAbsolutePTP(target, velocity, acceleration);

            /*agilus.MoveAbsolutePTP(target, velocity, acceleration);
            *  agilus.MoveAbsolutePTP(target, velocity, acceleration);
            *  agilus.MoveAbsolutePTP(target, velocity, acceleration);
            *  agilus.MoveAbsolutePTP(target, velocity, acceleration);*/
            //agilus.AgilusMessageToRobot.Command.set = 100;

            int i = 0;

            Thread.Sleep(10);
            while (true)
            {
                i++;
                agilus.MoveAbsoluteLinear(tcpTarget2);
                Thread.Sleep(1000);
                agilus.MoveAbsoluteLinear(tcpTarget1);
                Thread.Sleep(1000);
                //agilus.MoveAbsoluteLinear(tcpTarget);
            }

            //agilus.Stop();
        }
Example #2
0
        /// <summary>
        /// Stops the execution of the Agilus robot program
        /// </summary>
        public void StopExecution()
        {
            // Create the message
            AgilusMessageToRobot stopMessage = new AgilusMessageToRobot(100);

            // Send the message
            this.KukaRobot.Send(stopMessage);
        }
Example #3
0
        // Base method for linear movement
        private void moveLinear(int mode, IEnumerable <double> linear)
        {
            // Create the message
            AgilusMessageToRobot linearMessage = new AgilusMessageToRobot(mode)
            {
                DoubleParameters = new DoubleParameters(linear.ToArray())
            };

            // Send the message
            this.KukaRobot.Send(linearMessage);
        }
Example #4
0
        // Base method for PTP movement
        private void movePTP(int mode, IEnumerable <double> ptp, double velocity, double acceleration)
        {
            double[] parameters = new double[8];
            // Copy the target values to the parameters
            ptp.ToArray().CopyTo(parameters, 0);
            // Copy velocity and acceleration to the parameters
            parameters[6] = velocity; parameters[7] = acceleration;
            // Create the message
            AgilusMessageToRobot ptpMessage = new AgilusMessageToRobot(mode)
            {
                DoubleParameters = new DoubleParameters(parameters)
            };

            // Send the message
            this.KukaRobot.Send(ptpMessage);
        }