PS move plugin
-
- One Eyed Hopeful
- Posts: 7
- Joined: Mon Jul 23, 2012 1:41 pm
- Location: Austin, TX
PS move plugin
Hi all, I'm looking to develope a freePIE plugin for the PS Move and navigator.
Most of my coding experience has been in Java, so this is kinda new to me.
I'm not sure how far I'll get, but I'm looking through the move framework http://code.google.com/p/moveframework/ right now.
Has anyone started on this yet? Any hurdles I should know about?
I'll be getting the hardware next week, so I want to try and get something together by then so I can jump right into implementation when it arrives.
(PS - I'm new to the forums here, I'm excited to contribute what I can.)
Most of my coding experience has been in Java, so this is kinda new to me.
I'm not sure how far I'll get, but I'm looking through the move framework http://code.google.com/p/moveframework/ right now.
Has anyone started on this yet? Any hurdles I should know about?
I'll be getting the hardware next week, so I want to try and get something together by then so I can jump right into implementation when it arrives.
(PS - I'm new to the forums here, I'm excited to contribute what I can.)
- brantlew
- Petrif-Eyed
- Posts: 2221
- Joined: Sat Sep 17, 2011 9:23 pm
- Location: Menlo Park, CA
Re: PS move plugin
Great to have you. The Move would be great to have in FreePIE. The engine and the GUI code is hard to follow if you are new to C# I would concentrate just on the plugins. There are several plugins now with different implementation designs to reference, so you should be able to find one that closely matches the way that you intend to write it.
You can use C# Express to load the solution, but it will give you lots of project loading errors on the unit tests. Just ignore them. The main project should load and compile fine.
You can use C# Express to load the solution, but it will give you lots of project loading errors on the unit tests. Just ignore them. The main project should load and compile fine.
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: PS move plugin
Welcome to the forum!
You can look here for help about developing plugins for FreePIE
https://github.com/AndersMalmgren/FreeP ... evelopment
edit: Btw, put this in the Core plugin project and inherit from the Plugin base class, this fits perfect to have as a core plugin
You can look here for help about developing plugins for FreePIE
https://github.com/AndersMalmgren/FreeP ... evelopment
edit: Btw, put this in the Core plugin project and inherit from the Plugin base class, this fits perfect to have as a core plugin
-
- One Eyed Hopeful
- Posts: 7
- Joined: Mon Jul 23, 2012 1:41 pm
- Location: Austin, TX
Re: PS move plugin
I just got back from my trips, and I now have hardware. I'll start working on this tonight.
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: PS move plugin
Cool! Just let us know if you run into problemsFayt3X wrote:I just got back from my trips, and I now have hardware. I'll start working on this tonight.
edit: Also make sure to fork the Git repo from the start so you are backed up with versioning from the get go
https://help.github.com/articles/fork-a-repo
-
- One Eyed Hopeful
- Posts: 7
- Joined: Mon Jul 23, 2012 1:41 pm
- Location: Austin, TX
Re: PS move plugin
I've never used github before so let me know if i get something wrong.
First steps will be familiarizing myself with the move framework sdk, so I won't actually be touching freePIE until I'm comfortable with what I'm working with.
First steps will be familiarizing myself with the move framework sdk, so I won't actually be touching freePIE until I'm comfortable with what I'm working with.
-
- One Eyed Hopeful
- Posts: 44
- Joined: Thu May 15, 2014 8:04 am
Re: PS move plugin
¿Any news on this topic? I'm really interested in this psmove plugin to try to emulate the razer hydra (thanx to cybervillain) for upcoming VR demos ^^.
-
- One Eyed Hopeful
- Posts: 7
- Joined: Mon Jul 23, 2012 1:41 pm
- Location: Austin, TX
Re: PS move plugin
No sorry.NoxWings wrote:¿Any news on this topic? I'm really interested in this psmove plugin to try to emulate the razer hydra (thanx to cybervillain) for upcoming VR demos ^^.
It was beyond my abilities. If anyone else wants to give it a shot, they're welcome to take over.
EDIT: The biggest hurdle for me was that the creator of the original Move Framework dropped development for the project.
I got in contact with him, but unfortunately he did not want to support it any longer.
- Fredz
- Petrif-Eyed
- Posts: 2255
- Joined: Sat Jan 09, 2010 2:06 pm
- Location: Perpignan, France
- Contact:
Re: PS move plugin
There is also the PS Move API.
-
- One Eyed Hopeful
- Posts: 44
- Joined: Thu May 15, 2014 8:04 am
Re: PS move plugin
Yep, I know. I'm working with it right now, making a unity plugin since the unimove one is pretty outdated .Fredz wrote:There is also the PS Move API.
So I guess I'll be checking the FreePIE plugin after I get the unity plugin done, but I can't promise anything.
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: PS move plugin
Would be nice if you could do that. Please fork FreePIE so that I can pull the change once you are done
-
- One Eyed Hopeful
- Posts: 44
- Joined: Thu May 15, 2014 8:04 am
Re: PS move plugin
I've got some spare time so I'll try to do it now ^^CyberVillain wrote:Would be nice if you could do that. Please fork FreePIE so that I can pull the change once you are done
If I get use to the code I'll definitely consider helping you with some other tasks in the near future.
I love this project.
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: PS move plugin
That would be very welcomed, I'm pretty much alone these days.
Let me know if you have any questions at all
Glad you like the project
Let me know if you have any questions at all
Glad you like the project
-
- One Eyed Hopeful
- Posts: 44
- Joined: Thu May 15, 2014 8:04 am
Re: PS move plugin
Wow I've found the weirdest thing I've seen ever
I'm using this script to test the orientation features. The following script works well except from one bizarre case.
If I introduce a line using the word "joystick" the psmove orientation values return always 0
but the weird thing is that orientation values return 0 even if the "joystick" line is commented!!
I'm using this script to test the orientation features. The following script works well except from one bizarre case.
If I introduce a line using the word "joystick" the psmove orientation values return always 0
but the weird thing is that orientation values return 0 even if the "joystick" line is commented!!
Code: Select all
if starting:
psmove[0].resetOrientation();
psmove[1].resetOrientation();
diagnostics.watch( psmove[0].yaw )
diagnostics.watch( psmove[0].pitch )
diagnostics.watch( psmove[0].roll )
diagnostics.watch( psmove[1].yaw )
diagnostics.watch( psmove[1].pitch )
diagnostics.watch( psmove[1].roll )
hydra[0].yaw = psmove[0].yaw
hydra[0].pitch = psmove[0].pitch
hydra[0].roll = psmove[0].roll
hydra[1].yaw = psmove[1].yaw
hydra[1].pitch = psmove[1].pitch
hydra[1].roll = psmove[1].roll
# joystick (even if this is a comment you have to remove this line for this script to work... or remove the word joystick from this comment)
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: PS move plugin
The plugin dependency resolver is pretty dumb. That line will invoke the joystick plugin
-
- One Eyed Hopeful
- Posts: 44
- Joined: Thu May 15, 2014 8:04 am
Re: PS move plugin
Yep, I guess so.CyberVillain wrote:The plugin dependency resolver is pretty dumb. That line will invoke the joystick plugin
The weird thing is that it was not working because of a comment line and not an actual line of code. How is it possible? I thought comments were automatically discarded by the interpreter and never executed anything.
Last edited by NoxWings on Tue Sep 02, 2014 2:33 am, edited 1 time in total.
-
- One Eyed Hopeful
- Posts: 44
- Joined: Thu May 15, 2014 8:04 am
Re: PS move plugin
I've made a lil bit more testing and every time the joystick plugin is executed psmove connection fails to detect them, not even in a external program (the psmove api examples).
Prevents even another executable to connect to the psmove. I've also tested the same script using the xbox360 plugin but it works fine.
I think this may be the case because psmoves are detected as motion controllers inside windows even if it is unable to retrieve any data from them and the joystick plugin might want to get control of them. I'm unsure if I will be able to retrieve any vendor info inside the joystick plugin to prevent it from taking control over psmoves. This is going to be tricky.
Code: Select all
if starting:
joystick[0]
I think this may be the case because psmoves are detected as motion controllers inside windows even if it is unable to retrieve any data from them and the joystick plugin might want to get control of them. I'm unsure if I will be able to retrieve any vendor info inside the joystick plugin to prevent it from taking control over psmoves. This is going to be tricky.
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: PS move plugin
We precheck the script to find which plugins are used in the script (We cant init them all). The code for doing this is dumb, it does not have logic for ignoring comments etcNoxWings wrote:Yep, I guess so.CyberVillain wrote:The plugin dependency resolver is pretty dumb. That line will invoke the joystick plugin
The weird thing is that it was not working because of a comment line and not an actual line of code. How is it possible? I thought comments were automatically discarded by the interpreter and never executed anything.
The code: https://github.com/AndersMalmgren/FreeP ... ser.cs#L38
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: PS move plugin
We use SlimDX for Joysticks
Hmm,
https://github.com/AndersMalmgren/FreeP ... gin.cs#L25
This could be considered a bug, we take all joysticks and claim exclusive right over them.
We instead use the GlobalIndexer<T> class and lazy init the joysticks when they are accesed from script
edit: If the PSmove is consider a game controller, does the Joystick plugin work to retrieve data from it?
Hmm,
https://github.com/AndersMalmgren/FreeP ... gin.cs#L25
This could be considered a bug, we take all joysticks and claim exclusive right over them.
We instead use the GlobalIndexer<T> class and lazy init the joysticks when they are accesed from script
edit: If the PSmove is consider a game controller, does the Joystick plugin work to retrieve data from it?
-
- One Eyed Hopeful
- Posts: 44
- Joined: Thu May 15, 2014 8:04 am
Re: PS move plugin
That prepass explains that behaviour. Nothing to worry about it then. I was just shocking to me that a comment was the responsible for it. xDCyberVillain wrote:We precheck the script to find which plugins are used in the script (We cant init them all). The code for doing this is dumb, it does not have logic for ignoring comments etcNoxWings wrote:Yep, I guess so.CyberVillain wrote:The plugin dependency resolver is pretty dumb. That line will invoke the joystick plugin
The weird thing is that it was not working because of a comment line and not an actual line of code. How is it possible? I thought comments were automatically discarded by the interpreter and never executed anything.
The code: https://github.com/AndersMalmgren/FreeP ... ser.cs#L38
-
- One Eyed Hopeful
- Posts: 44
- Joined: Thu May 15, 2014 8:04 am
Re: PS move plugin
Actually the psmove is exposed in windows as a "Motion controller" so probably the joystick plugin is blocking it. I still don't know how since it has a lazy load and I'm not even calling any specific joystick index.CyberVillain wrote:We use SlimDX for Joysticks
Hmm,
https://github.com/AndersMalmgren/FreeP ... gin.cs#L25
This could be considered a bug, we take all joysticks and claim exclusive right over them.
We instead use the GlobalIndexer<T> class and lazy init the joysticks when they are accesed from script
edit: If the PSmove is consider a game controller, does the Joystick plugin work to retrieve data from it?
About the psmove being exposed as a joystick, I'm unsure but I think that it won't be able to retrieve any data.
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: PS move plugin
The joystick plugin is NOT currenly lazyloading the devices. IT takes exclusive hold of them all
-
- One Eyed Hopeful
- Posts: 44
- Joined: Thu May 15, 2014 8:04 am
Re: PS move plugin
Ups sorry I misunderstood you. That's probably the reason why it is not working. I'll check it tomorrow using a globalIndexer for that plugin.CyberVillain wrote:The joystick plugin is NOT currenly lazyloading the devices. IT takes exclusive hold of them all
Anyways even if the joysticks plugin was lazyloading psmoves it would still lead to a bug because they would still be counting towards the total number of joysticks.
PSMoves would be potentially pushing other legit joysticks to the tail of the joysticks index.
The "easiest" solution would be preventing moves from populating the joysticks plugin. But even if I could prevent it rejecting some vendors to populate joysticks, it sounds like a "dirty" and too specific solution :S.
BTW thank you so much for your help. ^^
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: PS move plugin
If the global indexer Create method only interates the devices until it find its correct index and only take exclusive rigth of that game controller it might work?
Some like (Written from memory so consider it pseudo code)
index is the argument you get from the the GlobalIndexer Create method
Some like (Written from memory so consider it pseudo code)
Code: Select all
var device = directInput.GetDevices(DeviceClass.GameController, DeviceEnumerationFlags.AttachedOnly).Where((d, i) => i == index).FirstOrDefault()
-
- One Eyed Hopeful
- Posts: 44
- Joined: Thu May 15, 2014 8:04 am
Re: PS move plugin
I'm sorry I don't know exactly what you are trying to do there. Edit: I mean it is beyond my current limited knowledge :SCyberVillain wrote:If the global indexer Create method only interates the devices until it find its correct index and only take exclusive rigth of that game controller it might work?
Some like (Written from memory so consider it pseudo code)
index is the argument you get from the the GlobalIndexer Create methodCode: Select all
var device = directInput.GetDevices(DeviceClass.GameController, DeviceEnumerationFlags.AttachedOnly).Where((d, i) => i == index).FirstOrDefault()
You are retrieving all game controllers who are "attached" I guess this means something like they are actually working and not only installed ¿?
Then trying to match the directInput device index with the global indexer one and if they dont match get a null reference?
I don't know it yet. Finally I've decided to move on and keep on finishing the plugin aside from that plugin incompatibility and when I'm done go back and check it again.
Everything but the positional tracking is working. I've been testing it today. I hope to get the positional tracking working tomorrow hopefully with an hydra emulation script.
-
- Cross Eyed!
- Posts: 144
- Joined: Wed Jul 16, 2014 10:29 am
- Location: Tokyo, Japan
Re: PS move plugin
Hi,
Just wanted to say, I think the ps move could be a nice light saber
to use in games like Jedi Academy, so looking forward to seeing this develop
http://www.mtbs3d.com/phpbb/viewtopic.php?f=120&t=17032
developer.oculusvr.com/forums/viewtopic.php?f=28&t=10973
good luck!
Just wanted to say, I think the ps move could be a nice light saber
to use in games like Jedi Academy, so looking forward to seeing this develop
http://www.mtbs3d.com/phpbb/viewtopic.php?f=120&t=17032
developer.oculusvr.com/forums/viewtopic.php?f=28&t=10973
good luck!
Last edited by NeoTokyo_Nori on Fri Sep 05, 2014 2:01 am, edited 1 time in total.
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: PS move plugin
I can have a look at the Joystick plugin side of things later. Just leave that for nowNoxWings wrote:I'm sorry I don't know exactly what you are trying to do there. Edit: I mean it is beyond my current limited knowledge :SCyberVillain wrote:If the global indexer Create method only interates the devices until it find its correct index and only take exclusive rigth of that game controller it might work?
Some like (Written from memory so consider it pseudo code)
index is the argument you get from the the GlobalIndexer Create methodCode: Select all
var device = directInput.GetDevices(DeviceClass.GameController, DeviceEnumerationFlags.AttachedOnly).Where((d, i) => i == index).FirstOrDefault()
You are retrieving all game controllers who are "attached" I guess this means something like they are actually working and not only installed ¿?
Then trying to match the directInput device index with the global indexer one and if they dont match get a null reference?
I don't know it yet. Finally I've decided to move on and keep on finishing the plugin aside from that plugin incompatibility and when I'm done go back and check it again.
Everything but the positional tracking is working. I've been testing it today. I hope to get the positional tracking working tomorrow hopefully with an hydra emulation script.
-
- One Eyed Hopeful
- Posts: 44
- Joined: Thu May 15, 2014 8:04 am
Re: PS move plugin
Wow I never noticed that they released the source code!! I used to love those games. I'll try to do my best but I'm having tons of problems with the psmove positional tracking from psmove api. Suddenly I can't even get both of them working properly with the library test examples now... so I'm a liltle bit stuck right now.NeoTokyo_Nori wrote:Hi,
Just wanted to say, I think the ps move could be a nice light saber
to use in games like Jedi Academy, so looking forward to seeing this develop
http://www.mtbs3d.com/phpbb/viewtopic.php?f=120&t=17032
developer.oculusvr.com/forums/viewtopic.php?f=28&t=10973
good luck!
-
- One Eyed Hopeful
- Posts: 44
- Joined: Thu May 15, 2014 8:04 am
Re: PS move plugin
I've finally completed the psmove plugin (apart from the joystick plugin incompatibility ) and I've succesfully emulated the razer hydra using 2 psmoves and 2 navigation controllers (through motioninjoy and xbox360 plugin).
The only thing it is not working butter smooth is positional tracking. It jumps a little bit but I've only tested it really close to the camera at about 30-40cm. Maybe some filters can help smoothing it but I've never used any I'll check them and upload the hydra emulation script.
Edit: Looks like using built-in filters is not working in my code since I'm using the same indexer string "psmove.position.x" to smooth both hands where "i" is the hand index.
The only thing it is not working butter smooth is positional tracking. It jumps a little bit but I've only tested it really close to the camera at about 30-40cm. Maybe some filters can help smoothing it but I've never used any I'll check them and upload the hydra emulation script.
Edit: Looks like using built-in filters is not working in my code since I'm using the same indexer string "psmove.position.x" to smooth both hands where "i" is the hand index.
-
- Cross Eyed!
- Posts: 144
- Joined: Wed Jul 16, 2014 10:29 am
- Location: Tokyo, Japan
Re: PS move plugin
Thats good newsNoxWings wrote:I've finally completed the psmove plugin (apart from the joystick plugin incompatibility ) and I've succesfully emulated the razer hydra using 2 psmoves and 2 navigation controllers (through motioninjoy and xbox360 plugin).
I dont have a ps move controller yet, so I dont understand all the issues involved now,
but it sounds like you are making steady progress.
-
- Cross Eyed!
- Posts: 192
- Joined: Fri Jul 04, 2014 1:43 am
Re: PS move plugin
I would be very interested to try a PS Move with FreePIE. I have had big problems over time with the wiimote drift, so I have hopes for better results with PS Move. I own 2 PS Move controllers and they are quite accurate in some of the PS3 games...
-
- One Eyed Hopeful
- Posts: 44
- Joined: Thu May 15, 2014 8:04 am
Re: PS move plugin
I'm also having some drift issues with psmove at the moment. Seems like psmoveapi ahrs algorithm is not that good or I am missing something to make it work propperly (probably this one xD), but at least it is working.konstantin_lozev wrote:I would be very interested to try a PS Move with FreePIE. I have had big problems over time with the wiimote drift, so I have hopes for better results with PS Move. I own 2 PS Move controllers and they are quite accurate in some of the PS3 games...
At this moment I'm only using half of the psmove IMU reports because psmove sends 2 at the same time (one slightly outdated and the very last one wich I'm currently using) but I think this has nothing to do with the internal psmoveapi algorithm which should be using every report for its ahrs fusion.
I've used both psmoves in ps3 with no noticeable drift over time so I have hope that this can be addressed later both using a better suited ahrs algorithm and using every IMU report internally.
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
-
- One Eyed Hopeful
- Posts: 44
- Joined: Thu May 15, 2014 8:04 am
Re: PS move plugin
Drift with the move orientation, not with the positional tracking.CyberVillain wrote:Drift with optical tracking? Sounds strange
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
-
- Cross Eyed!
- Posts: 192
- Joined: Fri Jul 04, 2014 1:43 am
Re: PS move plugin
Yeah, that's why you still have drift on games like PS3 Killzone 3 and absolutely no drift on Wii Golden Eye...
The upside is that the PS Move controller is cheaper to buy now (it does not have the wii's IR camera built in each and every controller).
The upside is that the PS Move controller is cheaper to buy now (it does not have the wii's IR camera built in each and every controller).
-
- Cross Eyed!
- Posts: 192
- Joined: Fri Jul 04, 2014 1:43 am
Re: PS move plugin
I just saw that Sony have apparently released a Move.me platform that is meant to stream all PS Move data through the PS3. I have not tried it, but the posts and youtube videos suggest that it already includes a pretty good fusion that does away with the drift. Have you tried it?NoxWings wrote:I'm also having some drift issues with psmove at the moment. Seems like psmoveapi ahrs algorithm is not that good or I am missing something to make it work propperly (probably this one xD), but at least it is working.konstantin_lozev wrote:I would be very interested to try a PS Move with FreePIE. I have had big problems over time with the wiimote drift, so I have hopes for better results with PS Move. I own 2 PS Move controllers and they are quite accurate in some of the PS3 games...
At this moment I'm only using half of the psmove IMU reports because psmove sends 2 at the same time (one slightly outdated and the very last one wich I'm currently using) but I think this has nothing to do with the internal psmoveapi algorithm which should be using every report for its ahrs fusion.
I've used both psmoves in ps3 with no noticeable drift over time so I have hope that this can be addressed later both using a better suited ahrs algorithm and using every IMU report internally.
-
- One Eyed Hopeful
- Posts: 44
- Joined: Thu May 15, 2014 8:04 am
Re: PS move plugin
I'm aware of it. It is actually pretty old now AFAIK. Yeah it works pretty well but 1) it is closed source, 2) has restricted access, and 3) it do requires a ps3 running at the same time which is an absolutely ridiculous requirement.konstantin_lozev wrote: I just saw that Sony have apparently released a Move.me platform that is meant to stream all PS Move data through the PS3. I have not tried it, but the posts and youtube videos suggest that it already includes a pretty good fusion that does away with the drift. Have you tried it?
-
- Cross Eyed!
- Posts: 192
- Joined: Fri Jul 04, 2014 1:43 am
Re: PS move plugin
Hm... I was aware only of the third piece (PS3 requirement), which I agree is ridiculous. I have not installed it yet, but from the videos it seems to work quite well otherwise. From what I understood the fused data are sent over by the PS3 over wifi, similarly to the Android FreePIE IMU apk, but maybe I misunderstood...NoxWings wrote:I'm aware of it. It is actually pretty old now AFAIK. Yeah it works pretty well but 1) it is closed source, 2) has restricted access, and 3) it do requires a ps3 running at the same time which is an absolutely ridiculous requirement.konstantin_lozev wrote: I just saw that Sony have apparently released a Move.me platform that is meant to stream all PS Move data through the PS3. I have not tried it, but the posts and youtube videos suggest that it already includes a pretty good fusion that does away with the drift. Have you tried it?
-
- One Eyed Hopeful
- Posts: 1
- Joined: Sat Jan 09, 2016 6:27 am
Re: PS move plugin
hello, i know this thread is old but i've been desperately trying to find a way to emulate a mouse with the ps move to use as makeshift headtracking in Star Citizen, i have no code experience whatsoever & i'm hoping someone could help me with a script to use the ps move with freePIE as it has the plugin for the ps move but beyond selecting that i dont know what to do.. lol
as well as how to emulate a mouse
ive got motioninjoy, movefrakework and emujoy working, ive tried to use ps move api but im so noob i cant even figure out how to install it haha
any help would be much appreciated
as well as how to emulate a mouse
ive got motioninjoy, movefrakework and emujoy working, ive tried to use ps move api but im so noob i cant even figure out how to install it haha
any help would be much appreciated