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

YEI 3-Space Sensor and FreePIE

Post by arti »

Hello, there is any project to implement support in FreePIE for the YEI 3-Space Sensor?
I believe that in this moment the best tracker is the Yei 3 due the lack of drift and good price for a head tracker.

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 »

Hi arti. I can't buy every tracker myself so we either need to find a developer that has the tracker and that wants to do a plugin for FreePIE, or get the company behind it to send me one. I think one of the guys behind the tracker is active at this forum, maybe he can send me one or if they can make the plugin themself.
User avatar
Namielus
Certif-Eyable!
Posts: 957
Joined: Thu Aug 02, 2012 8:49 am
Location: Norway
Contact:

Re: YEI 3-Space Sensor and FreePIE

Post by Namielus »

RoadKillGrill works at YEI. In any case I am probably going to get some YEI's myself when I make the final decision on how to do full body tracking.

Then I can probably let you borrow it, you are just a short flight away
Riftoholic

My precious 6 month project the Oculus Virtual Lounge:
Image
If you help me in any way I will be forever grateful.
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 Cybervillain, I have the wireless version of the YEI tracker but I don't be an good developer.
In the last years I used the tracker of the Z800 googles with Glovepie and convert to TrackIr for use in the Armed Assault game with very good results. But when I find the YEI sensor and I probe it I see that it's the best sensor for this purpose, then I find also the FreePIE and it's possibilities to send the signal to trackir or freetrack.

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 »

Check out here in a week or so maybe we can find someone that can whip up a plugin, it looks like a popular tracker these days, so its just a matter of time before someone takes the time to make a Plugin for it
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, if anyone wants to probe a plugin I can test it with my tracker.
And finally very good job with the FreePIE Cybervillain.

Greetings.
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, I'm still on the road between PAX and GDC.

I am planning to make a FreePIE plugin. Once GDC is over I will try to get one out in a week or two.
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 Roadkillgrill.
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 »

@Roadkillgrill

I do not know how well you know C# just FYI, since your lib is a static C lib you should be able to import the functions using the DllImport flag in C#

I see that you have structs like Comport etc, those should be possible to translate and then call from C# like

Code: Select all

        private enum TSS_Error
        {
            /**
            * \brief The API call successfuly executed.
            */
            TSS_NO_ERROR,
            /**
            * \brief The API call was made on a device type that does not suppport the attemped command.
            */
            TSS_INVALID_COMMAND,
            /**
            * \brief The TSS_ID parameter passed in to an API call is not associated with a connected 3-Space device.
            */
            TSS_INVALID_ID,
            /**
            * \brief The index passed into a Wireless Sensor API call is used to look up a sensor serial number for a given dongle. If either the index is not 0<= index < 15 (the valid range of the index) or the stored serial number is 0 (meaning no wireless sensor is assigned to the index) this error is returned.
            */
            TSS_INVALID_IDX,
            /**
            * \brief The API call executed had to fall back to an alternate implimentation to execute because the 3-Space device being used is on an old build of firmware. Firmware updating is suggested if this error is returned.
            */
            TSS_WARNING_OLD_FIRMWARE, // Function can complete but is emulated, upgrading is highly recomended
            /**
            * \brief The API call executed could not be completed because the connected 3-Space device has firmware that is too old to support the call. Firmware updating is suggested if this error is returned.
            */
            TSS_ERROR_OLD_FIRMWARE, // Function is not available on this firmware, update it
            /**
            * \brief When creating a 3-Space device that is connected over USB there was an issue communicating with the intended device.
            */
            TSS_ERROR_USB_CONNECTION,
            /**
            * \brief When creating a 3-Space device that is communicating through a 3-Space Dongle there was an issue communicating with the intended device.
            */
            TSS_ERROR_WIR_CONNECTION,
            /**
            * \brief The API call executed failed to write all the data necisary to execute the command to the intended serial port.
            */
            TSS_ERROR_WRITE,
            /**
            * \brief The API call executed failed to read all the data necisary to execute the command to the intended serial port.
            */
            TSS_ERROR_READ,
            /**
            * \brief no sensor found when looking for sensors
            */
            TSS_ERROR_NO_SENSOR_FOUND
        }

        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
        private struct Comport
        {
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
            public string Port;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
            public string FriendlyName;
            public TSS_Type Type;
        }
I tested with getFirstAvailableTSSComPort and it returns a error TSS_ERROR_NO_SENSOR_FOUND since I dont have a YEi3, import the function like

