YEI 3-Space Sensor and FreePIE

Official forum for open source FreePIE discussion and development.
arti
One Eyed Hopeful
Posts: 33
Joined: Tue May 26, 2009 11:31 am

Re: YEI 3-Space Sensor and FreePIE

Post by arti »

Hello, I'm starting with the 2.4GHz sensor programming, I have little knowledge of programming and I'm starting Freepie.
I use the last firmware 2.0_r12_05Jul2013 for the sensor and dongle, and Freepie 1.2.375.0.

First I change the settings as I see in the earlier post:

Accelerometer Trust Values
Confidence: 0.001 to 0.0625

Compass Trust Values
Confidence 0.0001 to 0.0005

Axis Direction
(x:Forward, Y:Right, z: Up) (Left-handed)
No inversion checks

Misc.
Filter Mode: Kalman
Calibration Mode: Matrix
Desired Update Rate: 0
Over sample Rate: 1
Running Average Percent: 0.0
Button Gyro Disable Length: 5

Reference Modes: Single Auto

All good except for one detail:
If I change this: Compass Trust Values
Confidence 0.0001 to 0.0005
when I save it and reopen the setting I see that it change to Static 0.0010000000475 ??

The other problema is that I can't Access to the yei3 sensor from Freepie because all the times when I run the script appears a dialog saying 'FreePIE.GUI has stopped working', with 'Close the program' as the only option. I probe it in Windows Seven 32bits and 64bits. I probe for example this script:

def update():
diagnostics.watch(yei[0].yaw);
diagnostics.watch(yei[0].pitch);
diagnostics.watch(yei[0].roll);
if starting:
freeTrack.update += update

Where can I see the log for the crash?

Thank you in advance and Greetings.

CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: YEI 3-Space Sensor and FreePIE

Post by CyberVillain »

Anything in freepie.log or in Windows Event viewier?

Looks like the Yei3 space SDK is crashing and taking FreePIE withit

User avatar
baggyg
Vireio Perception Developer
Vireio Perception Developer
Posts: 491
Joined: Sat May 19, 2012 5:20 am
Which stereoscopic 3D solution do you primarily use?: S-3D HDTV
Location: BB, Slovakia

Re: YEI 3-Space Sensor and FreePIE

Post by baggyg »

arti wrote: def update():
diagnostics.watch(yei[0].yaw);
diagnostics.watch(yei[0].pitch);
diagnostics.watch(yei[0].roll);
if starting:
freeTrack.update += update
Not that this should matter to the crash but shouldn't it be

Code: Select all

def update():
diagnostics.watch(yei[0].yaw);
diagnostics.watch(yei[0].pitch);
diagnostics.watch(yei[0].roll);
if starting:
yei[0].update += update 
Also make sure you are not connected through the sensor suite at the same time and running in administrator mode.

arti
One Eyed Hopeful
Posts: 33
Joined: Tue May 26, 2009 11:31 am

Re: YEI 3-Space Sensor and FreePIE

Post by arti »

Ok, sorry also I probe with yei[0].update += update (copy-paste error ;-) , but the problem is the same.
I don't have the suite at the same time and I run it as adminstrator, the same problema again. I attach the Windows log of the app:

Version=1
EventType=APPCRASH
EventTime=130221540007013000
ReportType=2
Consent=1
UploadTime=130221540012473000
ReportIdentifier=37d72d29-0fc0-11e3-9b35-00012e2313c7
IntegratorReportIdentifier=37d72d28-0fc0-11e3-9b35-00012e2313c7
WOW64=1
Response.type=4
Sig[0].Name=Nombre de la aplicación
Sig[0].Value=FreePIE.exe
Sig[1].Name=Versión de la aplicación
Sig[1].Value=1.2.375.0
Sig[2].Name=Marca de tiempo de la aplicación
Sig[2].Value=51e4752d
Sig[3].Name=Nombre del módulo con errores
Sig[3].Value=ThreeSpace_API.dll
Sig[4].Name=Versión del módulo con errores
Sig[4].Value=0.0.0.0
Sig[5].Name=Marca de tiempo del módulo con errores
Sig[5].Value=51953785
Sig[6].Name=Código de excepción
Sig[6].Value=c0000005
Sig[7].Name=Desplazamiento de excepción
Sig[7].Value=000033b9
DynamicSig[1].Name=Versión del sistema operativo
DynamicSig[1].Value=6.1.7601.2.1.0.256.1
DynamicSig[2].Name=Id. de configuración regional
DynamicSig[2].Value=3082
DynamicSig[22].Name=Información adicional 1
DynamicSig[22].Value=0a9e
DynamicSig[23].Name=Información adicional 2
DynamicSig[23].Value=0a9e372d3b4ad19135b953a78882e789
DynamicSig[24].Name=Información adicional 3
DynamicSig[24].Value=0a9e
DynamicSig[25].Name=Información adicional 4
DynamicSig[25].Value=0a9e372d3b4ad19135b953a78882e789
UI[2]=C:\Program Files (x86)\FreePIE\FreePIE.exe
UI[3]=FreePIE.GUI dejó de funcionar
UI[4]=Windows puede buscar una solución en línea al problema.
UI[5]=Buscar una solución en línea y cerrar el programa
UI[6]=Buscar una solución en línea más tarde y cerrar el programa
UI[7]=Cerrar el programa
LoadedModule[0]=C:\Program Files (x86)\FreePIE\FreePIE.exe
LoadedModule[1]=C:\Windows\SysWOW64\ntdll.dll
LoadedModule[2]=C:\Windows\SYSTEM32\MSCOREE.DLL
LoadedModule[3]=C:\Windows\syswow64\KERNEL32.dll
LoadedModule[4]=C:\Windows\syswow64\KERNELBASE.dll
LoadedModule[5]=C:\Windows\syswow64\ADVAPI32.dll
LoadedModule[6]=C:\Windows\syswow64\msvcrt.dll
LoadedModule[7]=C:\Windows\SysWOW64\sechost.dll
LoadedModule[8]=C:\Windows\syswow64\RPCRT4.dll
LoadedModule[9]=C:\Windows\syswow64\SspiCli.dll
LoadedModule[10]=C:\Windows\syswow64\CRYPTBASE.dll
LoadedModule[11]=C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscoreei.dll
LoadedModule[12]=C:\Windows\syswow64\SHLWAPI.dll
LoadedModule[13]=C:\Windows\syswow64\GDI32.dll
LoadedModule[14]=C:\Windows\syswow64\USER32.dll
LoadedModule[15]=C:\Windows\syswow64\LPK.dll
LoadedModule[16]=C:\Windows\syswow64\USP10.dll
LoadedModule[17]=C:\Windows\system32\IMM32.DLL
LoadedModule[18]=C:\Windows\syswow64\MSCTF.dll
LoadedModule[19]=C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
LoadedModule[20]=C:\Windows\system32\MSVCR100_CLR0400.dll
LoadedModule[21]=C:\Windows\assembly\NativeImages_v4.0.30319_32\mscorlib\cf58670896c5313b9b52f026f4455a5d\mscorlib.ni.dll
LoadedModule[22]=C:\Windows\syswow64\ole32.dll
LoadedModule[23]=C:\Windows\system32\uxtheme.dll
LoadedModule[24]=C:\Program Files (x86)\Matrox Graphics\PowerDesk\Matrox.PDesk.Hooks.dll
LoadedModule[25]=C:\Windows\syswow64\PSAPI.DLL
LoadedModule[26]=C:\Windows\system32\VERSION.dll
LoadedModule[27]=C:\Windows\syswow64\SETUPAPI.dll
LoadedModule[28]=C:\Windows\syswow64\CFGMGR32.dll
LoadedModule[29]=C:\Windows\syswow64\OLEAUT32.dll
LoadedModule[30]=C:\Windows\syswow64\DEVOBJ.dll
LoadedModule[31]=C:\Windows\system32\USERENV.dll
LoadedModule[32]=C:\Windows\system32\profapi.dll
LoadedModule[33]=C:\Windows\system32\MSIMG32.dll
LoadedModule[34]=C:\Windows\system32\WTSAPI32.dll
LoadedModule[35]=C:\Windows\system32\newdev.dll
LoadedModule[36]=C:\Windows\system32\devrtl.DLL
LoadedModule[37]=C:\Windows\syswow64\SHELL32.dll
LoadedModule[38]=C:\Program Files (x86)\Common Files\microsoft shared\ink\tiptsf.dll
LoadedModule[39]=C:\Windows\Microsoft.NET\Framework\v4.0.30319\nlssorting.dll
LoadedModule[40]=C:\Windows\assembly\NativeImages_v4.0.30319_32\System\de853615c8224ba5d9aa9b76276c6d98\System.ni.dll
LoadedModule[41]=C:\Windows\assembly\NativeImages_v4.0.30319_32\WindowsBase\b3ed31a444f444325ddb64b290ed2f1e\WindowsBase.ni.dll
LoadedModule[42]=C:\Windows\system32\CRYPTSP.dll
LoadedModule[43]=C:\Windows\system32\rsaenh.dll
LoadedModule[44]=C:\Windows\assembly\NativeImages_v4.0.30319_32\PresentationCore\001aeb860d7f2ba416e0fedc606fee98\PresentationCore.ni.dll
LoadedModule[45]=C:\Windows\assembly\NativeImages_v4.0.30319_32\PresentationFramewo#\56a1feb800860a3bc5d8a45ee92a77ec\PresentationFramework.ni.dll
LoadedModule[46]=C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Xaml\4d277a8481c203a35c58bd277a2e71df\System.Xaml.ni.dll
LoadedModule[47]=C:\Windows\system32\dwrite.dll
LoadedModule[48]=C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF\wpfgfx_v0400.dll
LoadedModule[49]=C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF\PresentationNative_v0400.dll
LoadedModule[50]=C:\Windows\Microsoft.NET\Framework\v4.0.30319\clrjit.dll
LoadedModule[51]=C:\Windows\system32\dwmapi.dll
LoadedModule[52]=C:\Windows\system32\RpcRtRemote.dll
LoadedModule[53]=C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Core\c25ede0d0127774c504c4fc41d4de273\System.Core.ni.dll
LoadedModule[54]=C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Runtime.Seri#\420022aad3481c670eb86a4ca72d5b43\System.Runtime.Serialization.ni.dll
LoadedModule[55]=C:\Windows\assembly\NativeImages_v4.0.30319_32\SMDiagnostics\af7d7a2e47e0ac57b4f0fe5e0c1cda9a\SMDiagnostics.ni.dll
LoadedModule[56]=C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Runtime.Dura#\d82770dc4e5fee30ca8a7244bf7f613a\System.Runtime.DurableInstancing.ni.dll
LoadedModule[57]=C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Xml\884bcbd22130ebeb1211bc7bcc3910c9\System.Xml.ni.dll
LoadedModule[58]=C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Configuration\df40dab689e9d8febfb943599ba79f8d\System.Configuration.ni.dll
LoadedModule[59]=C:\Windows\syswow64\urlmon.dll
LoadedModule[60]=C:\Windows\syswow64\api-ms-win-downlevel-ole32-l1-1-0.dll
LoadedModule[61]=C:\Windows\syswow64\api-ms-win-downlevel-shlwapi-l1-1-0.dll
LoadedModule[62]=C:\Windows\syswow64\api-ms-win-downlevel-advapi32-l1-1-0.dll
LoadedModule[63]=C:\Windows\syswow64\api-ms-win-downlevel-user32-l1-1-0.dll
LoadedModule[64]=C:\Windows\syswow64\api-ms-win-downlevel-version-l1-1-0.dll
LoadedModule[65]=C:\Windows\syswow64\api-ms-win-downlevel-normaliz-l1-1-0.dll
LoadedModule[66]=C:\Windows\syswow64\normaliz.DLL
LoadedModule[67]=C:\Windows\syswow64\iertutil.dll
LoadedModule[68]=C:\Windows\syswow64\WININET.dll
LoadedModule[69]=C:\Windows\system32\Secur32.dll
LoadedModule[70]=C:\Windows\system32\api-ms-win-downlevel-advapi32-l2-1-0.dll
LoadedModule[71]=C:\Program Files (x86)\FreePIE\SlimDX.dll
LoadedModule[72]=C:\Windows\system32\MSVCR100.dll
LoadedModule[73]=C:\Windows\system32\WINMM.dll
LoadedModule[74]=C:\Windows\system32\MSVCP100.dll
LoadedModule[75]=C:\Windows\system32\DINPUT8.dll
LoadedModule[76]=C:\Windows\system32\HID.DLL
LoadedModule[77]=C:\Windows\syswow64\WINTRUST.dll
LoadedModule[78]=C:\Windows\syswow64\CRYPT32.dll
LoadedModule[79]=C:\Windows\syswow64\MSASN1.dll
LoadedModule[80]=C:\Windows\system32\WindowsCodecs.dll
LoadedModule[81]=C:\Windows\system32\d3d9.dll
LoadedModule[82]=C:\Windows\system32\d3d8thk.dll
LoadedModule[83]=C:\Windows\system32\dlumd9.dll
LoadedModule[84]=C:\Windows\system32\dbghelp.dll
LoadedModule[85]=C:\Windows\system32\nvd3dum.dll
LoadedModule[86]=C:\Windows\assembly\NativeImages_v4.0.30319_32\PresentationFramewo#\228b114c79c5d9024bdb4cc580e32c09\PresentationFramework.Aero.ni.dll
LoadedModule[87]=C:\Windows\system32\WINSTA.dll
LoadedModule[88]=C:\Windows\syswow64\CLBCatQ.DLL
LoadedModule[89]=C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF\PenIMC.dll
LoadedModule[90]=C:\Program Files (x86)\Common Files\Microsoft Shared\Ink\tpcps.dll
LoadedModule[91]=C:\Windows\system32\oleacc.dll
LoadedModule[92]=C:\Windows\assembly\NativeImages_v4.0.30319_32\UIAutomationProvider\4b2e892995b8cdefb1e2cddb96f32736\UIAutomationProvider.ni.dll
LoadedModule[93]=C:\Windows\assembly\NativeImages_v4.0.30319_32\UIAutomationTypes\cb5671235362c8e17b1a1f0b67bfc8d9\UIAutomationTypes.ni.dll
LoadedModule[94]=C:\Windows\system32\UIAutomationCore.dll
LoadedModule[95]=C:\Windows\system32\SXS.DLL
LoadedModule[96]=C:\Windows\system32\msctfui.dll
LoadedModule[97]=C:\Windows\system32\apphelp.dll
LoadedModule[98]=C:\Windows\system32\powrprof.dll
LoadedModule[99]=C:\Program Files (x86)\NVIDIA Corporation\3D Vision\nvSCPAPI.dll
LoadedModule[100]=C:\Windows\system32\nvapi.dll
LoadedModule[101]=C:\Windows\system32\mscms.dll
LoadedModule[102]=C:\Windows\system32\WindowsCodecsExt.dll
LoadedModule[103]=C:\Windows\system32\icm32.dll
LoadedModule[104]=C:\Windows\assembly\NativeImages_v4.0.30319_32\Accessibility\51fe07d5205cd85d996af305a38b3770\Accessibility.ni.dll
LoadedModule[105]=C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Security\121e3bb63d1d2d2487c855819263ed7c\System.Security.ni.dll
LoadedModule[106]=C:\Windows\assembly\NativeImages_v4.0.30319_32\Microsoft.VisualC\b1560845b641faac0ca607b2dce8389a\Microsoft.VisualC.ni.dll
LoadedModule[107]=C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Xml.Linq\c389533f1477363803e53dce01560d12\System.Xml.Linq.ni.dll
LoadedModule[108]=C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Transactions\102014a4f570b1dc944ff7eb8e1c6e2b\System.Transactions.ni.dll
LoadedModule[109]=C:\Windows\Microsoft.Net\assembly\GAC_32\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll
LoadedModule[110]=C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Data.SqlXml\66a79425d6304161532d7f179b04a946\System.Data.SqlXml.ni.dll
LoadedModule[111]=C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Drawing\3a3fc0216674bdea0be809b305517c98\System.Drawing.ni.dll
LoadedModule[112]=C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Windows.Forms\1a3b614a84244ea5fa4147b5cf007333\System.Windows.Forms.ni.dll
LoadedModule[113]=C:\Windows\system32\shfolder.dll
LoadedModule[114]=C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Numerics\cfbc74c91b44af85d10b272ae5c70d5a\System.Numerics.ni.dll
LoadedModule[115]=C:\Program Files (x86)\FreePIE\ThreeSpace_API.dll
LoadedModule[116]=C:\Windows\Microsoft.NET\Framework\v4.0.30319\diasymreader.dll
State[0].Key=Transport.DoneStage1
State[0].Value=1
FriendlyEventName=Dejó de funcionar
ConsentKey=APPCRASH
AppName=FreePIE.GUI
AppPath=C:\Program Files (x86)\FreePIE\FreePIE.exe

