ajayyy / Wiimote-FreePIE-VR-Controls

FreePIE plugin to try to make the Wiimote work as a SteamVR controller with a Leap Motion
32 stars 1 forks source link

Wiimote + Kinect Using Driver4VR #6

Closed Vininess closed 6 years ago

Vininess commented 6 years ago

Hi

After digging on the internet i found your code, it's work, i can access home menu pressing the home button, but i don't have de Leapmotion, also i have one question and one request

I'm using two wiiremote with wii motion plus, one of them is the newer version, both connect (vibrates to check) but the newer just blinking the lights, i don't know if the controller is working, on the debug don't show info about this controller

And i have a request, can you write a code on freepie, just for use this two wiiremotes, to send the Pitch, Yaw and row information, because i want to use the kinect with the driver4vr to track the spatial position

Thanks for the help and the code

ajayyy commented 6 years ago

Oooh that's cool, I've heard of Driver4VR but I didn't know they got their Kinect driver working.

You should be able to remove all leap motion dependencies by doing ctrl+f and deleting all lines mentioning leap motion.

I hope it works out for you. If it does, I would really like to hear how it works. My original plan was to do Wiimote + Kinect, but couldn't figure out how to use Kinect in Freepie, and couldn't figure out how the leap motion C++ plugin worked.

Good Luck!

ajayyy commented 6 years ago

Also, I think in one of the files, the orientation is pulled from the leap motion instead of the wiimote because the wiimote sometimes doesn't send the orientation right to FreePIE. So, make sure you are not using that file

ajayyy commented 6 years ago

In response to the blinking lights, that could be an issue with your bluetooth adapter, maybe it doesn't allow having multiple devices connected, or if you are using bluetooth headphones as well, maybe that is too many devices. One solution to that would be to maybe get a usb bluetooth adapter.

Vininess commented 6 years ago

I got the test version of Driver4VR, because here in Brazil the kinect is the cheapest way to track, here i found the Leapmotion 10x the original price

I will try the files and the kinect on this month then i will send a feedback

For the blinking lights, i use a generic china dongle, and Windows shows me the two controllers, i try the newer controle alone and get the same results. for the older controller when the script is running only the one light shows, like when i use the controller normally on wiiu

Vininess commented 6 years ago

I use the wiimote_leap_vive_2.py, delete the Leap part, but the FreePie can't receive the info

error

As you can see, both controllers appears here to me

error 2

And another question, those codes uses the Wiimotion plus? if not, how i can use then?

Thanks again

ajayyy commented 6 years ago

So what you want is for the wiimote to trigger button presses, and maybe have the pitch and roll (since wiimotes do not track yaw). And then Driver4VR tracks the position of you and your hands?

Vininess commented 6 years ago

I read on the internet, that the Wiiremote plus, can track yaw, same as the psmove, but the normal Wiimote you need to use the infrared (you can see an exemple in the legend of zelda skyward sword, you can control the pointer using just the giroscopes)

"... And then Driver4VR tracks the position of you and your hands?"

Yes thats is my idea, use the Wiiremote plus, to track the Yaw, Pitch and Row, and the Driver4VR to track the position X,Y,Z, as you can see in this video in a group on steam

https://steamcommunity.com/groups/WiionPC/discussions/0/348293292497283892/

ajayyy commented 6 years ago

Yes, it can track yaw that way.

So the way freepie works is that it tracks the positions for you and makes it easy for you to use the data. So my plugin takes wii button presses and emulates hydra button presses, which then emulates steamvr button presses with the razer hydra plugin

Vininess commented 6 years ago

So your code or the freepie 'can detects that i using the wiiremote plus? Or i have to change your code? If i have to change, can you help me?

Thanks a lot

ajayyy commented 6 years ago

My code just uses the wiimote[0] and wiimote[1] from FreePIE, so FreePIE handles all that. So, it should work with your Wii Motion Plus, because others said they got it working with Wii Motion Plus,

Vininess commented 6 years ago

I made it work :)

For the new wiimote plus (aka TR) i just change the driver of my generic china blutooth for this Toshiba Stack Blutooth driver, like in this tutorial http://www.wiinupro.com/tutorials/toshiba-stack

But i got some issues...

I try your "wiimote_leap_vive_2.py", i remove the leap part, but when i start the VR Room on Steam my camera apears below the floor and my hands far from me

I try the code from this guy https://www.youtube.com/watch?v=VJkkpdSatG4 i can see my hands, all the sensors works very fine, but he tries to emulate X,Y,Z with buttons and sensor and my right hand get some confused (i have to point back to get my shotgun pointed front in Skeet VR)

ajayyy commented 6 years ago

I looked at his files, did motionplus_rotation_only_v1.1.py work?

Also, I now think there might be an issue with using this and Driver4VR together. Do you know how Driver4VR works, what does it emulate to create controller positions? Because how would it work while there is a hydra emulation at the same time. Does it use hydra emulation, if so that would be good.

Vininess commented 6 years ago

I tried motionplus_rotation_only_v1.1.py, works quite good, i notice these issues

