[Solved]Freepie hydra emu

Official forum for open source FreePIE discussion and development.
Post Reply
Jpwinks001
One Eyed Hopeful
Posts: 13
Joined: Wed Feb 18, 2015 7:00 am

[Solved]Freepie hydra emu

Post by Jpwinks001 »

Hi,
Using the search I discovered a well of knowledge on how to emulate hydra with freepie. Im trying to use my android phone but it is not working as expected.
Is this function still working?

I can see in the watch tab that it is picking up the gyro. In my Android UMI app I can see it detecting the orientation and it is.
In mincrift I can get past the hydra calibration. Soon as center the orientation and move the phone it does not move in any correct direction in correlation to the phones orientation.

The code:

Code: Select all

def update():
    global yaw
    yaw = math.degrees(android[0].yaw)
    global pitch
    pitch = math.degrees(android[0].pitch)
    global roll
    roll = math.degrees(android[0].roll)

if starting:
    centerYaw = 0
    centerPitch = 0
    centerRoll = 0
   
    yaw = 0
    pitch = 0
    roll = 0
    android[0].update += update

hydra[0].yaw  = yaw - centerYaw
hydra[0].pitch = pitch - centerPitch
hydra[0].roll = roll - centerRoll

diagnostics.watch(hydra[0].yaw)
diagnostics.watch(hydra[0].pitch)
diagnostics.watch(hydra[0].roll)

if keyboard.getKeyDown(Key.Z):
    centerYaw = yaw
    centerPitch = pitch
    centerRoll = roll

if keyboard.getKeyDown(Key.O):
   hydra[0].trigger = 1
   
if keyboard.getKeyDown(Key.P):
   hydra[1].trigger = 1
I am trying to get it to run for Minecrift tracking via freepie hydra. I read success from the older 2013 posts from Croccy22.

What I tried:
I have tried changing switch on the android app the raw data and orientation on and off.
I've tried changing the yaw,pitch,roll to -android[0].yaw and android[0].googleYaw etc.
Also tried playing with setting sensativity in mincrift but it would just spin the screen around.

Relavent Info:
Phone: Samsung Galaxy S5 s906K
Freepie version: 1.9.6
Minecrift vers: 1.8.1 hydra enabled

If anyone has figured this out could you please pass on your code so I can learn from you.
JP
Last edited by Jpwinks001 on Tue Oct 27, 2015 6:15 pm, edited 1 time in total.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: [Help]Freepie hydra emu

Post by CyberVillain »

Hi,


The sixense emulation expects the yaw pitch roll data to be in radians not degrees.
You should also remove diagnostics.watch(hyda[0].yaw) this will try to read data from the real Hydra which I guess you do not own?
Jpwinks001
One Eyed Hopeful
Posts: 13
Joined: Wed Feb 18, 2015 7:00 am

Re: [Help]Freepie hydra emu

Post by Jpwinks001 »

CyberVillain wrote:Hi,


The sixense emulation expects the yaw pitch roll data to be in radians not degrees.
You should also remove diagnostics.watch(hyda[0].yaw) this will try to read data from the real Hydra which I guess you do not own?
so like:

Code: Select all

def update():
    global yaw
    yaw = math.radians(android[0].googleYaw)
    global pitch
    pitch = math.radians(android[0].googlePitch)
    global roll
    roll = math.radians(android[0].googleRoll)
 
diagnostics.watch(android[0].pitch)
diagnostics.watch(android[0].yaw)
diagnostics.watch(android[0].roll)
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: [Help]Freepie hydra emu

Post by CyberVillain »

android is allready in radians, so remove the radian conversion.
I just tried with the Sixense demo app from the SDK and that works
Jpwinks001
One Eyed Hopeful
Posts: 13
Joined: Wed Feb 18, 2015 7:00 am

Re: [help]Freepie hydra emu

Post by Jpwinks001 »

Thanks for all your help Cybervillian.
For some reason I just could not get it to work. Once I took off the math.radians it all worked. It's
odd as it didn't work for a week or 2 for me. I tried everything.
I will use this as a base so I can get Vireio SMT and Freetracking > Hydra working.
JP
Last edited by Jpwinks001 on Tue Oct 27, 2015 9:17 am, edited 1 time in total.
Jpwinks001
One Eyed Hopeful
Posts: 13
Joined: Wed Feb 18, 2015 7:00 am

Re: [Help]Freepie hydra emu

Post by Jpwinks001 »

Just an update.
I used this working script in order to get freetrack working.
Yaw Pitch and Roll are working perfectly!
Position X, Y and Z not at all...
The code I am using for them is:

Code: Select all

def update():
global x
global y
global z

x = freetrack.x
y = freetrack.y
z = freetrack.z

If starting:
centerx = 0
centery = 0
centerz = 0

x = 0
y = 0
z = 0
freetrack.update += update

hydra[0].x = x - centerx
hydra[0].y = y - centery
hydra[0].z = z - centerz

diagnostics.watch(freetrack.x)
diagnostics.watch(freetrack.y)
diagnostics.watch(freetrack.z)

If keyboard.getKeyDown(Key.Z)
centerx = x
centery = y
centerz = z
Update:
Solved my issues. Now I'm tweeking script to work for me in minecrift for position tracking. This is going to be awesome! Let me know if anyone wants in on this!
konstantin_lozev
Cross Eyed!
Posts: 192
Joined: Fri Jul 04, 2014 1:43 am

Re: [Solved]Freepie hydra emu

Post by konstantin_lozev »

How do you get positional tracking from the phone output?
Jpwinks001
One Eyed Hopeful
Posts: 13
Joined: Wed Feb 18, 2015 7:00 am

Re: [Solved]Freepie hydra emu

Post by Jpwinks001 »

konstantin_lozev wrote:How do you get positional tracking from the phone output?
Hi,
Sorry for the confusion. I used an actually IR tracker with a PS3 Camera via Opentrack and then input that into Freepie to output hydras X Y Z.
You could actually acomplish the same with a phone doing the yaw pitch and roll and use acuro markers for the x y z and it should work fine. You would need a freetrack program that does multiple trackers or you can use Trinus VR with their paper trackers.

If you want the code I have done its here: http://pastebin.com/cGQ2Y5TX
I still am tweaking it for minecrift tracking as i have the X and Y flipped around somehow...
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: [Solved]Freepie hydra emu

Post by CyberVillain »

Jpwinks001 wrote:
konstantin_lozev wrote:How do you get positional tracking from the phone output?
Hi,
Sorry for the confusion. I used an actually IR tracker with a PS3 Camera via Opentrack and then input that into Freepie to output hydras X Y Z.
You could actually acomplish the same with a phone doing the yaw pitch and roll and use acuro markers for the x y z and it should work fine. You would need a freetrack program that does multiple trackers or you can use Trinus VR with their paper trackers.

If you want the code I have done its here: http://pastebin.com/cGQ2Y5TX
I still am tweaking it for minecrift tracking as i have the X and Y flipped around somehow...
If this works

Code: Select all

if keyboard.getKeyDown(Key.O):
   hydra[0].trigger = 1
Then its just a lucky coincidence, this is more safe

Code: Select all

hydra[0].trigger = keyboard.getKeyDown(Key.O)
Post Reply

Return to “FreePIE”