PS move plugin

Official forum for open source FreePIE discussion and development.
Fayt3X
One Eyed Hopeful
Posts: 7
Joined: Mon Jul 23, 2012 1:41 pm
Location: Austin, TX

PS move plugin

Post by Fayt3X »

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.)
User avatar
brantlew
Petrif-Eyed
Posts: 2221
Joined: Sat Sep 17, 2011 9:23 pm
Location: Menlo Park, CA

Re: PS move plugin

Post by brantlew »

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.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: PS move plugin

Post by CyberVillain »

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
Fayt3X
One Eyed Hopeful
Posts: 7
Joined: Mon Jul 23, 2012 1:41 pm
Location: Austin, TX

Re: PS move plugin

Post by Fayt3X »

I just got back from my trips, and I now have hardware. I'll start working on this tonight. :D
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: PS move plugin

Post by CyberVillain »

Fayt3X wrote:I just got back from my trips, and I now have hardware. I'll start working on this tonight. :D
Cool! Just let us know if you run into problems

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
Fayt3X
One Eyed Hopeful
Posts: 7
Joined: Mon Jul 23, 2012 1:41 pm
Location: Austin, TX

Re: PS move plugin

Post by Fayt3X »

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.
NoxWings
One Eyed Hopeful
Posts: 44
Joined: Thu May 15, 2014 8:04 am

Re: PS move plugin

Post by NoxWings »

¿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 ^^.
Fayt3X
One Eyed Hopeful
Posts: 7
Joined: Mon Jul 23, 2012 1:41 pm
Location: Austin, TX

Re: PS move plugin

Post by Fayt3X »

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 ^^.
No sorry.
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.
User avatar
Fredz
Petrif-Eyed
Posts: 2255
Joined: Sat Jan 09, 2010 2:06 pm
Location: Perpignan, France
Contact:

Re: PS move plugin

Post by Fredz »

There is also the PS Move API.
NoxWings
One Eyed Hopeful
Posts: 44
Joined: Thu May 15, 2014 8:04 am

Re: PS move plugin

Post by NoxWings »

Fredz wrote:There is also the PS Move API.
Yep, I know. I'm working with it right now, making a unity plugin since the unimove one is pretty outdated :D.
So I guess I'll be checking the FreePIE plugin after I get the unity plugin done, but I can't promise anything.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: PS move plugin

Post by CyberVillain »

Would be nice if you could do that. Please fork FreePIE so that I can pull the change once you are done
NoxWings
One Eyed Hopeful
Posts: 44
Joined: Thu May 15, 2014 8:04 am

Re: PS move plugin

Post by NoxWings »

CyberVillain wrote:Would be nice if you could do that. Please fork FreePIE so that I can pull the change once you are done
I've got some spare time so I'll try to do it now ^^
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.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: PS move plugin

Post by CyberVillain »

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 :D
NoxWings
One Eyed Hopeful
Posts: 44
Joined: Thu May 15, 2014 8:04 am

Re: PS move plugin

Post by NoxWings »

Wow I've found the weirdest thing I've seen ever :woot

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!! :shock:

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)
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: PS move plugin

Post by CyberVillain »

The plugin dependency resolver is pretty dumb. That line will invoke the joystick plugin :P
NoxWings
One Eyed Hopeful
Posts: 44
Joined: Thu May 15, 2014 8:04 am

Re: PS move plugin

Post by NoxWings »

CyberVillain wrote:The plugin dependency resolver is pretty dumb. That line will invoke the joystick plugin :P
Yep, I guess so.

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.
NoxWings
One Eyed Hopeful
Posts: 44
Joined: Thu May 15, 2014 8:04 am

Re: PS move plugin

Post by NoxWings »

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).

Code: Select all

if starting:
	joystick[0]
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.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: PS move plugin

Post by CyberVillain »

NoxWings wrote:
CyberVillain wrote:The plugin dependency resolver is pretty dumb. That line will invoke the joystick plugin :P
Yep, I guess so.

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.
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 etc

The code: https://github.com/AndersMalmgren/FreeP ... ser.cs#L38
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: PS move plugin

Post by CyberVillain »

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? :D
NoxWings
One Eyed Hopeful
Posts: 44
Joined: Thu May 15, 2014 8:04 am

Re: PS move plugin

Post by NoxWings »

CyberVillain wrote:
NoxWings wrote:
CyberVillain wrote:The plugin dependency resolver is pretty dumb. That line will invoke the joystick plugin :P
Yep, I guess so.

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.
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 etc

The code: https://github.com/AndersMalmgren/FreeP ... ser.cs#L38
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. xD
NoxWings
One Eyed Hopeful
Posts: 44
Joined: Thu May 15, 2014 8:04 am

