 |
WiiLi.org a new revolution
|
| View previous topic :: View next topic |
| Author |
Message |
Snark
Joined: 28 Dec 2006 Posts: 115
Digg It |
Posted: Wed Jan 03, 2007 9:09 am Post subject: Accelerometer driven mouse movement |
|
|
I managed to get WMD running without any problems and I've been playing around with it. So far I've only changed the button mapping to control VLC since I don't have a sensor bar and therefore can't use it for mouse movement.
I was wondering if anyone knew if somebody figured out how to edit one or more of the python scripts to use the accelerometers for mouse movement instead of IR sensing. I'm probably not going to get my hands on a Wii for quite some time and I don't much fancy the idea of building my own sensor bar, so it would be nice to have this functionality.
If there's nothing out there, maybe I'll just try and get a hold of the author. Thanks in advance to anyone who's feeling helpful.
Edit: Well... I did actually play around with editing WMD but after about 15 mins I realized that it was going to be too much work. Usually it's pretty easy to mess around with scripts even without any real experience, but to do what I want would probably take too damn long for me to figure out. That's not to say I can't do it, because I know I could if I spent enough time on it. Anyways...
I've decided to stop being lazy... sort of. I'm going to take the easier of two options and build a usb IR sensor bar. For a trial run, I tore apart an old bicycle rear clip on light and rigged up the little bulbs from it to one of my usb ports. Seems to work okay, so I guess I'll be heading to radio shack soon to get the parts to do one up proper-like.
So yeah.. not really asking for help anymore. Not that it matters... accelerometer movement is still important to have IMO because there's always the possibility that circumstances will leave someone without a sensor bar. This goes for any wiimote implementation, including on WiiLi. |
|
| Back to top |
|
 |
zgerrz
Joined: 05 Jan 2007 Posts: 4
Digg It |
Posted: Fri Jan 05, 2007 3:15 am Post subject: |
|
|
| Could you briefly explain how you got this "driver" to start working? I managed to grab my wiimote's ID number using the hcitool command, but I just can't figure out what command to issue to start the driver. Thanks vyer much. |
|
| Back to top |
|
 |
Snark
Joined: 28 Dec 2006 Posts: 115
Digg It |
Posted: Fri Jan 05, 2007 5:06 am Post subject: |
|
|
Yikes... if you couldn't figure out that much on your own, then you're in for a bit of trouble. No offense, it's just that IMHO the WMD documentation sucks.
To run WMD, open a terminal and cd to the directory where you extracted WMD, and run it with python WMD.py.
Of course, you will at least want to have a go at editing Config.py first. It's heavily commented so it shouldn't be too hard. |
|
| Back to top |
|
 |
zgerrz
Joined: 05 Jan 2007 Posts: 4
Digg It |
Posted: Fri Jan 05, 2007 6:53 am Post subject: |
|
|
lol, it SHOULD be so simple to run
I did follow the poorly documented files they provided, and ran WMD.py with python, but i get the following error:
| Code: | zgerrz@edgy:~$ python Desktop/wmd-0.1.2/WMD.py
Traceback (most recent call last):
File "Desktop/wmd-0.1.2/WMD.py", line 45, in ?
wmd = WMD()
File "Desktop/wmd-0.1.2/WMD.py", line 29, in __init__
ev = EVDispatcher( cf ) # In a way this is the core of the program. It dispatches events between each module
File "/home/zgerrz/Desktop/wmd-0.1.2/wmd/EVDispatcher.py", line 19, in __init__
self.xlib = EventBridge_PyXlib( self, cf )
TypeError: __init__() should return None
zgerrz@edgy:~$ |
All I changed in the config.py file was my wiimote address. i'm not knowledgable in any programming languages, including python, so i cant make much sense of the output i keep getting. |
|
| Back to top |
|
 |
Snark
Joined: 28 Dec 2006 Posts: 115
Digg It |
Posted: Fri Jan 05, 2007 7:55 am Post subject: |
|
|
Ah, you're running ubuntu edgy.
open your Config.py again and edit it so that the following section looks like this:
| Code: | #'UINPUT_DEV': "/dev/misc/uinput",
'UINPUT_DEV': "/dev/input/uinput", ##ubuntu - you need to modprobe uinput first |
then do a sudo modprobe uinput as instructed by the commenting.
You need a version of python-xlib that isn't in the repos for edgy. You can get it from dapper. I've made a note in the wiki page for WMD that links to it. It's at the bottom area of the user feedback section. http://www.wiili.org/index.php/WMD Oh, and be sure to "patch" it like the WMD documentations says.
Make sure you have everything else installed as well. There's a list of required packages right above the blurb about ubuntu edgy.
Everything should be fine now.
Use sudo again to run WMD.py like this: sudo python WMD.py and play around with your wiimote driven mouse.
You should note that everytime you boot your computer, you'll need to modprobe uinput again unless you make a modification to one of your startup scripts. I think it's /etc/modules. Here is a tiny conveniant script that you can use instead:
| Code: | #!/bin/bash
# WMD startup script
modprobe uinput
python /home/zgerrz/Desktop/wmd\-\0\.\1\.\2/WMD\.py
#End of file |
Save it as wmd.sh and put it wherever you like, then make yourself a applications menu entry with "gksudo sh /path/to/wmd.sh" in the command field. This way when you want to run WMD, you just click the menu entry and type your password in the box that comes up.
If you need some help with keymapping, let me know. It should be pretty straightforward though.
Wow... I had hoped to avoid making you a whole guide...  |
|
| Back to top |
|
 |
zgerrz
Joined: 05 Jan 2007 Posts: 4
Digg It |
Posted: Fri Jan 05, 2007 9:19 am Post subject: |
|
|
OK, after a bunch of tweaking, I managed to get it to work!
The only thing I need to do now is find some way to reliably simulate the sensor bar so that I can use the wiimote as my mouse. My lighter worked for a little bit, but I can't use that all the time.
Thanks a lot for your help. |
|
| Back to top |
|
 |
wtruong
Joined: 05 May 2007 Posts: 1
Digg It |
Posted: Sat May 05, 2007 8:59 am Post subject: same error but followed all the steps on wiki, |
|
|
hi im running ubuntu fiesty 64 bit, I'm getting the same errors as the guy above and i was wondering how to fix it. I've done the patching and the modprobing and the dependency installing but i still get that error
| Code: | zgerrz@edgy:~$ python Desktop/wmd-0.1.2/WMD.py
Traceback (most recent call last):
File "Desktop/wmd-0.1.2/WMD.py", line 45, in ?
wmd = WMD()
File "Desktop/wmd-0.1.2/WMD.py", line 29, in __init__
ev = EVDispatcher( cf ) # In a way this is the core of the program. It dispatches events between each module
File "/home/zgerrz/Desktop/wmd-0.1.2/wmd/EVDispatcher.py", line 19, in __init__
self.xlib = EventBridge_PyXlib( self, cf )
TypeError: __init__() should return None
zgerrz@edgy:~$ |
Any suggestions?? |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|