YEI 3-Space Sensor and FreePIE

Official forum for open source FreePIE discussion and development.
User avatar
baggyg
Vireio Perception Developer
Vireio Perception Developer
Posts: 491
Joined: Sat May 19, 2012 5:20 am
Location: BB, Slovakia

Re: YEI 3-Space Sensor and FreePIE

Post by baggyg »

nosys70 wrote: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
To be honest I think simply buying a single sensor at this stage is probably a bad idea. I would instead look to go for their PrioVR system since this is being actively developed for low latency / high frequency and is also wireless. People on the forums have already theorized that Priovr will be the best way to bridge the gap betweek DK2 positional tracking and Omni.
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 have a problem. When I run a script that references to yei3 sensor, if you don't have the sensor connected directly freepie program closes giving error FreePIE.GUI stopped working. Is there any way around it?. Sometimes is interesting try the script without having connected the sensor. The script is for example the classic as follows:

def update():
diagnostics.watch(yei[0].yaw);
diagnostics.watch(yei[0].pitch);
diagnostics.watch(yei[0].roll);
diagnostics.watch(yei[0].button0);
diagnostics.watch(yei[0].button1);

if starting:
yei[0].update += update

if yei[0].button1:
yei[0].tareSensor()

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 »

Sounds like its the C library crashing and taking CLR withit. Will have to check. But I dont know if I dare to change code for that part of FreePIE since I dont have the hardware and can test
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 »

That is strange, on my dev machine I get

No YEI3 Space devices connected! without crash

And on my gamer mahcine I get crash
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 »

Ah, in debug it catches and shows the problem without crash.

In release mode it just crashes.

baggyg or RoadKillGrill what do you think?
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 »

Ill check it out next week. I'm in San Francisco this week.
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 to both.

Regards.
metronome
Cross Eyed!
Posts: 114
Joined: Sat Mar 16, 2013 12:42 pm

Re: YEI 3-Space Sensor and FreePIE

Post by metronome »

I have an android smartwatch which im assuming will work very much the same way as this thing... the watch supports bluetooth and has axis, gyros etc... anyway I can use it as a hand gesture tracking thingy??
arti
One Eyed Hopeful
Posts: 33
Joined: Tue May 26, 2009 11:31 am

Re: YEI 3-Space Sensor and FreePIE

Post by arti »

RoadKillGrill wrote:Ill check it out next week. I'm in San Francisco this week.
Hello RoadKillGrill, if you can could you check the crash for see what is the problem?
Many thanks.
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 wrote:Hello RoadKillGrill, if you can could you check the crash for see what is the problem?
Many thanks.
Hi arti, I'm sad to say that RoadKillGrill has left YEI Technology and did not have time to look into this issue. I have ran a YEI build for FreePIE in both debug and release from the source files, and did not get a crash when no sensors where connected. I just got the "No YEI3 Space devices connected!" error.
CyberVillain wrote:That is strange, on my dev machine I get

No YEI3 Space devices connected! without crash

And on my gamer mahcine I get crash
CyberVillain, does your gamer machine have visual studio or any of the redists that visual studio installs?
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 »

It has VC++ redist 2010 11 and 13 no VS installed

I will try and see if still get the same result
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 »

I found the bug, I cant understand why it did not crash on my old dev machine, its a null reference bug, so shouldnt have worked on any machine :D


https://github.com/AndersMalmgren/FreeP ... ec243658a8
arti
One Eyed Hopeful
Posts: 33
Joined: Tue May 26, 2009 11:31 am

Re: YEI 3-Space Sensor and FreePIE

Post by arti »

Thanks Cyber,
Other question, I see that I can output the pitch, yaw and roll, and the two buttons of the Yei sensor.
But how can access to the three accelerometer axis (x,y,z) and the magnetic sensor?
I believe that for replicate any real movements is necesary to mix the signal of the gyros and the acelerometers for example for see if any person go crouch or prone.

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 »

For that we would need to expose those values
arti
One Eyed Hopeful
Posts: 33
Joined: Tue May 26, 2009 11:31 am

Re: YEI 3-Space Sensor and FreePIE

Post by arti »

Also I see that, I believe, with the last firmware of the Yei sensors, the access to the two buttons not function. I you put:
diagnostics.watch(yei[0].button0);
diagnostics.watch(yei[0].button1);
the state always is False and you can't use the buttons in Freepie. I believe that in the old firmwares it runs ok ¿?

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

Re: YEI 3-Space Sensor and FreePIE

Post by arti »

One last question more, sorry:

I have two yei3 sensors, yei[0] and yei[1]. If I use both in my script but I want to control what sensor is switch on I put:
if yei[1]:
sentence
but if the sensor is switch off appear:
Failed to create deviceId from wireless sensor
and the script not run¿?

Thanks.
User avatar
baggyg
Vireio Perception Developer
Vireio Perception Developer
Posts: 491
Joined: Sat May 19, 2012 5:20 am
Location: BB, Slovakia

Re: YEI 3-Space Sensor and FreePIE

Post by baggyg »

arti wrote:One last question more, sorry:

I have two yei3 sensors, yei[0] and yei[1]. If I use both in my script but I want to control what sensor is switch on I put:
if yei[1]:
sentence
but if the sensor is switch off appear:
Failed to create deviceId from wireless sensor
and the script not run¿?

Thanks.
If only the wirelss sensor is plugged in and you reference it as yei[0] does it work?
arti
One Eyed Hopeful
Posts: 33
Joined: Tue May 26, 2009 11:31 am

Re: YEI 3-Space Sensor and FreePIE

Post by arti »

Both sensor are wireless. In my code I have references to the yei[0] and yei[1]. If both are conected all run ok.
but if any of two sensors aren't connected then the script fail.
I want control in the same code that if any of the sensor are disconnected the other yei sensor can funtion and the script not fail.
Thanks.
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 Chris, can you help us with those questions:
https://github.com/AndersMalmgren/FreePIE/issues/37
https://github.com/AndersMalmgren/FreePIE/issues/38
Thanks.
ChrisAtYeiTech wrote:
arti wrote:Hello RoadKillGrill, if you can could you check the crash for see what is the problem?
Many thanks.
Hi arti, I'm sad to say that RoadKillGrill has left YEI Technology and did not have time to look into this issue. I have ran a YEI build for FreePIE in both debug and release from the source files, and did not get a crash when no sensors where connected. I just got the "No YEI3 Space devices connected!" error.
CyberVillain wrote:That is strange, on my dev machine I get

No YEI3 Space devices connected! without crash

And on my gamer mahcine I get crash
CyberVillain, does your gamer machine have visual studio or any of the redists that visual studio installs?
81t-80m83r
One Eyed Hopeful
Posts: 7
Joined: Sat Nov 22, 2014 4:21 am

Re: YEI 3-Space Sensor and FreePIE

Post by 81t-80m83r »

baggyg wrote:
FreePIE.Core.Plugins.rar
OK, sorry for delay, had another marshalling issue (I think) with the streaming that was causing VS debugger to crash. Figured this out and streaming works through VS2012 but every time I run through a built version it crashes.

Check out the new Update function is combination with getLastStreamData and the new TssStreamPacket struct. Any thoughts on why its crashing as a binary would be greatly appreciated.

I have therefore set it so that upon initially connecting streaming is not turned on (and added two functions for starting and stopping it). The polling method works great though. I have also added the code for wireless sensors but have not been able to test this.

I have overloaded the Udate method in Quaternon as it was easy to do and wont then break everyones android scripts.

Test Script

Code: Select all

def update():
	diagnostics.watch(yei[0].yaw);
	diagnostics.watch(yei[0].pitch);
	diagnostics.watch(yei[0].roll);	
	
	yaw = yei[0].yaw
   	pitch = yei[0].pitch
   	deltaYaw = filters.delta(yaw)
   	deltaPitch = -filters.delta(pitch)   
   	if math.fabs(deltaYaw) >= math.pi:
   		deltaYaw = 0
   	
   	#MouseLook
	mouse.deltaX = deltaYaw*g_YEIMultiplier
	mouse.deltaY = deltaPitch*g_YEIMultiplier
		
if starting:
	#USB Version with cable at back. 
	#Default Axis Properties: X: Forward, Y: Right, Z: Up
	g_YEIMultiplier = 500
	yei[0].update += update
	
if keyboard.getKeyDown(Key.Q):
	yei[0].stopStreaming()
if keyboard.getKeyDown(Key.W):
	yei[0].startStreaming()

Hey Baggyg! I know this is old but whenever I try to run this script in freePie all I get is:"The given key was not present in the dictionary." Do you know why this happens? I'm at such a loss, I've been at this for days, used many scripts, tried making my own simple scripts but I always get this same error. ARGARARGHGH! :p Could this possibly be related to the firmware of my 3 space sensor? i have the latest version of freePie......stumped.
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 »

"The given key was not present in the dictionary" comes from something going wrong in filters.delta
But I cant see what that would be :/
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 »

Loking again, it could also be something wrong with your settings file. Please try to remove your settinings xml found under %appdata%\FreePIE

