Example #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Starting mouse6D daemon");

            device = new TDx.TDxInput.Device();
            var connect = false;

            try
            {
                device.Connect();
                connect = true;
            }
            catch (Exception ex)
            {
                Console.WriteLine("Mouse connection failed !: ", ex.Data);
            }
            var oldX     = 0.0;
            var oldY     = 0.0;
            var oldZ     = 0.0;
            var oldRX    = 0.0;
            var oldRY    = 0.0;
            var oldRZ    = 0.0;
            var oldAngle = 0.0;

            while (connect)
            {
                var translation = device.Sensor.Translation;
                var rotation    = device.Sensor.Rotation;

                try
                {
                    if (oldX != translation.X || oldY != translation.Y || oldZ != translation.Z || oldRX != rotation.X || oldRY != rotation.Y || oldRZ != rotation.Z || oldAngle != rotation.Angle)
                    {
                        ServiceMouse.MouseSoapClient service = new ServiceMouse.MouseSoapClient();

                        Console.WriteLine("Translation : {0}\r\nRotation : {1}",
                                          string.Format("X={0} Y={1} Z={2}", translation.X, translation.Y, translation.Z),
                                          string.Format("X={0} Y={1} Z={2} Angle={3}", rotation.X, rotation.Y, rotation.Z, rotation.Angle));

                        service.SendMousePosition(translation.X, translation.Y, translation.Z, rotation.X, rotation.Y, rotation.Z, rotation.Angle);
                    }
                }
                catch (Exception e) { Console.WriteLine(e.Data); }

                oldX     = translation.X;
                oldY     = translation.Y;
                oldZ     = translation.Z;
                oldRX    = rotation.X;
                oldRY    = rotation.Y;
                oldRZ    = rotation.Z;
                oldAngle = rotation.Angle;

                Thread.Sleep(150);
            }

            Console.WriteLine("Daemon mouse closed !");
            Console.ReadKey();
        }
        // Fonction permettant de récupérer les données de mouvement de la souris
        public void Data_Mouse()
        {
            device = new TDx.TDxInput.Device();
            device.Connect();

            Console.WriteLine("start thread");
            // je démarre le thread réalisant la boucle de manipulation de la souris.
            myThread.Start();
        }
Example #3
0
        // Fonction permettant de récupérer les données de mouvement de la souris
        public void Data_Mouse()
        {
            device = new TDx.TDxInput.Device();
            device.Connect();

            Console.WriteLine("start thread");
            // je démarre le thread réalisant la boucle de manipulation de la souris.
            myThread.Start();
        }
Example #4
0
        private volatile bool _shouldStop; // Attribut qui permet d'arreter le thread et accessible par d'autre thread (volatile)
        #endregion

        #region Constructeur
        /// <summary>
        /// Fonction qui initialise la classe
        /// </summary>
        public Mouse()
        {
            #region Mouse connection
            Mouse6d = new TDx.TDxInput.Device();
            if (Mouse6d != null)
            {
                Mouse6d.Connect();
            }
            #endregion

            MoveByVector   = new TDx.TDxInput.Vector3D(0.0, 0.0, 0.0);
            RotateByVector = new TDx.TDxInput.Vector3D(0.0, 0.0, 0.0);
        }
Example #5
0
        static void Main(string[] args)
        {
            device = new TDx.TDxInput.Device();
            device.Connect();

            Console.WriteLine("Hello world");

            while (true)
            {
                var translation = device.Sensor.Translation;
                var rotation = device.Sensor.Rotation;

                Console.WriteLine("translation X : " + translation.X);
                Console.WriteLine("Rotation X : " + rotation.X);

                System.Threading.Thread.Sleep(1000);
            }
        }
Example #6
0
        static void Main(string[] args)
        {
            device = new TDx.TDxInput.Device();
            device.Connect();

            Console.WriteLine("Hello world");


            while (true)
            {
                var translation = device.Sensor.Translation;
                var rotation    = device.Sensor.Rotation;

                Console.WriteLine("translation X : " + translation.X);
                Console.WriteLine("Rotation X : " + rotation.X);

                System.Threading.Thread.Sleep(1000);
            }
        }
Example #7
0
        public void OnImportsSatisfied()
        {
            try
            {
                FDevice   = new TDx.TDxInput.Device();
                FSensor   = FDevice.Sensor;
                FKeyboard = FDevice.Keyboard;

                // Add the event handlers
                FDevice.DeviceChange += DeviceChange;

                // Connect everything up
                FDevice.Connect();
                FDeviceType = FDevice.Type;
            }
            catch (COMException e)
            {
                FLogger.Log(LogType.Error, "SpaceMouse: " + e.Message);
            }
        }
