Can FreePie read files?

Official forum for open source FreePIE discussion and development.
Post Reply
Abbeynesh
One Eyed Hopeful
Posts: 2
Joined: Sat Mar 11, 2017 9:10 am

Can FreePie read files?

Post by Abbeynesh »

I have 2 wiimotes and I am planning to use their IR cameras to measure depth. The plan was to use 2 TV remotes, read the signals with the IR cameras as well as read the position of the IR led and translate this into razer hydra output for VR.
BUT AS ALWAYS, I ENCOUNTERED A PROBLEM!!

So, FreePie cannot use the IR cameras in the wiimote (which is not such a big problem as FreePie is still an amazing piece of software) so I found a program that can and I am planning to tweak the code so it can output a file with the positions. Problem is, I don't know how to read file data using FreePie so can anyone help me? Also, please tell me if FreePie can actually read IR camera data and I've just been wrong.

Thank You In Advance
User avatar
LordAshes
One Eyed Hopeful
Posts: 24
Joined: Sat Jan 27, 2018 10:27 pm

Re: Can FreePie read files?

Post by LordAshes »

As an alternative, why not wrap the code you found into an actual FreePie plugin...that way you can code it in C# and thereby have access to the all the regular C# functionality which you may be more familiar with. This also means that the corresponding code would get started automatically by FreePie instead of having to start it independently.
Last edited by LordAshes on Thu Feb 08, 2018 5:38 pm, edited 1 time in total.
User avatar
LordAshes
One Eyed Hopeful
Posts: 24
Joined: Sat Jan 27, 2018 10:27 pm

Re: Can FreePie read files?

Post by LordAshes »

The following code can be used inside FreePie to write a file..

Code: Select all

	f = open("Test.txt","w+")
	f.write("Hello!")
	f.close()
The following code can be used inside FreePie to read a file.

Code: Select all

	f = open("F:\Test.txt","r")
	s = f.read()
	f.close()
	diagnostics.debug("Read: %s" % s)
linkoid
One Eyed Hopeful
Posts: 9
Joined: Mon Jan 15, 2018 3:33 pm

Re: Can FreePie read files?

Post by linkoid »

You could indeed just write to a file and read from it like you are wondering, but you will probably run into problems with 2 programs accessing the file at the same time. I recommend that you write a plugin for FreePIE in C#. If you use C# then you can use shared Memory-Mapping which is a better solution to what you are trying to accomplish. though I'm not sure it's the best. It's like a file except it's only stored in RAM and not to the HDD increasing read/write time, and more than one program can access it at a time.

Also keep me updated on this if you would, I'm very interested in it. I've put a lot of work into using WiiMotes for VR as well, but I can only make it so perfect without some kind of constant to re-calibrate it with. I may have the best script for it right now. IR camera references might be perfect, especially if you could place them all around the room.
Post Reply

Return to “FreePIE”