Have no buttons (of course, is just que motion plus rotation) If i Shakeit hard, the sensors need to recalibrate If i rotate 360 degrees Yaw or Pitch, the virtual controller complet the circle

Also the sensors are pretty smooth, i think there is a code problem


For the Driver4VR, i saw some peoples using with the freepie, like an complement.

When you install he opens auto with SteamVR, and he shows what setup you using, he detects i using the Hydra, see below driver4vr

ajayyy commented 6 years ago

Ok, check out my comment in issue #7

Vininess commented 6 years ago

Can i take you code wiimote_vive_only_buttons.py and combine with the motionplus_rotation_only_v1.1.py, to get the buttons working with the giros?

ajayyy commented 6 years ago

Feel free, I would really like to see how that works out for you.

Vininess commented 6 years ago

I simple copy and paste, the controller dont work on sixsense tester, and any of the controles apears on virtual space on steamVR, but i think thats motionplus_rotation_only_v1.1.py have the buttons working, i simple press "A" and apears to me the walking path, but none of the controllers

ajayyy commented 6 years ago

try putting my code at the bottom

ajayyy commented 6 years ago

and take out the last 6 lines of their code

Vininess commented 6 years ago

it works, but i can't see the controllers, on virtual space

Do you have any link, can i use to learn some basics to code the wiiremote on the freepie? using the Hydra Emulation

ajayyy commented 6 years ago

use wiimote[0] and wiimote[1] and if you add a dot, the program should give suggestions on possible variables.

for hydra use hydra[0] and hydra[1].

wiimote[1].buttons.button_down(WiimoteButtons.Home) checks if the second wiimote has the home button down.

You can set different hydra buttons like this hydra[1].one = true

It is in a python like syntax

Vininess commented 6 years ago

I see

I think to modify the values of this code to get more precise orientation, but why can i map arrow key to move the controle in XYZ? For tests proposes only

ajayyy commented 6 years ago

Are you asking how you could map the arrowkeys to control position?

Vininess commented 6 years ago

Yes, press the up arrow and the controller go up in the +x, when i press down the controller goes -x, same as the left and right.

Because i don't get the kinect yet, and i need just to test the controllers

ajayyy commented 6 years ago

I'll write that up for you, you're welcome

ajayyy commented 6 years ago

Use:

hydra[1].x = 10
hydra[1].y = 10
hydra[1].z = 10

and set those coordinates to what you want.

You can get wii buttons with

wiimote[1].buttons.button_down(WiimoteButtons.DPadUp)

Vininess commented 6 years ago

I'll write that up for you, your welcome

Thanks a lot

Use:...

I will try Thanks again

Vininess commented 6 years ago

i put the code

hydra[1].x = 10 hydra[1].y = 10 hydra[1].z = 10

but i can't change the position

i can use this code, changing the wiimote to keyboard arrow? i can control the position using the keyboard?

if wiimote[0].buttons.button_down(WiimoteButtons.DPadUp): scale1 += 0.003

hydra[0].z = scale1*(math.sin(yaw1_rad - 0.5*math.pi)*300 - 150) hydra[0].x = scale1*(-math.cos(yaw1_rad - 0.5*math.pi)*300 - 150)

ajayyy commented 6 years ago

Yes, that's how you would do it. Though, I do not understand what yaw1_rad is from

Vininess commented 6 years ago

i not at home now, but i can use something like this?

if keyboard.getKeyDown(Key.DownArrow): scale1 += 10

hydra[0].x = scale1

Vininess commented 6 years ago

i read some stuffs on the inter, saying that the wiiremote plus, can't have the magnetometer to not to drift like in the psmove

Do you have any idea to avoid this?

ajayyy commented 6 years ago

Only way it can track yaw is using the sensor bar, and it will track it in relation to the sensor bar, which may be out of range when playing normally

Vininess commented 6 years ago

I read the motion plus, can track the yaw, but the controller use the sensor bar to recalibrate the controller, if you don't have the sensor bar, the control tends to drift and you have to manual recalibrate

I think it is another way to avoid this, like soldering a magnetometer on the wiiremote or puts various IR leds on the room

Vininess commented 6 years ago

I turn on my wii and test the controller on The Legend of Zelda: Skyward Sword, and it is like i said, the game let me control the cursor without use the sensor bar but if i hard shake or shortly after the pointer get out of line with the controle, but when i pass in front or sensor bar or any IR, the control recalibrate

ajayyy commented 6 years ago

Woah that is really cool, I've never used the wii motion plus before.

Vininess commented 6 years ago

The motion plus is awesome, i end a game called RedStell 2 and it have a good motion, the sensor of the motion plus is like the same in the psmove, but the psmove uses the mag to recalibrate and the wii uses the sensor bar

Vininess commented 6 years ago

@ajayyy tell me one thing, can i use the kinect to trackthe head position, hands position and recalibrate the wiiremote? Can i use a code to do that, like put some lights in the controller? Do you have any idea?

ajayyy commented 6 years ago

Closing, conversation has moved to #7