Do not delete it, I might need it for testing purpose.

Try again
81t-80m83r
One Eyed Hopeful
Posts: 7
Joined: Sat Nov 22, 2014 4:21 am

Re: YEI 3-Space Sensor and FreePIE

Post by 81t-80m83r »

Hmmm Now I'm getting device not found. If i go to settings/plugins/Yei 3 Space in freepie and change device 0 to 1, I get the key error again, this time on line 5. I had to run the code through a python formatter online because I was getting all kinds of indent errors so it now looks like this:

def update():
....diagnostics.watch(yei[0].yaw)


diagnostics.watch(yei[0].pitch)
diagnostics.watch(yei[0].roll)

yaw = yei[0].yaw
pitch = yei[0].pitch
deltaYaw = filters.delta(yaw)
deltaPitch = -filters.delta(pitch)
if math.fabs(deltaYaw) >= math.pi:
....deltaYaw = 0

# MouseLook

mouse.deltaX = deltaYaw * g_YEIMultiplier
mouse.deltaY = deltaPitch * g_YEIMultiplier

if starting:

# USB Version with cable at back.
# Default Axis Properties: X: Forward, Y: Right, Z: Up

....g_YEIMultiplier = 500
yei[0].update += update

if keyboard.getKeyDown(Key.Q):
....yei[0].stopStreaming()
if keyboard.getKeyDown(Key.W):
....yei[0].startStreaming()

the dots just represent where it's indented.
Last edited by 81t-80m83r on Sat Nov 22, 2014 3:01 pm, edited 1 time in total.
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 »

Unless you have two or more sensors you shouldn't need to change the device index.
81t-80m83r
One Eyed Hopeful
Posts: 7
Joined: Sat Nov 22, 2014 4:21 am

Re: YEI 3-Space Sensor and FreePIE

Post by 81t-80m83r »

RoadKillGrill wrote:Unless you have two or more sensors you shouldn't need to change the device index.
Ok, I was just experimenting everything is back to default, also this is a brand new installation on a freshly wiped windows 7 machine. lol i wiped it because i was getting the same errors before. i've been messing with drivers like mad the past week trying to get a ps move functioning with no luck, wanted to start fresh for the 3 space tracker :P

Not sure is this is helpful or not but I tried running the script with the 3 space sensor suite open and connected to my tracker (which i think is a no no) and it gives me the error: "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

says the error happens on line 5

But yeah, now it seems to just say "Device not found" consistently now. I'm going to keep trying different things. My 3 space sensor is the v1.0 type if that matters at all.

*EDIT* So I went through the script and changed all of the yei[0]'s to yei[1]'s and now i'm getting the key error again. On line 5 it says
81t-80m83r
One Eyed Hopeful
Posts: 7
Joined: Sat Nov 22, 2014 4:21 am

Re: YEI 3-Space Sensor and FreePIE

Post by 81t-80m83r »

CyberVillain wrote:Loking again, it could also be something wrong with your settings file. Please try to remove your settinings xml found under %appdata%\FreePIE

Do not delete it, I might need it for testing purpose.

Try again
Also Cyber, removing the settings file made no difference.
81t-80m83r
One Eyed Hopeful
Posts: 7
Joined: Sat Nov 22, 2014 4:21 am

Re: YEI 3-Space Sensor and FreePIE

Post by 81t-80m83r »

I went to YEI's site and downloaded the latest three space api and put the api dll into freepie, now when i try to run the script it tells me that g_YEIMultiplier is not defined. guess it's time to go learn a programming language. lol
81t-80m83r
One Eyed Hopeful
Posts: 7
Joined: Sat Nov 22, 2014 4:21 am

Re: YEI 3-Space Sensor and FreePIE

Post by 81t-80m83r »

Ok so I got it working guys, here's the link to my subreddit post if you or anyone else is interested in getting it working. It's not baggy's code, I just couldn't get that to work. Anyway, I couldn't have made this little tutorial without reading over your conversations so.....THANKS!!!

http://www.reddit.com/r/oculus/comments ... sensor_to/
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 »

Glad you got it working, sad I didnt find out what the "The given key was not present in the dictionary"-error was about. I added logging to the part that I suspect was the problem. But since updating dll helpt I guess it was something else.

So its safe for me to update the API in freepie?
81t-80m83r
One Eyed Hopeful
Posts: 7
Joined: Sat Nov 22, 2014 4:21 am

Re: YEI 3-Space Sensor and FreePIE

Post by 81t-80m83r »

By my accounts, yes I'd say it is Cyber. Thanks again!
Post Reply

Return to “FreePIE”