Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Freepie Psmove is 180 degrees rotated #114

Open
tomazcdn opened this issue May 1, 2017 · 5 comments
Open

Freepie Psmove is 180 degrees rotated #114

tomazcdn opened this issue May 1, 2017 · 5 comments

Comments

@tomazcdn
Copy link

tomazcdn commented May 1, 2017

Hello im with a big issue,im using psmove on freepie to make positional tracking on steamvr,but when i turn on it is rotating to 180 degrees back,i need to make the orientation of freepie 180 degrees to back on X axis to try solve my problem,so im using this code:

def update():
freeTrack.pitch = -freePieIO[0].pitch * math.cos(freePieIO[0].yaw/2) - freePieIO[0].roll * math.sin(freePieIO[0].yaw/2)
freeTrack.roll = - freePieIO[0].pitch * math.sin(freePieIO[0].yaw/2) + freePieIO[0].roll * math.cos(freePieIO[0].yaw/2)
freeTrack.yaw = freePieIO[0].yaw

#Multiply by 10 for SteamVR use
freeTrack.x = (freePieIO[0].x * 10)
freeTrack.y = (freePieIO[0].y * 10)
freeTrack.z = (freePieIO[0].z * 10)

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

Here a video showing whats my issue (the psmove need to go front and view too,but its inverting the action,i mean my psmove go to front and my view to back)
link: https://www.youtube.com/watch?v=H6ziMvFzwLE

if there is a audio on this video,please ignore or mute. Thank you very much,any help is very welcome

@MarijnS95
Copy link
Contributor

MarijnS95 commented May 1, 2017

That's as simple as inverting (negating) the movement on the two horizontal axes (which are x and y, or x and z, I don't know what coordinate space these things use).

@tomazcdn
Copy link
Author

tomazcdn commented May 1, 2017

Thanks for the big tip,i will try to change it on freepie,but im not good on programming so im trying to manage how im going to invert it... i use *180 or * (-1) ?

@MarijnS95
Copy link
Contributor

By adding a minus sign to the respective calculations, so that would be:

freeTrack.x = -freePieIO[0].x * 10
freeTrack.y = -freePieIO[0].y * 10
freeTrack.z = freePieIO[0].z * 10

or

freeTrack.x = -freePieIO[0].x * 10
freeTrack.y = freePieIO[0].y * 10
freeTrack.z = -freePieIO[0].z * 10

depending on the coordinate system.

@tomazcdn
Copy link
Author

tomazcdn commented May 1, 2017

hmm good idea... i did solve the problem just right now,it was on trinus gyre aplication,it says (use 0 instead of -1) so i let -1...but i will try your solution because my own isnt that good

@tomazcdn
Copy link
Author

tomazcdn commented May 2, 2017

yeah your solution didnt worked..atleast not the - withot the (freepie...) i mean without " ( ) "
so i finished leting the problem solved on trinus gyre... the solution is: dont change the "rotIndex":-1,
thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants