Exemple #1
0
        static void Main(string[] args)
        {
            int NUM_AUTD_X = 3;
            int NUM_AUTD_Y = 3;

            float W = 192f;
            float H = 151.4f;

            float xc = W * NUM_AUTD_X / 2f;
            float yc = H * NUM_AUTD_Y / 2f;
            float Z  = 200;

            var compress = true;
            var cond     = new Conditions()
            {
                SampleRateHz = 10_000_000,
                SampleLen    = 10_000,
                Temp         = 22.8f,
                Humidity     = 13f,
                Amplifer     = 10,
                X            = 0,
                Y            = 0,
                Z            = Z
            };

            using var robo = new RobotController();
            if (!robo.Connect("172.16.99.57"))
            {
                Console.WriteLine("Failed to connect to robot.");
                return;
            }
            robo.MoveTo(0, 0, Z);

            using var pico = new PicoCnt();
            pico.SetChannel(0, 50, 1, null);
            pico.SetChannel(1, 5000, 10, 1000);
            pico.SetCondition(cond);

            using var autd = new AUTD3Cnt();

            for (int y = 0; y < NUM_AUTD_Y; y++)
            {
                for (int x = 0; x < NUM_AUTD_X; x++)
                {
                    autd.AddDevice(x * W, y * H, 0);
                }
            }
            var ifname = AUTD3Cnt.GetIfname();

            autd.Open(ifname);
            autd.Clear();
            autd.Calibrate();
            autd.StaticMod(0xFF);

            Scan(autd, 10, pico, robo, cond, NUM_AUTD_X, NUM_AUTD_Y, Z, compress);

            Console.WriteLine("Finish.");
            autd.Stop();
            robo.Finish();
        }
    }
Exemple #2
0
        static void Main(string[] args)
        {
            using var robo = new RobotController();
            if (!robo.Connect("172.16.99.57"))
            {
                Console.WriteLine("Failed to connect to robot.");
                return;
            }
            robo.MoveTo(0, 0, 200);

            using var pico = new PicoCnt();

            using var autd = new AUTD3Cnt();
            autd.AddDevice(0, 0, 0);

            var ifname = AUTD3Cnt.GetIfname();

            autd.Open(ifname);
            autd.Clear();
            autd.Calibrate();
            autd.StaticMod(0xFF);

            var compress = false;
            var cond     = new Conditions()
            {
                SampleRateHz = 2_000_000,
                SampleLen    = 2_000,
                Temp         = 23.0f,
                Humidity     = 19f,
                Amplifer     = 10,
                X            = 0,
                Y            = 0,
                Z            = 200
            };

            pico.SetChannel(0, 500, 1, null);
            pico.SetCondition(cond);
            Console.WriteLine("Connect Ch. A to microphone. conditions are ...");
            cond.Check();
            Scan(autd, pico, cond, "amp", false, (autd, i) => autd.TransTest(0, (byte)i, 0), compress);

            cond.SampleRateHz = 10_000_000;
            cond.SampleLen    = 20000;

            pico.SetChannel(0, 50000, 10, null);
            pico.SetCondition(cond);
            Console.WriteLine("Connect Ch. A to microphone. conditions are ...");
            cond.Check();
            Scan(autd, pico, cond, "input", false, (autd, i) => autd.TransTest(0, (byte)i, 0), compress);

            pico.SetChannel(0, 500, 1, null);
            pico.SetChannel(1, 5000, 10, 1000);
            pico.SetCondition(cond);
            Console.WriteLine("Connect Ch. A to microphone and Ch. B to 40kHz reference signal. conditions are ...");
            cond.Check();
            Scan(autd, pico, cond, "phase", true, (autd, i) => autd.TransTest(0, 0xFF, (byte)i), compress);

            Console.WriteLine("Finish.");

            robo.Finish();
        }
    }