Wiimote

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(added nunchuk section)
Line 1: Line 1:
You can use the Wiimote for controlling the viewer. Why use a wiimote?! I thought you would never ask. Using a wiimote, you have much superior control and oversight when you're in a presentation situation. Imagine yourself showing something in-world to your co-workers/friends, while you have to control a mouse and keyboard, sitting in a horrible chair.
+
==Overview==
 
+
You can use the Wiimote and the nunchuck for controlling the viewer. Using a wiimote, one has a powerful freehand 3d-controller which has all the options to navigate freely when in a presentation situation. The software used is [http://abstrakraft.org/cwiid/ cwiid]. Cwiid lets you control the accelerometer, the ir-camera, and every button on the wiimote and nunchuck through the use of config-files. The hardware used: 1 Wiimote(~40 euro), 1 nunchuck(~20 euro), 1 wireless wiibar(~15 euro), and a bluetooth dongle(~10 euro).  
With the wiimote you can run around, serve coffee, and let your buddies control it without asking them to come over. Enough propaganda. Let's get to it.
+
 
+
The software i'll be using is [http://abstrakraft.org/cwiid/ cwiid] (Not available on Bill OS though). Cwiid lets you control the accelerometer, the ir-camera, and every button on the wiimote through the use of config-files. The hardware i'm using: 1 Wiimote(~40 euro), 1 ir-pointer(ir-led, 2 1.5V batteries, 1 on/off switch, an empty marker to stuff it in)(~10 euro), and a bluetooth dongle(~15 euro). Once the bluetooth dongle is running(check out the bluez-libs/bluez-utils), you'll be able to fire up wminput. It has some standard configfiles for functionality. Find out where the config-files are(one is called "ir_ptr"). Make a new file named "opensim" in the same directory, and fill it with:
+
  
 +
==Procedure==
 +
* Install the bluez libraries
 +
* Run the bluetooth daemon
 +
* Download and compile cwiid svn
 +
<source lang="bash">
 +
svn co http://abstrakraft.org/cwiid/svn/trunk cwiid
 +
cd /cwiid
 +
autoreconf
 +
./configure
 +
make
 +
make install
 +
vi /usr/local/etc/cwiid/wminput/opensim #paste source beneath in, and save
 +
modprobe uinput
 +
wminput -c opensim
 +
</source>
 +
* Make a new configuration file for wminput
 +
* Find out where the config-files are(one is called "ir_ptr"). Make a new file named "opensim" in the same directory. Fill with one of the config-options beneath:
 +
''suboptimal wiimote-only setup''
 
<source lang="bash">
 
<source lang="bash">
 
#ir_ptr
 
#ir_ptr
Line 21: Line 36:
 
wminput -c opensim
 
wminput -c opensim
 
</source>
 
</source>
 +
There are basically 4 essential keys that the viewer uses, but the wiimote interface is not really suited to control 4 buttons within the hand's normal reach. So - lets have a look at that configfile again - you can see that the right mouse-button is out of alignment with your normal handposition on the wiimote. You normally won't use that button(option menu) as often as the other onces. The buttons within reach are all configured to control the way you position the camera.  A-Button is mouse leftclick(select object, select pivot-point), The B-Button is yaw, and digital-down is pitch.
  
Now you should have a "wiimote-only" setup. There are basically 4 essential keys that the viewer uses, but the wiimote interface is not really suited to control 4 buttons within the hand's normal reach. So - lets have a look at that configfile again - you can see that the right mouse-button is out of alignment with your normal handposition on the wiimote. You normally won't use that button(option menu) as often as the other onces. The buttons within reach are all configured to control the way you position the camera.  A-Button is mouse leftclick(select object, select pivot-point), The B-Button is yaw, and digital-down is pitch.
+
With a nunchuck we can relieve the moving-controls to the analogue controller. Also, the down-button linked to left-ctrl is somewhat a hack. It works, but it's not the most natural approach possible. The wiimote-nunchuck configuration:
 
+
Now, it would be better if we also had a nunchuck(just gonna buy one soon). With a nunchuck we acn relieve the moving-controls to the analogue controller. Also, the down-button as left-ctrl is a kinda hack. It works in this setup, but it's not the most natural approach possible. I'll continue this paper, after i bought the nunchuck.
+
 
+
Ok, i got myself a nunchuk, but lost the dongle(^@#&*($^@). Anyway, i had some time to test it, and here are the results: The wiimote with the nunchuk is a great interface to opensim, once you're used to it. I did some practical testing with the mapping (see instructions beneath), and found out an optimal configuration where building is not limited by the controls. The two extra buttons on the nunchuk are really required to use with building skills. There is not really a solution when you want to handle scripting, so you still need a keyboard for that. Even with a software-keyboard(like opera on the wii), its not really that handy. Here is how to setup cwiid:
+
 
+
<source lang="bash">
+
svn co http://abstrakraft.org/cwiid/browser/trunk cwiid
+
cd /cwiid
+
autoreconf
+
./configure
+
make
+
make install
+
vi /usr/local/etc/cwiid/wminput/opensim #paste source beneath in, and save
+
modprobe uinput
+
wminput -c opensim
+
</source>
+
 
+
 
<source lang="bash">
 
<source lang="bash">
 
include buttons
 
include buttons
Line 64: Line 63:
 
Plugin.nunchuk_stick2btn.Right  = KEY_RIGHT
 
Plugin.nunchuk_stick2btn.Right  = KEY_RIGHT
 
</source>
 
</source>
'Notice the Plugin.nunchuck_stick2btn, which is only in the svn-version of cwiid.'
+
''Notice the Plugin.nunchuck_stick2btn, which is only in the svn-version of cwiid.''

Revision as of 08:36, 7 January 2009

Overview

You can use the Wiimote and the nunchuck for controlling the viewer. Using a wiimote, one has a powerful freehand 3d-controller which has all the options to navigate freely when in a presentation situation. The software used is cwiid. Cwiid lets you control the accelerometer, the ir-camera, and every button on the wiimote and nunchuck through the use of config-files. The hardware used: 1 Wiimote(~40 euro), 1 nunchuck(~20 euro), 1 wireless wiibar(~15 euro), and a bluetooth dongle(~10 euro).

Procedure

  • Install the bluez libraries
  • Run the bluetooth daemon
  • Download and compile cwiid svn
svn co http://abstrakraft.org/cwiid/svn/trunk cwiid
cd /cwiid
autoreconf
./configure
make
make install
vi /usr/local/etc/cwiid/wminput/opensim #paste source beneath in, and save
modprobe uinput
wminput -c opensim
  • Make a new configuration file for wminput
  • Find out where the config-files are(one is called "ir_ptr"). Make a new file named "opensim" in the same directory. Fill with one of the config-options beneath:

suboptimal wiimote-only setup

#ir_ptr
include buttons
 
Plugin.ir_ptr.X	= ~ABS_X
Plugin.ir_ptr.Y	= ~ABS_Y
Wiimote.A	= BTN_LEFT
Wiimote.Plus	= BTN_RIGHT
Wiimote.B	= KEY_LEFTALT
Wiimote.Down	= KEY_LEFTCTRL

Execute:

wminput -c opensim

There are basically 4 essential keys that the viewer uses, but the wiimote interface is not really suited to control 4 buttons within the hand's normal reach. So - lets have a look at that configfile again - you can see that the right mouse-button is out of alignment with your normal handposition on the wiimote. You normally won't use that button(option menu) as often as the other onces. The buttons within reach are all configured to control the way you position the camera. A-Button is mouse leftclick(select object, select pivot-point), The B-Button is yaw, and digital-down is pitch.

With a nunchuck we can relieve the moving-controls to the analogue controller. Also, the down-button linked to left-ctrl is somewhat a hack. It works, but it's not the most natural approach possible. The wiimote-nunchuck configuration:

include buttons
 
Plugin.ir_ptr.X = ~ABS_X
Plugin.ir_ptr.Y = ~ABS_Y
Wiimote.A       = BTN_LEFT
Wiimote.B       = KEY_LEFTALT
Nunchuk.C       = KEY_LEFTSHIFT
Nunchuk.Z       = KEY_LEFTCTRL
 
Wiimote.Up      = KEY_PAGEUP
Wiimote.Down    = KEY_PAGEDOWN
Wiimote.Left    = KEY_LEFT
Wiimote.Right   = KEY_RIGHT
Wiimote.Plus    = BTN_RIGHT
Wiimote.Minus   = KEY_B
Wiimote.Home    =KEY_M
#Wiimote.1      = KEY_PROG1
#Wiimote.2      = KEY_PROG2
Plugin.nunchuk_stick2btn.Up     = KEY_UP
Plugin.nunchuk_stick2btn.Down   = KEY_DOWN
Plugin.nunchuk_stick2btn.Left   = KEY_LEFT
Plugin.nunchuk_stick2btn.Right  = KEY_RIGHT

Notice the Plugin.nunchuck_stick2btn, which is only in the svn-version of cwiid.

Personal tools
General
About This Wiki