Page 4 of 9

Re: Razer hydra emulation

Posted: Tue Apr 19, 2016 11:16 pm
by gladiusz
Hey, look here https://code.google.com/archive/p/movef ... /downloads. There is moveframework_cs_sdk file. I think It should works better

Re: Razer hydra emulation

Posted: Wed Apr 20, 2016 6:20 am
by gladiusz
It's working! Wrapper works with motion controllers and navigation controllers. Wrapper from Github shows correct data and it shows informations about tracking with move button down. I include zip with all necessary dll included. Version from link from my previous post shows informations about tracking all time. I'm waiting for informations about plugin :)

Re: Razer hydra emulation

Posted: Sat Apr 23, 2016 11:05 am
by konstantin_lozev
I somehow missed this thread's point ATM. Is there Hydra emulation with the PS Move? That would be awesome keeping in mind that SteamVR now has Hydra support.

Re: Razer hydra emulation

Posted: Mon Apr 25, 2016 3:17 am
by CyberVillain
FreePIE can emulate Hydra so its up to you what device you use for input.

Re: Razer hydra emulation

Posted: Mon Apr 25, 2016 3:25 am
by CyberVillain
gladiusz wrote:It's working! Wrapper works with motion controllers and navigation controllers. Wrapper from Github shows correct data and it shows informations about tracking with move button down. I include zip with all necessary dll included. Version from link from my previous post shows informations about tracking all time. I'm waiting for informations about plugin :)
awsome, but the exe in that zip comes from where? Is it mine?

Re: Razer hydra emulation

Posted: Mon Apr 25, 2016 3:34 am
by gladiusz
Yes, it is. It is that exe which you compiled

Re: Razer hydra emulation

Posted: Mon Apr 25, 2016 4:09 am
by CyberVillain
Cool, please try this first version of a plugin (Do not forget to unblock dll)

It only has rotation and position for now

Re: Razer hydra emulation

Posted: Mon Apr 25, 2016 4:26 am
by CyberVillain
Are there two set of keys on the move?

They got both Key down event and Nav Key down event, they both use the same enum

Code: Select all

    public enum MoveButton
    {
        T1 = 0x1,
        T2 = 0x4,
        TRIANGLE = 0x10,
        CIRCLE = 0x20,
        CROSS = 0x40,
        SQUARE = 0x80,
        SELECT = 0x100,
        START = 0x800,
        STICK = 0x200,
        UP = 0x1000,
        RIGHT = 0x2000,
        DOWN = 0x4000,
        LEFT = 0x8000,
        PS = 0x10000,
        MOVE = 0x80000,
        T = 0x100000
    };

Re: Razer hydra emulation

Posted: Mon Apr 25, 2016 9:55 am
by gladiusz
I think it's ok. On Playstation it works in the same way. If somebody wants to have independent buttons on wand and navigation controller, I recommend SCP toolkit

Re: Razer hydra emulation

Posted: Mon Apr 25, 2016 10:43 am
by TiagoTiago
Btw, just curious; does the Move got analog buttons (aka pressure sensitive)?

Re: Razer hydra emulation

Posted: Mon Apr 25, 2016 12:31 pm
by gladiusz
TiagoTiago wrote:Btw, just curious; does the Move got analog buttons (aka pressure sensitive)?
Move doesn't have pressure sensitive.
CyberVillain wrote:Cool, please try this first version of a plugin (Do not forget to unblock dll)

It only has rotation and position for now
Works amazing! We have to restart FreePie after every use of script, beacuse the bulb doesn't light down in any way and it's messed up in every next use. So restart after every script's running and everything will be fine.

Code: Select all

hydra[0].yaw = psmove[0].pitch
hydra[0].pitch = -psmove[0].roll
hydra[0].roll = psmove[0].yaw
hydra[0].z = psmove[0].z*10
hydra[0].x = psmove[0].x*10
hydra[0].y = psmove[0].y*10
As we can see, names are a bit mixed, but I'm not sure if it's a mistake, because default hydra position is vertical and move is horizontal. I had error with MF_CWrapper.dll, but restarting move solved it.

Re: Razer hydra emulation

Posted: Tue Apr 26, 2016 12:36 am
by CyberVillain
Got my Vive yesterday so all night went to playing with that. Nice that it works, I will have to check why it needs restart, I do the same as the console test app.
It would be best if someone with a Move can continue work, easier to test :D

edit: question, the move framework has a trigger, a trigger1 and trigger2 plus on the button enumeration it has

Code: Select all

        T1 = 0x1,
        T2 = 0x4,
        T = 0x100000
Are these 6 invidual buttons, the same thing for 3 buttons?

Re: Razer hydra emulation

Posted: Tue Apr 26, 2016 1:07 am
by gladiusz
Trigger button and one trigger silder is the same thing. Second trigger is destinated as L2 trigger from navigation controller.

Re: Razer hydra emulation

Posted: Tue Apr 26, 2016 1:08 am
by CyberVillain
I will add all 6 plus the nav buttons and you can test what they mean..

Re: Razer hydra emulation

Posted: Tue Apr 26, 2016 2:24 am
by gladiusz
I think, that moveframework works with dualshock too. So trigger1 is L2 trigger, trigger2 is R2 and trigger is trigger from move. Moveframework require MotioninJoy to work with navigation controller/dualshock. Navigation controllers works perfect with joystick or Xbox plugin so I think it's no need to place them in psmove plugin

Re: Razer hydra emulation

Posted: Tue Apr 26, 2016 2:39 am
by CyberVillain
Please, try this version

Check values from trigger, trigger1 and trigger2. also check values of getDown and getNavDown, let me now If i should remove anything.

Re: Razer hydra emulation

Posted: Tue Apr 26, 2016 11:23 am
by gladiusz
With new dll I can't even ruth the script, beacause of MF_CWrapper.dll. Restarting move gives nothing.
Edit: Ok, it works. I had to restart move and freepie several times. Closing the browser is also a helpful thing. I discovered that trigger1 is L2 trigger from nav controller and trigger2 is L1 button from nav with pressure sensitive. Trigger is a trigger from ps move wand. StickX and StickY works ok. Default value is 128. We can even connect few nav/dualshock3, but we have to use MotioninJoy and PS2(with pressure sensitive) profil. Than, for example second nav is recognized as psmove[1].
But I have problem with buttons. For example, for:

Code: Select all

diagnostics.watch(psmove[0].getDown(MoveButton.CIRCLE))
I get error: "The key wasn't present in the dictionary"

Re: Razer hydra emulation

Posted: Tue Apr 26, 2016 4:43 pm
by CyberVillain
Will look at that tomorrow, thanks for testing

Re: Razer hydra emulation

Posted: Tue Apr 26, 2016 7:08 pm
by n8rockerasu
Awesome to see you guys working on this. I've been following along and ran into the same error as gladiusz. I'm pretty terrible at this, but I merged (see also: bastardized) the scripts that have been posted on the last couple pages and came up with this:

Code: Select all

if starting:
   hydra[0].isDocked = True
   hydra[0].enabled = True
   hydra[1].isDocked = True
   hydra[1].enabled = True
   
if keyboard.getPressed(Key.NumberPad0):
   hydra[0].isDocked = False

if keyboard.getPressed(Key.NumberPad1):
   hydra[1].isDocked = False

hydra[0].trigger = psmove[0].trigger
hydra[1].trigger = psmove[1].trigger

hydra[0].joybutton = psmove[0].getDown(MoveButton.START)
hydra[1].joybutton = psmove[1].getDown(MoveButton.START)

hydra[0].bumper = psmove[0].getDown(MoveButton.SELECT)
hydra[1].bumper = psmove[1].getDown(MoveButton.SELECT)

hydra[0].one = psmove[0].getDown(MoveButton.CROSS)
hydra[0].two = psmove[0].getDown(MoveButton.CIRCLE)
hydra[0].three = psmove[0].getDown(MoveButton.SQUARE)
hydra[0].four = psmove[0].getDown(MoveButton.TRIANGLE)

hydra[1].one = psmove[1].getDown(MoveButton.CROSS)
hydra[1].two = psmove[1].getDown(MoveButton.CIRCLE)
hydra[1].three = psmove[1].getDown(MoveButton.SQUARE)
hydra[1].four = psmove[1].getDown(MoveButton.TRIANGLE)

hydra[0].start = psmove[0].getDown(MoveButton.MOVE)
hydra[1].start = psmove[1].getDown(MoveButton.MOVE)


hydra[0].yaw = psmove[0].pitch
hydra[0].pitch = -psmove[0].roll
hydra[0].roll = psmove[0].yaw
hydra[0].z = psmove[0].z*10
hydra[0].x = psmove[0].x*10
hydra[0].y = psmove[0].y*10

hydra[1].yaw = psmove[1].pitch
hydra[1].pitch = -psmove[1].roll
hydra[1].roll = psmove[1].yaw
hydra[1].z = psmove[1].z*10
hydra[1].x = psmove[1].x*10
hydra[1].y = psmove[1].y*10
And yeah, it gives me "the key wasn't present in the dictionary" as soon as it gets to

Code: Select all

hydra[0].joybutton = psmove[0].getDown(MoveButton.START)
I tried playing around with it, removing that line and a few others, and it seems to catch every button command. When I remove that entire section, the script runs fine though...so the positioning and triggers appear to be good.

Re: Razer hydra emulation

Posted: Wed Apr 27, 2016 1:26 am
by CyberVillain
New version with a fix for your error

edit: Let me know if I should remove any buttons etc or the NavButton functions

Re: Razer hydra emulation

Posted: Wed Apr 27, 2016 4:59 am
by gladiusz
Ok, I tested it. All buttons from ps move work perfectly, but function getDown is exactly the same as getNavDown and it shows value "true" only for move's buttons. Nor getDown nor getNavDown recognise nav buttons. I think that for nav buttons should be something like:

Code: Select all

psmove[0].getDown(NavButton.UP)
So from MoveButtons, you can remove LEFT, RIRGHT, UP, DOWN, T1, T2, STICK

Re: Razer hydra emulation

Posted: Wed Apr 27, 2016 5:45 am
by CyberVillain
Please be more clear :D

For MoveButtons you want which buttons and for MoveNavButtons you want which buttons? (Today they use same enum, will create two enums with the correct buttons)

Re: Razer hydra emulation

Posted: Wed Apr 27, 2016 7:26 am
by gladiusz
Remove function getNavDown and getNavPressed. From MoveButtons, you can remove LEFT, RIRGHT, UP, DOWN, T1, T2, STICK, so MoveButtons should contains:

Code: Select all

diagnostics.watch(psmove[0].getDown(MoveButton.CIRCLE))
diagnostics.watch(psmove[0].getDown(MoveButton.CROSS))
diagnostics.watch(psmove[0].getDown(MoveButton.MOVE))
diagnostics.watch(psmove[0].getDown(MoveButton.PS))
diagnostics.watch(psmove[0].getDown(MoveButton.SELECT))
diagnostics.watch(psmove[0].getDown(MoveButton.SQUARE))
diagnostics.watch(psmove[0].getDown(MoveButton.START))
diagnostics.watch(psmove[0].getDown(MoveButton.T))
diagnostics.watch(psmove[0].getDown(MoveButton.TRIANGLE))
And MoveNavButtons shouldn't contain MOVE and T, so:

Code: Select all

diagnostics.watch(psmove[0].getDown(MoveNavButton.CIRCLE))
diagnostics.watch(psmove[0].getDown(MoveNavButton.CROSS))
diagnostics.watch(psmove[0].getDown(MoveNavButton.DOWN))
diagnostics.watch(psmove[0].getDown(MoveNavButton.LEFT))
diagnostics.watch(psmove[0].getDown(MoveNavButton.PS))
diagnostics.watch(psmove[0].getDown(MoveNavButton.RIGHT))
diagnostics.watch(psmove[0].getDown(MoveNavButton.SELECT))
diagnostics.watch(psmove[0].getDown(MoveNavButton.SQUARE))
diagnostics.watch(psmove[0].getDown(MoveNavButton.START))
diagnostics.watch(psmove[0].getDown(MoveNavButton.STICK))
diagnostics.watch(psmove[0].getDown(MoveNavButton.T1))
diagnostics.watch(psmove[0].getDown(MoveNavButton.T2))
diagnostics.watch(psmove[0].getDown(MoveNavButton.TRIANGLE))
diagnostics.watch(psmove[0].getDown(MoveNavButton.UP))

Re: Razer hydra emulation

Posted: Wed Apr 27, 2016 10:33 am
by jim_davis
gladiusz, you mentioned that there are better ways to connect the PS Move to a PC than using MotioninJoy. What do you use, if I may ask? DS3, DS4Windows, or SCP Drivers to connect your controllers through bluetooth? MotioninJoy is giving me bluescreens.

CyberVillain, is there any way to donate to you or to FreePIE? You are doing some awesome work, and I am reaping the fruits of your labor.

Re: Razer hydra emulation

Posted: Wed Apr 27, 2016 10:49 am
by gladiusz
Now I'm using MotioninJoy, but I bought addtional bluetooth dongle, so I'll be using SCP toolkit for Dualshocks and native BT stack for multiple Moves. You can use this method to pair Move with native stack: https://github.com/cboulay/psmove-ue4/w ... ller-Setup

Re: Razer hydra emulation

Posted: Wed Apr 27, 2016 2:37 pm
by n8rockerasu
Sweet! I've mostly got this working in SteamVR. Kind of funny using a Move...emulating a Hydra...emulating a Vive Wand, lol.

One weird issue I'm having with my Move controllers though is for some reason, they're turning off while I'm using them after 4-5 minutes. I'm presently using MotionInJoy to connect them (on Windows 10 and had no luck getting bluetooth working without MIJ). I saw in the MIJ settings there was an option to automatically disonnect BT controllers after X minutes of no button presses.

I unchecked it (and turned the time to 99 minutes just in case), even though that shouldn't be the issue. But it's still happening. I don't know if the bluetooth signal is dropping out or what...but it's pretty consistent in the timing, and I'm easily able to reconnect them. Anybody have any idea what's causing this?

Re: Razer hydra emulation

Posted: Wed Apr 27, 2016 4:02 pm
by gladiusz
Move completly turns off or the orb stops shining? If the second one it can be caused, that you turn on same other devices before move. Turn on move as the first device and test if your ps eye works corectly on Cl Eye Test. If it's the first problem, maybe it's caused by unstable connection with motioninjoy. Plese try the method with pairing from my previous post.

Re: Razer hydra emulation

Posted: Wed Apr 27, 2016 9:04 pm
by n8rockerasu
gladiusz wrote:Move completly turns off or the orb stops shining? If the second one it can be caused, that you turn on same other devices before move. Turn on move as the first device and test if your ps eye works corectly on Cl Eye Test. If it's the first problem, maybe it's caused by unstable connection with motioninjoy. Plese try the method with pairing from my previous post.
I think you might be right about the unstable connection. I just tested it again...just messing around in the Sixense 3D test thing in the SDK, while watching both controllers. Suddenly, one of them went dim (orb) and then the LED turned off. The other Move controller kept working and tracking just fine though. MotionInJoy insisted that both controllers were still connected though, and testing the vibration did get a reaction. When I tried testing the vibration on the (at the time) working Move controller, it went dim (orb) as well.

For my next test, I started everything back up and just set the controllers down right next to my PC (ie. as close to the bluetooth adapter as can be). And they both stayed connected and tracking for a good 25 minutes. So, I'm guessing my BT adapter is just a cheap piece of garbage, haha. Guess I need to hop on that sweet ASUS BT400 train. :)

Re: Razer hydra emulation

Posted: Thu Apr 28, 2016 1:14 am
by CyberVillain
jim_davis wrote:gladiusz, you mentioned that there are better ways to connect the PS Move to a PC than using MotioninJoy. What do you use, if I may ask? DS3, DS4Windows, or SCP Drivers to connect your controllers through bluetooth? MotioninJoy is giving me bluescreens.

CyberVillain, is there any way to donate to you or to FreePIE? You are doing some awesome work, and I am reaping the fruits of your labor.
Thanks for your kind words, no actually I haven't thought about that :D

Re: Razer hydra emulation

Posted: Thu Apr 28, 2016 1:48 am
by n8rockerasu
Naturally, after complaining about it, the next time I fired up the Move controllers they both stayed connected without issue for well over an hour. I'm not really sure what went differently...air particles? lol. But I got a good amount of experimenting done in various SteamVR games.

Like I said, I kind of just threw a script together based on what others had posted in here...but what I'm seeing is hydra[0] (left hand) tracking pretty smoothly. But hydra[1] (right hand) acts a bit screwy and is usually turned wrong. gladiusz posted this earlier, and I'm not clear on why pitch/yaw/roll are all mismatched...but this is what I have:

Code: Select all

hydra[0].yaw = psmove[0].pitch
hydra[0].pitch = -psmove[0].roll
hydra[0].roll = psmove[0].yaw
hydra[0].z = psmove[0].z*10
hydra[0].x = psmove[0].x*10
hydra[0].y = psmove[0].y*10

hydra[1].yaw = psmove[1].pitch
hydra[1].pitch = -psmove[1].roll
hydra[1].roll = psmove[1].yaw
hydra[1].z = psmove[1].z*10
hydra[1].x = psmove[1].x*10
hydra[1].y = psmove[1].y*10
Like I said, hydra[0] seems to be pretty spot on...but hydra[1] does not act the same. Tell me I'm stupid and there's an easy fix, haha. I appreciate the help.

Re: Razer hydra emulation

Posted: Thu Apr 28, 2016 2:15 am
by CyberVillain
We should probably let the user be able to use Quaternion instead of euler angles since both psmove and Sixense supports this. It could be a gimble lock problem you see.
Problem is this needs a big rewrite all the way down to the Sixense emulation. And frankly, I do not have the time

Re: Razer hydra emulation

Posted: Thu Apr 28, 2016 2:47 am
by konstantin_lozev
CyberVillain wrote:FreePIE can emulate Hydra so its up to you what device you use for input.
Yeah, I know, the point was whether FreePIE accepts already PS Move input...

Re: Razer hydra emulation

Posted: Thu Apr 28, 2016 3:18 am
by gladiusz
n8rockerasu, look here : https://code.google.com/archive/p/moveframework/. With MotioninJoy you have to have one Bluetooth adapter for every PS move. So if you want to use multiple moves use native windows stack. I'll do the same after testing plugin with correct enum of nav buttons.

Re: Razer hydra emulation

Posted: Thu Apr 28, 2016 3:22 am
by CyberVillain
gladiusz wrote:Remove function getNavDown and getNavPressed. From MoveButtons, you can remove LEFT, RIRGHT, UP, DOWN, T1, T2, STICK, so MoveButtons should contains:

Code: Select all

diagnostics.watch(psmove[0].getDown(MoveButton.CIRCLE))
diagnostics.watch(psmove[0].getDown(MoveButton.CROSS))
diagnostics.watch(psmove[0].getDown(MoveButton.MOVE))
diagnostics.watch(psmove[0].getDown(MoveButton.PS))
diagnostics.watch(psmove[0].getDown(MoveButton.SELECT))
diagnostics.watch(psmove[0].getDown(MoveButton.SQUARE))
diagnostics.watch(psmove[0].getDown(MoveButton.START))
diagnostics.watch(psmove[0].getDown(MoveButton.T))
diagnostics.watch(psmove[0].getDown(MoveButton.TRIANGLE))
And MoveNavButtons shouldn't contain MOVE and T, so:

Code: Select all

diagnostics.watch(psmove[0].getDown(MoveNavButton.CIRCLE))
diagnostics.watch(psmove[0].getDown(MoveNavButton.CROSS))
diagnostics.watch(psmove[0].getDown(MoveNavButton.DOWN))
diagnostics.watch(psmove[0].getDown(MoveNavButton.LEFT))
diagnostics.watch(psmove[0].getDown(MoveNavButton.PS))
diagnostics.watch(psmove[0].getDown(MoveNavButton.RIGHT))
diagnostics.watch(psmove[0].getDown(MoveNavButton.SELECT))
diagnostics.watch(psmove[0].getDown(MoveNavButton.SQUARE))
diagnostics.watch(psmove[0].getDown(MoveNavButton.START))
diagnostics.watch(psmove[0].getDown(MoveNavButton.STICK))
diagnostics.watch(psmove[0].getDown(MoveNavButton.T1))
diagnostics.watch(psmove[0].getDown(MoveNavButton.T2))
diagnostics.watch(psmove[0].getDown(MoveNavButton.TRIANGLE))
diagnostics.watch(psmove[0].getDown(MoveNavButton.UP))
hmm, so the method getNavDown does nothing? thats steange, it uses a different part of the SDK internaly

Re: Razer hydra emulation

Posted: Thu Apr 28, 2016 3:25 am
by gladiusz
It's exactly the same as getDown, so it shows true for move buttons exactly the same as getDown and no function shows true for nav buttons
Edit: For pairing the controller with native stack, iPi Recorder can be useful: http://ipisoft.com/download/. You can also look here for instructions: https://code.google.com/archive/p/movef ... tions.wiki. Calibration tool require CL Eye SDK installed in developer version. I'm placing this tool with all necessary dlls.

Re: Razer hydra emulation

Posted: Thu Apr 28, 2016 3:51 pm
by n8rockerasu
gladiusz wrote:It's exactly the same as getDown, so it shows true for move buttons exactly the same as getDown and no function shows true for nav buttons
Edit: For pairing the controller with native stack, iPi Recorder can be useful: http://ipisoft.com/download/. You can also look here for instructions: https://code.google.com/archive/p/movef ... tions.wiki. Calibration tool require CL Eye SDK installed in developer version. I'm placing this tool with all necessary dlls.
Thanks for the info. I've been around those sites quite a bit...but I do feel like I'm learning a more each time. So, maybe I'll get it working without MIJ next time.

You can pair mutliple controllers in MIJ though. You just have to go through the "load driver" step and "BluetoothPair" step with each one. (at least according to this site: http://wiki.ipisoft.com/Motion_in_Joy_Installation)

But I'd definitely welcome a different perspective and somebody else trying to figure it out. I did have the controllers connected very reliably last night. The tracking just wasn't as good as I would like. I'm not sure if that's partially because of having only the PSEye as a means of tracking or what. Considering the Vive has two base stations, I could see that being an issue for both the Move and Hydra systems.

Re: Razer hydra emulation

Posted: Thu Apr 28, 2016 4:11 pm
by gladiusz
You can pair multiple moves but you need as many adapter as controllers. With one adapter, framework see the moves, but moves don't shining in any way.

Re: Razer hydra emulation

Posted: Fri Apr 29, 2016 3:01 am
by gladiusz
CyberVillain, what about these nav buttons? And is it possible to get some data from accelerometer? I don't know what is with magnetometer, because in calibration tool I can see "Magnetometer is't calibrated" in every use and M button don't work with turning it on and off even after calibration. So I don't know, is it sense to make FreePie read informations about calibration, which are in settings.cfg file.

Re: Razer hydra emulation

Posted: Sun May 01, 2016 5:04 am
by zelmon64
CyberVillain wrote: It would be best if someone with a Move can continue work, easier to test :D
First off, thank you so much CyberVillain for all your work! FreePie is awesome! I've had great fun over the years using your codes for the wiimote and even used it one Christmas in a party game.

I've recently bought the ps move to play on the PS3 and thought I'd try using it on my PC as well. I've scoured the internet and just like for the wiimote, your software seems to be the easiest and most useful option for the ps move. I have your plugin up and running but thought I'd have a go at modifying it. I've managed to build the plugin from the psmove branch that you merged on github but realised that it's completely different to the plugin that you've been working on.

Could you please post the code that you've been building from? It would be so much easier for me to tinker with that than try to recreate your work.

I hope I'm asking this correctly - I've never posted in a forum before.

Re: Razer hydra emulation

Posted: Sun May 01, 2016 5:29 am
by CyberVillain
Hi, thanks for the kind words, I will delete that branch right away since its not the correct one. The correct one is not commited to github. sorry for that. Actually it was done from my office PC and I'm not there at the moment. I will commit the branch first thing tomrrow. Sorry for the inconvience