Example #8
0
        static void Main(string[] args)
        {
            started = false;

            Program prog = new Program();

            Console.WriteLine("Start of programm....");
            coeffTrans = 1.0;
            coeffRot = 0.4;

            Thread myThreadKeyboard;
            myThreadKeyboard = new Thread(new ThreadStart(KeyboardThreadLoop));
            myThreadKeyboard.Start();

            device = new TDx.TDxInput.Device();
            //keyboard = new TDx.TDxInput.Keyboard();
            var keyboard = device.Keyboard;
            Console.WriteLine(device.Sensor);
            Console.WriteLine(device.Sensor.Translation);
            //System.Threading.Thread.Sleep(2500);

            //translation = device.Sensor.Translation;
            //rotation = device.Sensor.Rotation;

            Console.WriteLine(device.IsConnected);
            device.Connect();
            Console.WriteLine(device.IsConnected);
            //System.Threading.Thread.Sleep(2500);
            // la souris est connecte

            /*Console.WriteLine("nombre de touches : ");
            Console.WriteLine(keyboard.Keys);

            Console.WriteLine("nombre de touches programmable : ");
            Console.WriteLine(keyboard.ProgrammableKeys);*/

            //keyboard.KeyDown += new System.EventHandler(prog.onKeyDown);

            //double xMax = 0, yMax = 0, zMax = 0;

            theRobot = new NLX.Robot.Kuka.Controller.RobotController();
            theRobot.Connect("192.168.1.1");
            Console.WriteLine("Connection avec le robot OK !");

            sh = new ScenarioHandler();
            //sh.readAndInterpretFile(@"C:\Users\IMERIR14\Desktop\Novalinxproject\trunk\darkproject\scenario.sck", theRobot);

            Console.WriteLine("File interpretation finished");

            Console.WriteLine("On entre dans le while sleep");
            while (true)
            {
                System.Threading.Thread.Sleep(100);
            }
        }
        static void Main(string[] args)
        {
            /* Declaration des variables */
            double x_Min = 0;
            double y_Min = 0;
            double z_Min = 0;
            double x_Max = 0;
            double y_Max = 0;
            double z_Max = 0;
            double valeurX;
            double valeurY;
            double valeurZ;

            Console.WriteLine("Start...");
            device = new TDx.TDxInput.Device();
            device.Connect();
            robotController = new NLX.Robot.Kuka.Controller.RobotController();
            //robotController.Connect("192.168.1.1");

            ConsoleKeyInfo info;
            String bouton = device.Keyboard.GetKeyName(1);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(2);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(3);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(4);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(5);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(6);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(7);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(8);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(9);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(10);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(11);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(12);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(13);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(14);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(15);
            Console.WriteLine(bouton);

            while (true)
            {
                var translation = device.Sensor.Translation;
                var rotation = device.Sensor.Rotation;

                /* Affichage des translations et des rotations */
                //Console.WriteLine("Translation: " + translation.X + " : " + translation.Y + " : " + translation.Z);
                //Console.WriteLine("Rotation: " + rotation.X + " : " + rotation.Y + " : " + rotation.Z + "\n");

                valeurX = translation.X / 2353;
                valeurY = translation.Y / 2702;
                valeurZ = translation.Z / 2648;

                System.Threading.Thread.Sleep(200);
            }
        }
Example #10
0
        static void Main(string[] args)
        {
            started = false;

            Program prog = new Program();

            Console.WriteLine("Start of programm....");
            coeffTrans = 1.0;
            coeffRot   = 0.4;

            Thread myThreadKeyboard;

            myThreadKeyboard = new Thread(new ThreadStart(KeyboardThreadLoop));
            myThreadKeyboard.Start();


            device = new TDx.TDxInput.Device();
            //keyboard = new TDx.TDxInput.Keyboard();
            var keyboard = device.Keyboard;

            Console.WriteLine(device.Sensor);
            Console.WriteLine(device.Sensor.Translation);
            //System.Threading.Thread.Sleep(2500);

            //translation = device.Sensor.Translation;
            //rotation = device.Sensor.Rotation;

            Console.WriteLine(device.IsConnected);
            device.Connect();
            Console.WriteLine(device.IsConnected);
            //System.Threading.Thread.Sleep(2500);
            // la souris est connecte

            /*Console.WriteLine("nombre de touches : ");
             * Console.WriteLine(keyboard.Keys);
             *
             * Console.WriteLine("nombre de touches programmable : ");
             * Console.WriteLine(keyboard.ProgrammableKeys);*/

            //keyboard.KeyDown += new System.EventHandler(prog.onKeyDown);

            //double xMax = 0, yMax = 0, zMax = 0;

            theRobot = new NLX.Robot.Kuka.Controller.RobotController();
            theRobot.Connect("192.168.1.1");
            Console.WriteLine("Connection avec le robot OK !");



            sh = new ScenarioHandler();
            //sh.readAndInterpretFile(@"C:\Users\IMERIR14\Desktop\Novalinxproject\trunk\darkproject\scenario.sck", theRobot);

            Console.WriteLine("File interpretation finished");


            Console.WriteLine("On entre dans le while sleep");
            while (true)
            {
                System.Threading.Thread.Sleep(100);
            }
        }
Example #11
0
        static void Main(string[] args)
        {
            /* Declaration des variables */
            double x_Min = 0;
            double y_Min = 0;
            double z_Min = 0;
            double x_Max = 0;
            double y_Max = 0;
            double z_Max = 0;
            double valeurX;
            double valeurY;
            double valeurZ;

            Console.WriteLine("Start...");
            device = new TDx.TDxInput.Device();
            device.Connect();
            robotController = new NLX.Robot.Kuka.Controller.RobotController();
            //robotController.Connect("192.168.1.1");

            ConsoleKeyInfo info;
            String         bouton = device.Keyboard.GetKeyName(1);

            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(2);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(3);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(4);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(5);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(6);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(7);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(8);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(9);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(10);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(11);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(12);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(13);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(14);
            Console.WriteLine(bouton);

            bouton = device.Keyboard.GetKeyName(15);
            Console.WriteLine(bouton);

            while (true)
            {
                var translation = device.Sensor.Translation;
                var rotation    = device.Sensor.Rotation;

                /* Affichage des translations et des rotations */
                //Console.WriteLine("Translation: " + translation.X + " : " + translation.Y + " : " + translation.Z);
                //Console.WriteLine("Rotation: " + rotation.X + " : " + rotation.Y + " : " + rotation.Z + "\n");

                valeurX = translation.X / 2353;
                valeurY = translation.Y / 2702;
                valeurZ = translation.Z / 2648;


                System.Threading.Thread.Sleep(200);
            }
        }
 public void connect()
 {
     device = new TDx.TDxInput.Device();
     device.Connect();
 }