Re: PS move plugin

Post by NoxWings »

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? :D
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.

About the psmove being exposed as a joystick, I'm unsure but I think that it won't be able to retrieve any data.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: PS move plugin

Post by CyberVillain »

The joystick plugin is NOT currenly lazyloading the devices. IT takes exclusive hold of them all
NoxWings
One Eyed Hopeful
Posts: 44
Joined: Thu May 15, 2014 8:04 am

Re: PS move plugin

Post by NoxWings »

CyberVillain wrote:The joystick plugin is NOT currenly lazyloading the devices. IT takes exclusive hold of them all
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.

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. ^^
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: PS move plugin

Post by CyberVillain »

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)

Code: Select all

var device = directInput.GetDevices(DeviceClass.GameController, DeviceEnumerationFlags.AttachedOnly).Where((d, i) => i == index).FirstOrDefault()
index is the argument you get from the the GlobalIndexer Create method
NoxWings
One Eyed Hopeful
Posts: 44
Joined: Thu May 15, 2014 8:04 am

Re: PS move plugin

Post by NoxWings »

CyberVillain 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)

Code: Select all

var device = directInput.GetDevices(DeviceClass.GameController, DeviceEnumerationFlags.AttachedOnly).Where((d, i) => i == index).FirstOrDefault()
index is the argument you get from the the GlobalIndexer Create method
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 :S

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.
NeoTokyo_Nori
Cross Eyed!
Posts: 144
Joined: Wed Jul 16, 2014 10:29 am
Location: Tokyo, Japan

Re: PS move plugin

Post by NeoTokyo_Nori »

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!
Last edited by NeoTokyo_Nori on Fri Sep 05, 2014 2:01 am, edited 1 time in total.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: PS move plugin

Post by CyberVillain »

NoxWings wrote:
CyberVillain 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)

Code: Select all

var device = directInput.GetDevices(DeviceClass.GameController, DeviceEnumerationFlags.AttachedOnly).Where((d, i) => i == index).FirstOrDefault()
index is the argument you get from the the GlobalIndexer Create method
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 :S

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.
I can have a look at the Joystick plugin side of things later. Just leave that for now
NoxWings
One Eyed Hopeful
Posts: 44
Joined: Thu May 15, 2014 8:04 am

Re: PS move plugin

Post by NoxWings »

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!
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.
NoxWings
One Eyed Hopeful
Posts: 44
Joined: Thu May 15, 2014 8:04 am

Re: PS move plugin

Post by NoxWings »

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.
NeoTokyo_Nori
Cross Eyed!
Posts: 144
Joined: Wed Jul 16, 2014 10:29 am
Location: Tokyo, Japan

Re: PS move plugin

Post by NeoTokyo_Nori »

NoxWings 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).
Thats good news :)
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. 8-)
konstantin_lozev
Cross Eyed!
Posts: 192
Joined: Fri Jul 04, 2014 1:43 am

Re: PS move plugin

Post by konstantin_lozev »

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...
NoxWings
One Eyed Hopeful
Posts: 44
Joined: Thu May 15, 2014 8:04 am

Re: PS move plugin

Post by NoxWings »

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...
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.

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.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: PS move plugin

Post by CyberVillain »

Drift with optical tracking? Sounds strange
NoxWings
One Eyed Hopeful
Posts: 44
Joined: Thu May 15, 2014 8:04 am

Re: PS move plugin

Post by NoxWings »

CyberVillain wrote:Drift with optical tracking? Sounds strange
Drift with the move orientation, not with the positional tracking.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: PS move plugin

Post by CyberVillain »

Ah, offcours with only one light you cant do rotation tracking
konstantin_lozev
Cross Eyed!
Posts: 192
Joined: Fri Jul 04, 2014 1:43 am

Re: PS move plugin

Post by konstantin_lozev »

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).
konstantin_lozev
Cross Eyed!
Posts: 192
Joined: Fri Jul 04, 2014 1:43 am

Re: PS move plugin

Post by konstantin_lozev »

NoxWings wrote:
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...
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.

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.
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
One Eyed Hopeful
Posts: 44
Joined: Thu May 15, 2014 8:04 am

Re: PS move plugin

Post by NoxWings »

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?
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
Cross Eyed!
Posts: 192
Joined: Fri Jul 04, 2014 1:43 am

Re: PS move plugin

Post by konstantin_lozev »

NoxWings wrote:
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?
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.
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...
Curtiola
One Eyed Hopeful
Posts: 1
Joined: Sat Jan 09, 2016 6:27 am

Re: PS move plugin

Post by Curtiola »

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 :)
Post Reply

Return to “FreePIE”