Thanks.

CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: YEI 3-Space Sensor and FreePIE

Post by CyberVillain »

As I thought, the sdk is crashing. Why I do not know baggy or Yei might be able to answer that

LoadedModule[115]=C:\Program Files (x86)\FreePIE\ThreeSpace_API.dll

User avatar
baggyg
Vireio Perception Developer
Vireio Perception Developer
Posts: 491
Joined: Sat May 19, 2012 5:20 am
Which stereoscopic 3D solution do you primarily use?: S-3D HDTV
Location: BB, Slovakia

Re: YEI 3-Space Sensor and FreePIE

Post by baggyg »

Arti, reading between the lines, do you perchance have the wireless YEI sensor?

I suspect the sensor detection for that one may have a bug in it. I was never able to test a wireless sensor since I only have the USB one. It is a little more complicated since it requires the program to first detect the dongle, then the sensor. Perhaps RoadKillGrill could give the wireless one a test... If no luck I could have a look at the code and see if there is something obvious. Much like Cyber I am limited to what I can physically test here since I am just an enthusiast and can't afford to purchase every type.

Just for interest sake try changing the code to reference yei[1] or yei[2].

arti
One Eyed Hopeful
Posts: 33
Joined: Tue May 26, 2009 11:31 am

Re: YEI 3-Space Sensor and FreePIE

Post by arti »

I use the 2.4GHz wireless sensor.
I use the last firmware 2.0_r12_05Jul2013 for the sensor and dongle, and Freepie 1.2.375.0.

But I could probe it with the usb cable attached and wireless off, maybe the chipset is different.

Greetings

arti
One Eyed Hopeful
Posts: 33
Joined: Tue May 26, 2009 11:31 am

Re: YEI 3-Space Sensor and FreePIE

Post by arti »

If I put yei[1] or yei[2] the freepie not crash but appear the message:
6: Only 1 connected devices, 1 is out of bounds or
6: Only 1 connected devices, 2 is out of bounds

The instruction that made the crash is: yei[0].update += update

If I switch off the wireless and connect the sensor by a usb cable the freepie not crash but appear:
Error while reading device: TSS_INVALID_COMMAND

:-(

Greetings

User avatar
baggyg
Vireio Perception Developer
Vireio Perception Developer
Posts: 491
Joined: Sat May 19, 2012 5:20 am
Which stereoscopic 3D solution do you primarily use?: S-3D HDTV
Location: BB, Slovakia

Re: YEI 3-Space Sensor and FreePIE

Post by baggyg »

arti wrote:If I put yei[1] or yei[2] the freepie not crash but appear the message:
6: Only 1 connected devices, 1 is out of bounds or
6: Only 1 connected devices, 2 is out of bounds

The instruction that made the crash is: yei[0].update += update
If I switch off the wireless and connect the sensor by a usb cable the freepie not crash but appear:
Error while reading device: TSS_INVALID_COMMAND
:-(
Greetings
So yeah looks like the wireless version of the YEI has an issue. Lets see if RoadKillGrill can test and have a look (although I am sure he is very busy with PrioVR), otherwise Ill have a look at the code and see if there is something obvious.

arti
One Eyed Hopeful
Posts: 33
Joined: Tue May 26, 2009 11:31 am

Re: YEI 3-Space Sensor and FreePIE

Post by arti »

ok, thanks for your help.

arti
One Eyed Hopeful
Posts: 33
Joined: Tue May 26, 2009 11:31 am

Re: YEI 3-Space Sensor and FreePIE

Post by arti »

The response of yei support, maybe can help:
"I found the source of the problem when using USB interface and I believe it is what is crashing the wireless interface. When a device is being created it creates a device ID for the API to use, and that device ID in FreePIE is always "0" which is not a recognizable ID the API can understand. I believe this is what is crashing the wireless and is causing the "TSS_INVALID_COMMAND" error for the USB. I am working on why this is happening and how it can be fixed. Hopefully by next week sometime I'll have a solution."

Thanks.

kzoink
One Eyed Hopeful
Posts: 28
Joined: Thu Apr 11, 2013 6:59 am

Re: YEI 3-Space Sensor and FreePIE

Post by kzoink »

I'm using the Bluetooth (not 2.4GHz) wireless version of YEI 3-space. When I run FreePIE and try to execute this script:

Code: Select all

def update():
	diagnostics.watch(yei[0].yaw);
	diagnostics.watch(yei[0].pitch);
	diagnostics.watch(yei[0].roll);
if starting:
	yei[0].update += update 
The Error tab says,
No YEI3 Space devices connected!

kzoink
One Eyed Hopeful
Posts: 28
Joined: Thu Apr 11, 2013 6:59 am

Re: YEI 3-Space Sensor and FreePIE

Post by kzoink »

So I'm debugging the source to try to get to the bottom of this.

Here's where the error message is being generated...

Code: Select all

        countSensors = Api.GetComPorts();
        if (countSensors == 0)
        throw new Exception("No YEI3 Space devices connected!");


        public static int GetComPorts()
        {
            var port = new TssComPort();
            var count = tss_getComPorts(out port, 1, 0, TssFind.TSS_FIND_ALL_KNOWN);
            return count;
        }
GetComPorts/tss_getComPorts are both consistently returning 0 even though the YEI 3-Space Sensor is connected via Bluetooth SPP to COM 3 and I can successfully use the 3 Space Suite 2.0 r13...

I'm running firmware 2.0 r13 on the TSS-BT and my operating system is Windows 8 x64 if that makes a difference...
Last edited by kzoink on Tue Sep 10, 2013 11:35 am, edited 1 time in total.

kzoink
One Eyed Hopeful
Posts: 28
Joined: Thu Apr 11, 2013 6:59 am

Re: YEI 3-Space Sensor and FreePIE

Post by kzoink »

So I was poking around on the YEI Technology forums and found this tidbit:
Added support for bluetooth auto find with tss_getComPorts (currently does not work with Windows XP)
Source:
http://forum.yeitechnology.com/viewtopi ... &t=27#p235

Apparently, finding the Bluetooth version of the 3-space sensor via tss_getComPorts was not added until 3-Space C API 2.0.5 Beta

I believe what is included with FreePIE 1.2.375.0 is much older than that, as 3-Space C API 2.0.5 Beta was released 8/30/2013...

So I updated the Threespace_API.dll in the FreePIE lib directory to 2.0.5 Beta but still no dice... tss_getComPorts is still returning 0. :cry:

For what it's worth, the latest Python API, ThreeSpace_API_Python_2.0.0.4 BETA, does work with the same sensor and same firmware.

Code: Select all

device_list = ts_api.getComPorts(filter=ts_api.TSS_FIND_ALL_KNOWN)
com_port = device_list[0]
This successfully retrieves the appropriate device and COM port for my 3-space Bluetooth sensor.

However, the Python API is not a simple wrapper of the C API like the C# wrapper being used by FreePIE, so this doesn't say anything much.

I think there is a bug in the 3-Space C API 2.0.5 Beta... tss_GetComPorts is failing to detect YEI 3-space Bluetooth (TSS-BT) sensors. Not even TssFind.TSS_FIND_BT works.

User avatar
baggyg
Vireio Perception Developer
Vireio Perception Developer
Posts: 491
Joined: Sat May 19, 2012 5:20 am
Which stereoscopic 3D solution do you primarily use?: S-3D HDTV
Location: BB, Slovakia

Re: YEI 3-Space Sensor and FreePIE

Post by baggyg »

Sounds quite similar to Arti's in that it is not returning any device IDs and a known issue with the API.

Lets hope for an update from YEI soon. Well done for diagnosing this kzoink.

kzoink
One Eyed Hopeful
Posts: 28
Joined: Thu Apr 11, 2013 6:59 am

Re: YEI 3-Space Sensor and FreePIE

Post by kzoink »

So I was talking with RoadKillGrill this morning and between us we managed to get a few steps ahead of where I was last night.

Long story short, the device auto detection for 3-space Bluetooth (TSS-BT) devices in the Threespace C API 2.0.5 Beta does not seem to be working correctly on Windows 8 x64. RoadKillGrill said it has been tested to work on Win 7 and Vista, however.

So I decided to fudge the device detection by changing the filter to TSS_FIND_UNKNOWN. The first detected device was the wrong one (I have another Bluetooth SPP device on this system which shows up as COM 4), but the TssComPort array contained all the COM ports on the system, so I fudged it some more by feeding the appropriate port (COM 3) into tss_createTSDeviceStr with a small code change.

Creating the device seemed to work and the appropriate deviceId was returned (0x08000000, which corresponds to TSS_BLUETOOTH_ID).

Unfortunately, after that, a crash due to writing to protected memory occurred on the following line:

Code: Select all

tss_getSerialNumber((int)deviceId, out serial);
But I figured out what the cause of the crash was--FreePIE 1.2.375.0 doesn't play well with the new Threespace C API 2.0.5 Beta. I reverted to the original ThreesSace_API.dll included with FreePIE 1.2.375.0 and with the small code change I made to the FreePIE 3-space plugin, I'm now able to successfully stream data from my 3-space Bluetooth to FreePIE.

ChrisAtYeiTech
One Eyed Hopeful
Posts: 11
Joined: Tue Sep 10, 2013 10:39 am

Re: YEI 3-Space Sensor and FreePIE

Post by ChrisAtYeiTech »

Arti-
There is a typo in the API.cs file of the YEI FreePIE plugin. You will need to change the lines:

Code: Select all

//I am assuming that sensor type 4 is a dongle. Someone will have to test this who have the wireless version
if (ports[index].sensor_type == 4)
to this:

Code: Select all

//I am assuming that sensor type 3 is a dongle. Someone will have to test this who have the wireless version
if (ports[index].sensor_type == 3)
This will allow you to use the wireless sensor through USB. However, there is still an issue with wireless communication but it does not crash FreePIE with this fix, just errors with "Could not create device".
I believe the issue is that the dll being used has a bug when creating wireless sensors through the dongle. So we are going to have to find out why the new dll is not working with FreePIE to solve this problem.

Kzoink-
Thanks for noting the issue with our new dll with FreePIE.

CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: YEI 3-Space Sensor and FreePIE

Post by CyberVillain »

Awsome work guys!
Are there any changes to the header file that breaks the contract with the new dll?

ChrisAtYeiTech
One Eyed Hopeful
Posts: 11
Joined: Tue Sep 10, 2013 10:39 am

Re: YEI 3-Space Sensor and FreePIE

Post by ChrisAtYeiTech »

There are some name changes, new functions, and removal/additions of enums that are in the new 2.0.5 dll.
A more complete list is on our community forum here http://forum.yeitechnology.com/viewtopic.php?f=12&t=27

We are going to be working on the plugin and will have an update within the next few weeks ;)

User avatar
baggyg
Vireio Perception Developer
Vireio Perception Developer
Posts: 491
Joined: Sat May 19, 2012 5:20 am
Which stereoscopic 3D solution do you primarily use?: S-3D HDTV
Location: BB, Slovakia

Re: YEI 3-Space Sensor and FreePIE

Post by baggyg »

kzoink wrote:So I was talking with RoadKillGrill this morning and between us we managed to get a few steps ahead of where I was last night.

Long story short, the device auto detection for 3-space Bluetooth (TSS-BT) devices in the Threespace C API 2.0.5 Beta does not seem to be working correctly on Windows 8 x64. RoadKillGrill said it has been tested to work on Win 7 and Vista, however.

So I decided to fudge the device detection by changing the filter to TSS_FIND_UNKNOWN. The first detected device was the wrong one (I have another Bluetooth SPP device on this system which shows up as COM 4), but the TssComPort array contained all the COM ports on the system, so I fudged it some more by feeding the appropriate port (COM 3) into tss_createTSDeviceStr with a small code change.

Creating the device seemed to work and the appropriate deviceId was returned (0x08000000, which corresponds to TSS_BLUETOOTH_ID).

Unfortunately, after that, a crash due to writing to protected memory occurred on the following line:

Code: Select all

tss_getSerialNumber((int)deviceId, out serial);
But I figured out what the cause of the crash was--FreePIE 1.2.375.0 doesn't play well with the new Threespace C API 2.0.5 Beta. I reverted to the original ThreesSace_API.dll included with FreePIE 1.2.375.0 and with the small code change I made to the FreePIE 3-space plugin, I'm now able to successfully stream data from my 3-space Bluetooth to FreePIE.
Hi nice going. Glad you finally getting some results out. Is there no way to loop through the tsscomports to identify if the device is a YEI sensor or not? Obviously the end goal is to update FreePIE with support for the bluetooth and wireless versions, although it sounds like we need to wait on some updates to the dll first (especially for the wireless).

What do you plan to use your sensor for? Would be interested to hear your results. I use mine with a HMZ ski google mod for headtracking, either via mouse emulation or SharedMemoryTracker (Virieo).

kzoink
One Eyed Hopeful
Posts: 28
Joined: Thu Apr 11, 2013 6:59 am

Re: YEI 3-Space Sensor and FreePIE

Post by kzoink »

baggyg wrote: Hi nice going. Glad you finally getting some results out. Is there no way to loop through the tsscomports to identify if the device is a YEI sensor or not? Obviously the end goal is to update FreePIE with support for the bluetooth and wireless versions, although it sounds like we need to wait on some updates to the dll first (especially for the wireless).
I think there are a couple ways to do the device detection. The first way is to iterate through the available COM ports and retrieve information from the OS about them. I think that's the YEI approach and that's what they're doing in their C API. That's how we are able to feed filters into tssGetComPorts and only see the appropriate devices. Unfortunately, as noted, there's a bug in the current version preventing detection of the 3Space Bluetooth with this method, so I had to work around it temporarily. The second way is to write data to all the available ports and check for an expected response. The latter method is really bad since it could mess with other devices on the system. You are correct in that I think it will be best to wait for YEI to update the C API so we can use the C# wrapper around the API as intended. I think any other solution would be a kludge. We could loop through all ports retrieved with TSS_FIND_UNKNOWN as a workaround but since YEI has been kind enough to give this thread some attention and promise to take a look at the code, there's no need to do that.
baggyg wrote:What do you plan to use your sensor for? Would be interested to hear your results. I use mine with a HMZ ski google mod for headtracking, either via mouse emulation or SharedMemoryTracker (Virieo).
I'm currently engaged in the development of a motion tracking gaming peripheral and using the YEI device for research purposes.

Thanks for your work on the YEI plugin, baggyg!

arti
One Eyed Hopeful
Posts: 33
Joined: Tue May 26, 2009 11:31 am

Re: YEI 3-Space Sensor and FreePIE

Post by arti »

[quote="ChrisAtYeiTech"]Arti-
There is a typo in the API.cs file of the YEI FreePIE plugin. You will need to change the lines:

Code: Select all

//I am assuming that sensor type 4 is a dongle. Someone will have to test this who have the wireless version
if (ports[index].sensor_type == 4)
to this:

Code: Select all

//I am assuming that sensor type 3 is a dongle. Someone will have to test this who have the wireless version
if (ports[index].sensor_type == 3)
This will allow you to use the wireless sensor through USB. However, there is still an issue with wireless communication but it does not crash FreePIE with this fix, just errors with "Could not create device".
I believe the issue is that the dll being used has a bug when creating wireless sensors through the dongle. So we are going to have to find out why the new dll is not working with FreePIE to solve this problem.

Thanks Chris, but I'm not a developer and I don't know where I can to find the API.cs file for change the parameter, If you help me I can follow it and learn.

Also I hope I can use the wireless versión when you change the dll.
If I have several sensor attached to the dongle I understand that I could access with this form: yei[0][0], yei[0][1], etc, and go on.

Thanks for your effort.

RoadKillGrill
Cross Eyed!
Posts: 119
Joined: Tue Oct 09, 2012 2:36 pm
Location: Ohio
Contact:

Re: YEI 3-Space Sensor and FreePIE

Post by RoadKillGrill »

Hey guys, I'm back :p
I have had a chance to look over and update the 3-Space Plugin.

It now uses the newest API dll and does work with one wireless sensor. The Bluetooth detection does work in freepie with windows 7, I will try a windows 8 machine when I find one.

However the current system for using yei devices needs to be reworked.
  • There is no way to know or assign which sensor is the first sensor
    If the sensors are plugged in different ports or additional sensors are plugged the indexes will change
    sensors plugged via serial will not detect and can not be used (no way to force it to use a known comport)
    multiple wireless sensors pose a special case that the current model doesn't handle well (sub indexing the breaks the code compatibility with wired and is also not how the current implementation works at all)
I think that adding properties to the 3-Space Plugin to configure the indexes might be the best option but the problem is that this can be done a few ways:
  • Associate a sensor serial number with the index
    • ( ex: sensor with serial 02000001 will always be yei[0], if there is a dongle its logical table will be scanned and used if wired sensors with matching serial wasn't found first.)
    Associate a comport and logical id with the index
    • ( ex: "COM7" logical_id: 0 will always be yei[0] if the comport is a dongle the logical id will be used to denote which sensor on the dongle)
I can see both these methods being useful in different ways.

I'd like to see how everyone else would like to see this being handled, it will be less automatic than it was but will be much better for multi sensor setups.

CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: YEI 3-Space Sensor and FreePIE

Post by CyberVillain »

Cant you sort the devices on serialnumber?

SN xxxxx01 will be index 0
SN xxxx201 will be index 1

etc

This way index will only change if you add a device

edit: Great work by the way :D

RoadKillGrill
Cross Eyed!
Posts: 119
Joined: Tue Oct 09, 2012 2:36 pm
Location: Ohio
Contact:

Re: YEI 3-Space Sensor and FreePIE

Post by RoadKillGrill »

CyberVillain wrote:Cant you sort the devices on serialnumber?
I thought about that but it would make it hard to replace sensors in a setup if the lower serial needs to be swapped out for charging or something as you would need to change the position of the other sensors or change the script to fix it.

That solution does scale better as it wouldn't impose an artificial limit on the amount of sensors that could be used Hmm. This is why I wanted a some feedback on this before I committed one method. :D

I'm working on adding an option to get the button states of the sensors and maybe adding get/set for LED colors right now.

CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: YEI 3-Space Sensor and FreePIE

Post by CyberVillain »

Currently the plugin property system does not support a collection of propeties, it can be worked aound with the current system, but its not pretty. So I would like a solution that does not involve plugin properties, but if it cant be avoided then we can work something out.

edit: I think its a pretty fair trade off that you might need to change index if you add a device.
If you do not index the plugin directly but rather use a variable you can easy change that variable

like

Code: Select all

if starting:
   index = 0
   diagnostics.watch(yei[index].yaw)
   etc...

kzoink
One Eyed Hopeful
Posts: 28
Joined: Thu Apr 11, 2013 6:59 am

Re: YEI 3-Space Sensor and FreePIE

Post by kzoink »

I would personally prefer to have the YEI device associated with the lowest-numbered COM port as index 0 and the rest numbered from there.

That way seems fairly intuitive to me.

RoadKillGrill
Cross Eyed!
Posts: 119
Joined: Tue Oct 09, 2012 2:36 pm
Location: Ohio
Contact:

Re: YEI 3-Space Sensor and FreePIE

Post by RoadKillGrill »

Alright I made a fork and added my commits here https://github.com/YEITechnology/FreePIE

The yei object now exposes the buttons (button0, button1)
I added a few plugin options to the plugin:
  • Stream Button State: Enables streaming of the sensor button states
    Poll Unknown Devices: Writes bytes to serial ports to find 3-Space devices not listed in registry (this should be a temp fix for the Bluetooth finder too)
    Device0 1 2... : By default this is zero. If it is zero it will enumerate by lower serial first. Placing a serial there will force an index to pair with a certain sensor. indexes beyond 5 will use the serial sorted method
Whats neat with this implementation is that a wireless sensor can be wired or wireless without changing the script or plugin properties.
This should make it easier to transfer setups between machines and still get a consistent results.
It can support multiple sensors now as well.

This is the first pass on it (and my first time using github) let me know what you guys think and report any bugs you find.
You do not have the required permissions to view the files attached to this post.

CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: YEI 3-Space Sensor and FreePIE

Post by CyberVillain »

Nice work!

I pulled your changes into a branch called YeiChanges

https://github.com/AndersMalmgren/FreeP ... YeiChanges

I also change the settings part so that the number of devies is dynamic.

Guys please test RoadKillGrill's changes, if it works for you I will merge it into master

Thanks.

User avatar
baggyg
Vireio Perception Developer
Vireio Perception Developer
Posts: 491
Joined: Sat May 19, 2012 5:20 am
Which stereoscopic 3D solution do you primarily use?: S-3D HDTV
Location: BB, Slovakia

Re: YEI 3-Space Sensor and FreePIE

Post by baggyg »

@RoadKillGrill
Great work. I am currently traveling abroad for work but should be able to do some testing with my USB YEI next week.

CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: YEI 3-Space Sensor and FreePIE

Post by CyberVillain »

Is this ok to pull into master?

User avatar
baggyg
Vireio Perception Developer
Vireio Perception Developer
Posts: 491
Joined: Sat May 19, 2012 5:20 am
Which stereoscopic 3D solution do you primarily use?: S-3D HDTV
Location: BB, Slovakia

Re: YEI 3-Space Sensor and FreePIE

Post by baggyg »

Just downloaded and tested. All features working fine (although only testing with USB version which worked anyway).
Couple of small notes / questions....
Is there any reason not to stream the buttons all the time?
Has the tareSensor changed at all? At some point it would be great if we could update this to use a similar approach to the UDK whereby it takes into account when the sensor is not properly placed.

P.s.
@RoadKillGrill - Just backed PrioVR - good luck with the project and looking forward to seeing the results.

RoadKillGrill
Cross Eyed!
Posts: 119
Joined: Tue Oct 09, 2012 2:36 pm
Location: Ohio
Contact:

Re: YEI 3-Space Sensor and FreePIE

Post by RoadKillGrill »

baggyg wrote: Is there any reason not to stream the buttons all the time?
Has the tareSensor changed at all?
Adding the button state increases the stream packet size, not noticeable on wired but with wireless its additional traffic that might reduce throughput by a tiny amount.
I was thinking about adding acceleration data as a stream option as well later on which does nearly double the packet size making it optional when its not needed would likely be preferred.

I haven't changed the tare yet, it might be a few weeks until I revisit the plugin again to add it. I was more worried about getting it to work and forgot about that completely.
I'm currently working on making a basic C# wrapper for the whole API which will then be used in FreePIE and other C# engines like Unity. I'm planning on revisiting the plugin once that is completed and stable but that might be after the Kickstarter as there is many other tasks at the moment.

Thank you for supporting our project, every little bit helps :D

CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: YEI 3-Space Sensor and FreePIE

Post by CyberVillain »

Maybe we should throw a error if the button states are used from script without having the options set?

RoadKillGrill
Cross Eyed!
Posts: 119
Joined: Tue Oct 09, 2012 2:36 pm
Location: Ohio
Contact:

Re: YEI 3-Space Sensor and FreePIE

Post by RoadKillGrill »

I made a quick weekend project using FreePIE and HL2
http://www.youtube.com/watch?v=IXPaxUfnMr4
Just added -vr to the launch options
I adjusted the vr_moveaim_reticle_yaw_limit and vr_moveaim_reticle_pitch_limit to 90 so that the mouse wouldn't drag the rift left and right

And here's the script:

Code: Select all

#FreePie Script for YEI 3-Space Sensor
def update():	
	diagnostics.watch(yei[0].yaw)
	diagnostics.watch(yei[0].pitch)
	diagnostics.watch(yei[0].roll)
	# Axis directions used (X: Left, Y: Back, Z: Up) Negative X, Y
	x =	 yei[0].yaw
	y = yei[0].roll
	
	delta_x = filters.delta(filters.continousRotation(x))
	delta_y = filters.delta(filters.continousRotation(y))
	
	if tracker_mouse:
		mouse.deltaX = delta_x * multiply
		mouse.deltaY = delta_y * multiply
		mouse.leftButton = yei[0].button0
   
if starting:
	multiply = 1000
	tracker_mouse = False
	yei[0].update += update
	
tare_sensor = keyboard.getPressed(Key.T)

toggle = keyboard.getPressed(Key.O)

if toggle:
	tracker_mouse = not tracker_mouse
	
if tare_sensor:
	yei[0].tareSensor()

CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: YEI 3-Space Sensor and FreePIE

Post by CyberVillain »

Nice! I wish all games used the FreePIE IO mechanism so that you could send absolute coordinates to it!

edit: If you add this to the starting closure how does that change the performance of the sensor fusion?

Code: Select all

system.setThreadTiming(TimingTypes.HighresSystemTimer)
system.threadExecutionInterval = 1
It will make FreePIE execute the script at 1000hz instead of 64hz

3dvison
Diamond Eyed Freakazoid!
Posts: 718
Joined: Sun Oct 24, 2010 7:25 pm

Re: YEI 3-Space Sensor and FreePIE

Post by 3dvison »

RoadKillGrill wrote:I made a quick weekend project using FreePIE and HL2
http://www.youtube.com/watch?v=IXPaxUfnMr4
Just added -vr to the launch options
I adjusted the vr_moveaim_reticle_yaw_limit and vr_moveaim_reticle_pitch_limit to 90 so that the mouse wouldn't drag the rift left and right
What Gun is that you are using that fits the YEI so perfect ?

RoadKillGrill
Cross Eyed!
Posts: 119
Joined: Tue Oct 09, 2012 2:36 pm
Location: Ohio
Contact:

Re: YEI 3-Space Sensor and FreePIE

Post by RoadKillGrill »

3dvison wrote: What Gun is that you are using that fits the YEI so perfect ?
Its a Nyko Perfect Shot with a 3d printed holder to fill the rest of the wiimote cavity. I'm guessing the holder might work on other wii accessories too. Tho looking it online its somehow become hard to find.

I can get you the model file if you want it.

@CyberVillain I'll try it later and see how it goes :mrgreen:

3dvison
Diamond Eyed Freakazoid!
Posts: 718
Joined: Sun Oct 24, 2010 7:25 pm

Re: YEI 3-Space Sensor and FreePIE

Post by 3dvison »

RoadKillGrill wrote:
3dvison wrote: What Gun is that you are using that fits the YEI so perfect ?
Its a Nyko Perfect Shot with a 3d printed holder to fill the rest of the wiimote cavity. I'm guessing the holder might work on other wii accessories too. Tho looking it online its somehow become hard to find.

I can get you the model file if you want it.
Thank you RoadKillGrill,
but I have no 3d printer.

nosys70
One Eyed Hopeful
Posts: 2
Joined: Tue Apr 15, 2014 5:48 pm

Re: YEI 3-Space Sensor and FreePIE

Post by nosys70 »

hello
I am on the edge to order an YEI sensor, but I got a question about which wireless is the best.
According comments found, the Bluetooth is supposed to be slower than the wireless (but the specs listed on the site shows the contrary).
It also seems the specs indicates maximum rates about 200-250 Hz) , so the question is what reallife number can we expect, and what could make it go lower or higher ( distance, noise, temperature, number of devices ?).
I got a preference for wireless since it also allows wired USB and the dongle supports up to 15 device.
It seems also that wireless is more finicky , so going wired could also be an option especially you can easily buy 3 wired for one wireless.
the goal is to to provide positioning into an Virtuix Omni .


thanks for your help

Post Reply

Return to “FreePIE”