Code: Select all

[DllImport("ThreeSpace_API.dll", CallingConvention=CallingConvention.Cdecl)]
private static extern TSS_Error getFirstAvailableTSSComPort(out Comport port, int filter);
Use it like

Code: Select all

Comport port;
var error = getFirstAvailableTSSComPort(out port, 0);
Sorry if you know this info already, if not I hope it gave you some starters
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 »

Hi Guys,

I wanted to get one of these to try and get a plugin working and mount on a HMZ. However shipping is $48 to Europe which is very hefty. Does anyone know if there is a European supplier of these?

Thanks
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 »

Here is a link to our distributers http://www.yeitechnology.com/yei-3-spac ... stributors

Quick update on this plugin Ive been busy getting the new apis ready and this got pushed back. I will try to get to it soon as I can. Ive not forgotten about it dont worry.
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 »

RoadKillGrill wrote:Here is a link to our distributers http://www.yeitechnology.com/yei-3-spac ... stributors

Quick update on this plugin Ive been busy getting the new apis ready and this got pushed back. I will try to get to it soon as I can. Ive not forgotten about it dont worry.
Thanks, looks like the European distributor is just one company, but they don't have a product page for the YEI. I have e-mailed them directly to enquire.
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 »

RoadKillGrill wrote:Here is a link to our distributers http://www.yeitechnology.com/yei-3-spac ... stributors

Quick update on this plugin Ive been busy getting the new apis ready and this got pushed back. I will try to get to it soon as I can. Ive not forgotten about it dont worry.
@RoadKillGrill Just let me know if you need help with C# and FreePIE side of things. The FreePIE team is very keen on having this product supported since its a popular tracker
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 »

Hi RoadKillGrill,

Contacted your EU supplier but they just quoted to send me one from US. I really hoping to get one of these as soon as possible. I would perhaps stretch to paying the shipping charges but then am scared by what import duties will then apply (Slovakia) and what affect that will have on delivery time-scales. Do you have any experience on what these could be or an alternative to ordering through the US site?

This looks to be a great product but frustrating that I cannot get hold of one easily.
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 baggyg,
I'm sorry but I don't know much about international shipping :oops:. Could you contact sales@yostengineering.com
I'm sure we can get this to work.
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 »

RoadKillGrill wrote:Hey baggyg,
I'm sorry but I don't know much about international shipping :oops:. Could you contact sales@yostengineering.com
I'm sure we can get this to work.
Hi RoadKillGrill,

Managed to get my sensor recently, thanks for the advice. I bit the bullet and ordered from America. I was charged 36 eur import tax for anyone interested in similar. Its quite a bit to swallow (incl $48 delivery) but hopefully a European distributor is not too far away (The previous one had been removed from the distributor page).

My first impressions of the sensor are great. Very quick and accurate. Just downloading UDK at the moment so I can try some of the headtracking.

Do you have a revised ETA regarding the freePIE integration? I suppose currently I could map the joystick emulation to something...

Code: Select all

def update():
	vireioSMT.yaw = joystick[0].x //or similar (non tested)
        vireioSMT.pitch = joystick[0].y //or similar (non tested)
to use with Perception but this isnt much better than mouse emulation since we dont have access to the third axis for roll.

Would be brilliant if you could integrate this, would be more than willing to make some videos showing it working if you could.
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 »

Would love to help but dont have the tracker :/

If RoadKillGrill wont get back to you I could try to implement it and let you try it, but it will be ALOT of try and error
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 »

CyberVillain wrote:Would love to help but dont have the tracker :/

If RoadKillGrill wont get back to you I could try to implement it and let you try it, but it will be ALOT of try and error
Hopefully RoadKillGrill has this in hand. Otherwise I have a copy of Visual Studio 2012 here and downloaded the latest freePIE from the Github. I could do a lot of the fine tuning and testing but would need you to point me in the right direction on initial setup and linking to the DLL to get me started. There are some examples of integrating YEI into UDK on their site and also the API reference.
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 just released an updated API and I'm working on porting all existing demos to reflect the changes as well as work on a few custom projects, this has taken longer than I expected.

I will try to get a a chance to work on it before June, I'm sorry for the delays on this.

Speaking about UDK I'm editing the headtracking script as we speak. It should be done hopefully today if not some time this 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 »

Did a quick test, what does this output?

