Suddenly Lost Horizontal Control

Official forum for open source FreePIE discussion and development.
Post Reply
Blinkstar
One Eyed Hopeful
Posts: 23
Joined: Tue Apr 21, 2015 5:59 pm

Suddenly Lost Horizontal Control

Post by Blinkstar »

When I got freepie working on my PC/Android/Moonlight setup I was ecstatic. Awesome program that does exactly what it is supposed to do. Today I set up my HMD and discovered that horizontal control suddenly doesn't work, or only partially works. Moving the mouse up and down on my screen works as it should, but when I try to move it side to side it refuses to cooperate or will only move a short distance ...

I haven't changed anything I can think of that might account for this ... any ideas?

This is the script I've been using:

def update():
global yaw
global roll
global pitch
yaw = -android[0].googleYaw
roll = -android[0].googleRoll
pitch = android[0].googlePitch

if starting:
yaw = 0
roll = 0
pitch = 0
enabled = False
android[0].update += update

diagnostics.watch(yaw)
diagnostics.watch(roll)
diagnostics.watch(pitch)

deltaYaw = filters.delta(yaw)
deltaPitch = filters.delta(pitch)
deltaRoll = filters.delta(roll)

if math.fabs(deltaYaw) >= math.pi:
deltaYaw = 0

if (enabled):
mouse.deltaX = -deltaYaw*600
mouse.deltaY = -deltaRoll*1000

toggle = keyboard.getPressed(Key.M)

if toggle:
enabled = not enabled
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Suddenly Lost Horizontal Control

Post by CyberVillain »

This looks fishy

Code: Select all

if math.fabs(deltaYaw) >= math.pi:
deltaYaw = 0
Instead use

Code: Select all

filters.delta(filters.continuousRotation(yaw))
I dont think that is the problem though
Blinkstar
One Eyed Hopeful
Posts: 23
Joined: Tue Apr 21, 2015 5:59 pm

Re: Suddenly Lost Horizontal Control

Post by Blinkstar »

CyberVillain wrote:This looks fishy

Code: Select all

if math.fabs(deltaYaw) >= math.pi:
deltaYaw = 0
Instead use

Code: Select all

filters.delta(filters.continuousRotation(yaw))
I dont think that is the problem though
Tried changing the code but you're right, that wasn't the problem ...

Any ideas on what I should try next?
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Suddenly Lost Horizontal Control

Post by CyberVillain »

Whats the output from diagnostics.watch(android[0].googleYaw)

it should be something like -pi to +pi or similar when you turn the phone/device in a circle
Post Reply

Return to “FreePIE”