Example #1
0
 public void insert(XsOutputConfiguration item, uint index)
 {
     xsensdeviceapiPINVOKE.XsOutputConfigurationArrayImpl_insert__SWIG_0(swigCPtr, XsOutputConfiguration.getCPtr(item), index);
     if (xsensdeviceapiPINVOKE.SWIGPendingException.Pending)
     {
         throw xsensdeviceapiPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Example #2
0
 public void push_front(XsOutputConfiguration item)
 {
     xsensdeviceapiPINVOKE.XsOutputConfigurationArrayImpl_push_front(swigCPtr, XsOutputConfiguration.getCPtr(item));
     if (xsensdeviceapiPINVOKE.SWIGPendingException.Pending)
     {
         throw xsensdeviceapiPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Example #3
0
        public int find(XsOutputConfiguration needle)
        {
            int ret = xsensdeviceapiPINVOKE.XsOutputConfigurationArrayImpl_find(swigCPtr, XsOutputConfiguration.getCPtr(needle));

            if (xsensdeviceapiPINVOKE.SWIGPendingException.Pending)
            {
                throw xsensdeviceapiPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
 public XsOutputConfigurationArray(XsOutputConfiguration arg0, uint sz) : this(xsensdeviceapiPINVOKE.new_XsOutputConfigurationArray__SWIG_5(XsOutputConfiguration.getCPtr(arg0), sz), true)
 {
 }
 public XsOutputConfigurationArray(XsOutputConfiguration arg0, uint sz, XsDataFlags flags) : this(xsensdeviceapiPINVOKE.new_XsOutputConfigurationArray__SWIG_4(XsOutputConfiguration.getCPtr(arg0), sz, (int)flags), true)
 {
 }
 public XsOutputConfigurationArray(uint sz, XsOutputConfiguration src) : this(xsensdeviceapiPINVOKE.new_XsOutputConfigurationArray__SWIG_0(sz, XsOutputConfiguration.getCPtr(src)), true)
 {
 }
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(XsOutputConfiguration obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Example #8
0
        public XsOutputConfiguration value(uint index)
        {
            XsOutputConfiguration ret = new XsOutputConfiguration(xsensdeviceapiPINVOKE.XsOutputConfigurationArrayImpl_value(swigCPtr, index), true);

            return(ret);
        }
Example #9
0
 public XsOutputConfigurationArrayImpl(uint count, XsOutputConfiguration src) : this(xsensdeviceapiPINVOKE.new_XsOutputConfigurationArrayImpl__SWIG_0(count, XsOutputConfiguration.getCPtr(src)), true)
 {
 }
Example #10
0
 public void assign(uint count, XsOutputConfiguration src)
 {
     xsensdeviceapiPINVOKE.XsOutputConfigurationArrayImpl_assign(swigCPtr, count, XsOutputConfiguration.getCPtr(src));
 }
Example #11
0
 public void insert(XsOutputConfiguration items, uint index, uint count)
 {
     xsensdeviceapiPINVOKE.XsOutputConfigurationArrayImpl_insert__SWIG_1(swigCPtr, XsOutputConfiguration.getCPtr(items), index, count);
 }
Example #12
0
        public XsOutputConfiguration at(uint index)
        {
            XsOutputConfiguration ret = new XsOutputConfiguration(xsensdeviceapiPINVOKE.XsOutputConfigurationArrayImpl_at__SWIG_0(swigCPtr, index), false);

            return(ret);
        }
Example #13
0
        public void Start()
        {
            if (state != XSensState.NotStarted)
            {
                Debug.Log("[XSensGyroscope] Cannot call Start twice! Ignoring...\n");
                return;
            }

            this.UpdateState(XSensState.Starting);

            _xda.scanPorts();
            Debug.LogFormat("[XSensGyroscope] Found {0} device(s)\n", _xda._DetectedDevices.Count);
            if (_xda._DetectedDevices.Count > 0)
            {
                XsPortInfo portInfo = _xda._DetectedDevices[0];
                if (portInfo.deviceId().isMtMk4())
                {
                    _xda.openPort(portInfo);
                    MasterInfo ai = new MasterInfo(portInfo.deviceId());
                    ai.ComPort = portInfo.portName();
                    ai.BaudRate = portInfo.baudrate();

                    _measuringDevice = _xda.getDevice(ai.DeviceId);
                    ai.ProductCode = new XsString(_measuringDevice.productCode());

                    // Print information about detected MTi / MTx / MTmk4 device
                    Debug.LogFormat("[XSensGyroscope] Found a device with id: {0} @ port: {1}, baudrate: {2}\n",
                        _measuringDevice.deviceId().toXsString().toString(), ai.ComPort.toString(), ai.BaudRate);

                    // Create and attach callback handler to device
                    _myMtCallback = new MyMtCallback();
                    _measuringDevice.addCallbackHandler(_myMtCallback);

                    ConnectedMtData mtwData = new ConnectedMtData();

                    // connect signals
                    _myMtCallback.DataAvailable += new EventHandler<DataAvailableArgs>(DataAvailable);

                    // Put the device in configuration mode
                    Debug.Log("[XSensGyroscope] Putting device into configuration mode...\n");
                    if (!_measuringDevice.gotoConfig()) // Put the device into configuration mode before configuring the device
                    {
                        Debug.Log("[XSensGyroscope] Could not put device into configuration mode. Aborting.");
                        this.UpdateState(XSensState.Failed);
                        return;
                    }

                    // Configure the device. Note the differences between MTix and MTmk4
                    Debug.Log("[XSensGyroscope] Configuring the device...\n");
                    if (_measuringDevice.deviceId().isMt9c())
                    {
                        XsOutputMode outputMode = XsOutputMode.XOM_Orientation; // output orientation data
                        XsOutputSettings outputSettings = XsOutputSettings.XOS_OrientationMode_Quaternion; // output orientation data as quaternion
                        XsDeviceMode deviceMode = new XsDeviceMode(100); // make a device mode with update rate: 100 Hz
                        deviceMode.setModeFlag(outputMode);
                        deviceMode.setSettingsFlag(outputSettings);

                        // set the device configuration
                        if (!_measuringDevice.setDeviceMode(deviceMode))
                        {
                            Debug.Log("[XSensGyroscope] Could not configure MTix device. Aborting.");
                            this.UpdateState(XSensState.Failed);
                            return;
                        }
                    }
                    else if (_measuringDevice.deviceId().isMtMk4())
                    {
                        XsOutputConfiguration quat = new XsOutputConfiguration(XsDataIdentifier.XDI_Quaternion, 0);
                        XsOutputConfigurationArray configArray = new XsOutputConfigurationArray();
                        configArray.push_back(quat);
                        if (!_measuringDevice.setOutputConfiguration(configArray))
                        {
                            Debug.Log("[XSensGyroscope] Could not configure MTmk4 device. Aborting.");
                            this.UpdateState(XSensState.Failed);
                            return;
                        }
                    }
                    else
                    {
                        Debug.Log("[XSensGyroscope] Unknown device while configuring. Aborting.");
                        this.UpdateState(XSensState.Failed);
                        return;
                    }

                    // Put the device in measurement mode
                    Debug.Log("[XSensGyroscope] Putting device into measurement mode...\n");
                    if (!_measuringDevice.gotoMeasurement())
                    {
                        Debug.Log("[XSensGyroscope] Could not put device into measurement mode. Aborting.");
                        this.UpdateState(XSensState.Failed);
                        return;
                    }

                    this.UpdateState(XSensState.Started);
                }
            }
        }
        public XsOutputConfiguration last()
        {
            XsOutputConfiguration ret = new XsOutputConfiguration(xsensdeviceapiPINVOKE.XsOutputConfigurationArrayImpl_last(swigCPtr), true);

            return(ret);
        }
Example #15
0
        public void Start()
        {
            if (state != XSensState.NotStarted)
            {
                Debug.Log("[XSensGyroscope] Cannot call Start twice! Ignoring...\n");
                return;
            }

            this.UpdateState(XSensState.Starting);

            _xda.scanPorts();
            Debug.LogFormat("[XSensGyroscope] Found {0} device(s)\n", _xda._DetectedDevices.Count);
            if (_xda._DetectedDevices.Count > 0)
            {
                XsPortInfo portInfo = _xda._DetectedDevices[0];
                if (portInfo.deviceId().isMtMk4())
                {
                    _xda.openPort(portInfo);
                    MasterInfo ai = new MasterInfo(portInfo.deviceId());
                    ai.ComPort  = portInfo.portName();
                    ai.BaudRate = portInfo.baudrate();

                    _measuringDevice = _xda.getDevice(ai.DeviceId);
                    ai.ProductCode   = new XsString(_measuringDevice.productCode());

                    // Print information about detected MTi / MTx / MTmk4 device
                    Debug.LogFormat("[XSensGyroscope] Found a device with id: {0} @ port: {1}, baudrate: {2}\n",
                                    _measuringDevice.deviceId().toXsString().toString(), ai.ComPort.toString(), ai.BaudRate);

                    // Create and attach callback handler to device
                    _myMtCallback = new MyMtCallback();
                    _measuringDevice.addCallbackHandler(_myMtCallback);

                    ConnectedMtData mtwData = new ConnectedMtData();

                    // connect signals
                    _myMtCallback.DataAvailable += new EventHandler <DataAvailableArgs>(DataAvailable);

                    // Put the device in configuration mode
                    Debug.Log("[XSensGyroscope] Putting device into configuration mode...\n");
                    if (!_measuringDevice.gotoConfig()) // Put the device into configuration mode before configuring the device
                    {
                        Debug.Log("[XSensGyroscope] Could not put device into configuration mode. Aborting.");
                        this.UpdateState(XSensState.Failed);
                        return;
                    }

                    // Configure the device. Note the differences between MTix and MTmk4
                    Debug.Log("[XSensGyroscope] Configuring the device...\n");
                    if (_measuringDevice.deviceId().isMt9c())
                    {
                        XsOutputMode     outputMode     = XsOutputMode.XOM_Orientation;                    // output orientation data
                        XsOutputSettings outputSettings = XsOutputSettings.XOS_OrientationMode_Quaternion; // output orientation data as quaternion
                        XsDeviceMode     deviceMode     = new XsDeviceMode(100);                           // make a device mode with update rate: 100 Hz
                        deviceMode.setModeFlag(outputMode);
                        deviceMode.setSettingsFlag(outputSettings);

                        // set the device configuration
                        if (!_measuringDevice.setDeviceMode(deviceMode))
                        {
                            Debug.Log("[XSensGyroscope] Could not configure MTix device. Aborting.");
                            this.UpdateState(XSensState.Failed);
                            return;
                        }
                    }
                    else if (_measuringDevice.deviceId().isMtMk4())
                    {
                        XsOutputConfiguration      quat        = new XsOutputConfiguration(XsDataIdentifier.XDI_Quaternion, 0);
                        XsOutputConfigurationArray configArray = new XsOutputConfigurationArray();
                        configArray.push_back(quat);
                        if (!_measuringDevice.setOutputConfiguration(configArray))
                        {
                            Debug.Log("[XSensGyroscope] Could not configure MTmk4 device. Aborting.");
                            this.UpdateState(XSensState.Failed);
                            return;
                        }
                    }
                    else
                    {
                        Debug.Log("[XSensGyroscope] Unknown device while configuring. Aborting.");
                        this.UpdateState(XSensState.Failed);
                        return;
                    }

                    // Put the device in measurement mode
                    Debug.Log("[XSensGyroscope] Putting device into measurement mode...\n");
                    if (!_measuringDevice.gotoMeasurement())
                    {
                        Debug.Log("[XSensGyroscope] Could not put device into measurement mode. Aborting.");
                        this.UpdateState(XSensState.Failed);
                        return;
                    }

                    this.UpdateState(XSensState.Started);
                }
            }
        }