its the 2.0 API so needs the newest firmware
You do not have the required permissions to view the files attached to this post.
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 »

Code: Select all

Result: 1; Port: COM71; FriendlyName: 3 Space Wireless Sensor (COM71); SensorTyp
e: 4
Is that what its supposed to do?
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 »

RoadKillGrill wrote:

Code: Select all

Result: 1; Port: COM71; FriendlyName: 3 Space Wireless Sensor (COM71); SensorTyp
e: 4
Is that what its supposed to do?
you tell me :D But it looks allright :D

Qustion if I send in an comport array and set the size = nr of elements of array will it return all comports?
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: you tell me :D But it looks allright :D

Qustion if I send in an comport array and set the size = nr of elements of array will it return all comports?
Ya you can send it in an array and it will fill it in and return the amount it found. This is from the creating_class_instances.cpp in the examples directory

Code: Select all

	TSS_ComPort comport_list[20];
	int device_count =tss_getComPorts(comport_list,20,0,TSS_FIND_ALL_KNOWN);
	printf("Found %d Devices\n", device_count);
	for( unsigned int i=0; i< device_count; ++i){
		device =tss_createTSDeviceStr(comport_list[i].com_port, TSS_TIMESTAMP_SENSOR);
		if( device == TSS_NO_DEVICE_ID){
			printf("Failed to create a sensor on %s\n",comport.com_port);
		}
		else{
			if( tss_getSerialNumber(device,&serial, NULL) == TSS_NO_ERROR){
				printf("Port created successfully for sensor %x\n", serial);
			}
		}
		tss_closeTSDevice(device);
	}
O.o seen a typo in my examples I'll fix that :P
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 »

Thanks for info, is tss_getTaredOrientationAsQuaternion doing interupts, in other words can I call it from a loop without letting that thread take the entire CPU core?

Can you please try and see if tss_getTaredOrientationAsQuaternion is giving you results with this new test
You do not have the required permissions to view the files attached to this post.
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 »

Ya, that's spewing orientations, one thing to watch out is that the dongle while being a YEI device does not have has any of the orientation commands. For those you will want to get tss_getSensorFromDongle to get the wireless sensors that are paired to the dongle. Past creating the device the commands for them are identical.

I would recommend you look at the streaming example "getting_information_asynchronously.cpp" for a more efficient method of getting data.

You can also get the button and accelerometer data being sent as well as the orientation.

For this application tss_getLastStreamData should work. It will give you the last packet it got from the sensor so this can be called at the update rate of the application and it will always have data immediately for use.

tss_getLatestStreamData will block until there is new data from the sensor. This is more for data logging as it will only return when new data is available.

Lastly there is a callback method when new data arrives it calls that function, I'm not sure how well this function will wrap.
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 can create a branch on github, do all the freepie stuff and you can do the fine details on the yei stuff like pairing the wireless dongle etc. Sounds good?
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 »

Updated the firmware on my sensor and ran the program. Received the following:

Code: Select all

Result: 1; Port: COM6; FriendlyName: 3 Space Sensor (COM6); SensorType: 2
Erro: TSS_NO_ERROR; quat[0]: 0.2897289; quat[1]: -0.1202043; quat[2]: 0.07425822
; quat[3]: 0.9466223
Erro: TSS_NO_ERROR; quat[0]: 0.2897008; quat[1]: -0.1201742; quat[2]: 0.07423037
; quat[3]: 0.9466369
Erro: TSS_NO_ERROR; quat[0]: 0.2897008; quat[1]: -0.1201742; quat[2]: 0.07423037
; quat[3]: 0.9466369
So looking good. Once the branch is up I am happy to test anything you need this end.

@RoadKillGrill
I am having an odd problem when viewing through the general space sensor program. All looks good but when I put the sensor down (static) I get a fair amount of drift. I presume I can filter this out with the confidence settings. Could you provide any advice on the best settings you have found?

EDIT: After playing around for awhile I have noticed this completely disappears when I turn the compass readings off. I haven't had much success in turning this knowledge in confidence values so anything you can suggest would be very helpful.
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:I can create a branch on github, do all the freepie stuff and you can do the fine details on the yei stuff like pairing the wireless dongle etc. Sounds good?
I can look at it and tweak it once its up, thanks!!
baggyg wrote: I am having an odd problem when viewing through the general space sensor program. All looks good but when I put the sensor down (static) I get a fair amount of drift. I presume I can filter this out with the confidence settings. Could you provide any advice on the best settings you have found?

