private void AddDevices()
 {
     _autd.ClearDevices();
     foreach (var item in AUTDSettings.Instance.GeometriesReactive)
     {
         _autd.AddDevice(new Vector3d(item.X.Value, item.Y.Value, item.Z.Value), new Vector3d(item.RotateZ1.Value, item.RotateY.Value, item.RotateZ2.Value));
     }
 }
Beispiel #2
0
    void Awake()
    {
        _autd = new AUTD();

        // 単位や座標系はUnity空間に合わせてあります
        // つまり, 単位はm, 座標系は"z"軸の反転した左手座標系です
        // また, 回転指定にクオータニオンを直接指定できます.
        _autd.AddDevice(gameObject.transform.position, gameObject.transform.rotation);

        _autd.Open();
        _autd.AppendModulationSync(AUTD.SineModulation(150)); // 150 Hz
    }
Beispiel #3
0
    void Awake()
    {
        _autd = new AUTD();

        _autd.AddDevice(gameObject.transform.position, gameObject.transform.rotation);

        string ifname = @"write your interface name here";

        _link = Link.SOEM(ifname, _autd.NumDevices);
        _autd.Open(_link);

        _autd.Clear();

        _autd.Send(Modulation.Sine(150)); // 150 Hz
    }
Beispiel #4
0
        public static void Test()
        {
            Console.WriteLine("Test with TwinCAT");

            var autd = new AUTD();

            autd.AddDevice(Vector3d.Zero, Vector3d.Zero);

            var link = Link.TwinCAT();

            if (!autd.Open(link))
            {
                Console.WriteLine(AUTD.LastError);
                return;
            }

            TestRunner.Run(autd);
        }
Beispiel #5
0
        public static void Test()
        {
            Console.WriteLine("Test with SOEM");

            var autd = new AUTD();

            autd.AddDevice(Vector3d.Zero, Vector3d.Zero);
            //autd.AddDevice(Vector3d.Zero, Vector3d.Zero, 1);

            var ifname = GetIfname();
            var link   = Link.SOEM(ifname, autd.NumDevices, 1, x =>
            {
                Console.WriteLine($"Unrecoverable error occurred: {x}");
                Environment.Exit(-1);
            });

            if (!autd.Open(link))
            {
                Console.WriteLine(AUTD.LastError);
                return;
            }

            TestRunner.Run(autd);
        }
Beispiel #6
0
 public void AddDevice(float x, float y, float z)
 {
     _autd.AddDevice(new Vector3f(x, y, z), Vector3f.Zero);
 }