EDIT: After playing around for awhile I have noticed this completely disappears when I turn the compass readings off. I haven't had much success in turning this knowledge in confidence values so anything you can suggest would be very helpful.
First thing I'd change is both the Accelerometer and Compass to 15-1000, this is a much better baseline than the default settings. You can set the set the values rather high like the compass to something like 1000-10000 and it will still work but might take longer to recover if the gyros clip.

That sounds like there is something interfering with the sensor, the confidence values will help for temporary disturbances but eventually it will start to use the the compass reading or ignore it long enough that the gyros will start to drift. Ferrous materials can effect the compass, most sources are negligible after about 15cm.
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 »

RoadKillGrill wrote: First thing I'd change is both the Accelerometer and Compass to 15-1000, this is a much better baseline than the default settings. You can set the set the values rather high like the compass to something like 1000-10000 and it will still work but might take longer to recover if the gyros clip.

That sounds like there is something interfering with the sensor, the confidence values will help for temporary disturbances but eventually it will start to use the the compass reading or ignore it long enough that the gyros will start to drift. Ferrous materials can effect the compass, most sources are negligible after about 15cm.
Thanks for the advice. Doesnt hugely matter as very rarely is it dead still but will have a further play once I can get some head tracking working.

I am having some issues getting the sensor to work with UDK. Currently I have:
3-Space USB/RS232
Updated to latest firmware
Using Latest Software
All this appears to be working fine.

I installed UDK 2013-02 Version.
Following your instructions:
Install:
Put the *.uc files from the Classes folder in your Developement\Src\MyMod\Classes folder.
Copied the 2 uc files there
The dll must be in the C:\UDK\UDK-2012-05\Binaries\Win32\UserCode dir
Copied the DLL to this location
Edit your UTGame\Config\UTEngine.ini file to remove the semicolon from the line that says ModEditPackages=MyMod if it doen't exist add it
I presume here you mean UDKEngine.ini? I could not find a UTEngine.ini at all. I edited UDKEngine.ini and pasted "ModEditPackages=MyMod" at the top below the [url] branch.
Recompile scripts and then launch UDK.exe, for example UDK.exe dm-deck?game=MyMod.YEIVRGameInfo
To recompile I used UDKLift.exe make -full from the command line
To run the mod:
C:\UDK\UDK-2012-05\Binaries\Win32\UDK.exe EpicCitadel?game=MyMod.YEIVRGameInfo or
C:\UDK\UDK-2012-05\Binaries\Win32\UDK.exe FoliageMap?game=MyMod.YEIVRGameInfo
Tried both of these from the command line and although they load the correct map I dont get any headtracking at all. Please let me know if I am doing something stupid of whether the latest firmware simply isn't compatible with the UDK install.

Many Thanks!
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 »

ModEditPackages are declared in the [UnrealEd.EditorEngine] section I should be more clear about that. :oops:

I'm planning on posting the new version that uses the new ThreeSpaceAPI this afternoon. It uses streaming and has a noticeable improvement on responsiveness. It can also be toggled to the the old method too for comparison.

This is starting to become less about FreePIE and more about the 3-Space tracker, it might be good idea to make a new thread to continue this conversation.
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 »

RoadKillGrill wrote:ModEditPackages are declared in the [UnrealEd.EditorEngine] section I should be more clear about that. :oops:

I'm planning on posting the new version that uses the new ThreeSpaceAPI this afternoon. It uses streaming and has a noticeable improvement on responsiveness. It can also be toggled to the the old method too for comparison.

This is starting to become less about FreePIE and more about the 3-Space tracker, it might be good idea to make a new thread to continue this conversation.
Thanks Ill give it another go and if not will await the new version. You are right that I am digressing. Any further questions I will start a new topic just focussing on SS3. What category is best to place new topics in to attract your attention?
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 »

Here is the branch

https://github.com/AndersMalmgren/FreeP ... YEI3-Space

A couple of notes
Im polling the devices from the script thread, which runs at the system clock (64hz)
this is fine for fused data, but if you want to do sensor fusion from FreePIE its better to get a higher sample right for fusion accuracy.

What you can do then is to spawn a own thread, let me know if you need that and I can help you with it.

edit: Added code that closes the device properly
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 »

Thanks CyberVillain!!
I'll make sure to try this out and fix it up if need be. It might be next week when I get a chance to test it and make a few changes we will see how the week goes.

@baggyg
I'm sure I can find the thread if its posted :D if it was going to be posted on MTBS I guess General AR/VR would be the appropriate. We recently created a community support forum for YEI Tech as well.
Edit: New Head Tracking UDK Demo is live http://forum.yeitechnology.com/viewtopi ... t=50&p=110
Last edited by RoadKillGrill on Tue May 21, 2013 3:31 pm, edited 1 time in total.
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 »

Here is a binary version if anyone wants to try
You do not have the required permissions to view the files attached to this post.
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 »

CyberVillain wrote:Here is a binary version if anyone wants to try
Thanks Cyber, I gave this a try but crashes when trying to watch any values

Code: Select all

diagnostics.watch(yei[0].Yaw);
However really looking forward to this. Got the Space Sensor working on UDK last night and it was a flawless VR experience (if I can figure out some cable management). Cant wait for it to be integrated into freePIE so I can play all my favourite FPS. Having come from using trackIR for head tracking this is so much better. Even when my Rift arrives I imagine I will still be using FreePIE / SS3 / HMZ-T1 for a lot of games. Keep up the good work guys. Let me know if there is anything I can help with.
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 cant do anything from here, youll have to debug the FreePIE project or wait for RoadKillGrill todo it, sorry.
No errors in event viewer?
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 »

CyberVillain wrote:I cant do anything from here, youll have to debug the FreePIE project or wait for RoadKillGrill todo it, sorry.
No errors in event viewer?
No, it crashes before that point. Not to worry, I am being premature here in testing. I will be patient and let RoadKillGrill do his magic ;)
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 »

Hi Cyber,
EDIT: Maybe I am being stupid. I was running the FreePIE.Console thread. Just run the FreePIE.GUI thread and it works fine. Is that right?
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 »

Me Again,

Been doing some debugging today. The script is not acting as expected when filling the com ports. Edited to this:

Code: Select all

var count = tss_getComPorts(ports, (uint)ports.Length, 0, TssFind.TSS_FIND_ALL_KNOWN);
in Api.cs: GetComPorts()
Although this correctly throws back a count of 1 (one sensor plugged in) it does not prefill the port list with anything.(FriendlyName: null, Port: null, SensorType: 0) Therefore when you try and create a device on the index number port it is throwing an exception.
I have run out of time atm to get any further but I have the YEI script from the UDK integration and am going to try and get this converted in tonight (so far got the device created but need to link that back) and at least get something going although it wont be 100% (probably missing wireless dongle integration).

This work will be superceded by RoadKillgrill "official" integration.

EDIT: Got it all working and now cleaning up, etc. Will post full update later when I have something in a good state.
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 »

Hmmm, there is definitely an issue with the call to tss_getComPorts. If I program the DLL call to be a single comport this works fine (with 'out'). However I can't get this at all to return an array at all. Trying to return this via 'ref' returns a memory issue. By 'out' actually causes a FatalErrorException. Had a look at the source examples and at least in C this is claiming to work:

Code: Select all

TSS_ComPort comport_list[20];

	int device_count =tss_getComPorts(comport_list,20,0,TSS_FIND_ALL_KNOWN);
	printf("Found %d Devices\n", device_count);
	for( unsigned int i=0; i< device_count; ++i){
		device =tss_createTSDeviceStr(comport_list[i].com_port, TSS_TIMESTAMP_SENSOR);
		if( device == TSS_NO_DEVICE_ID){
			printf("Failed to create a sensor on %s\n",comport.com_port);
			//return 1;
		}
		else{
			if( tss_getSerialNumber(device,&serial, NULL) == TSS_NO_ERROR){
				printf("Port created successfully for sensor %x\n", serial);
			}
		}
		tss_closeTSDevice(device);
	}
Obviously without ref or out its just a blank array of enum comports and therefore comport_list.com_port will just return a null pointer. I could get around this by calling the single instance x amount of times until I reached the index (incrementing the offset) but its far from ideal.

Code: Select all

[DllImport("ThreeSpace_API.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern int tss_getComPorts(out TssComPort port, uint size, int offset, TssFind filter);
Ill do this now anyway so at least anyone with multiple sensors can use it but should should be improved.

EDIT: Although still cant get back a full list I can handle this quite nicely through the offset. Code complete
Last edited by baggyg on Thu May 23, 2013 4:12 pm, edited 1 time in total.
Post Reply

Return to “FreePIE”