Wiimote

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m (Robot: Cosmetic changes)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
{{Template:Quicklinks}}
+
{{Quicklinks}}
 
<br />
 
<br />
  
==Overview==
+
== Overview ==
 
You can use the Wiimote(Plus) 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).  
 
You can use the Wiimote(Plus) 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).  
  
==Procedure==
+
== Procedure ==
* Install the bluez libraries
+
* Install the bluez libraries (libbluetooth3 and libbluetooth-dev)
 
* Run the bluetooth daemon
 
* Run the bluetooth daemon
 
* Download and compile cwiid from git
 
* Download and compile cwiid from git
Line 13: Line 13:
 
git clone https://github.com/abstrakraft/cwiid.git
 
git clone https://github.com/abstrakraft/cwiid.git
 
cd ./cwiid
 
cd ./cwiid
atlocal
+
aclocal
 
autoconf
 
autoconf
vi /etc/ld.so.conf
 
( add a line "include /usr/local/lib")
 
ldconfig
 
 
./configure  
 
./configure  
 
make
 
make
 
make install
 
make install
 
</source>
 
</source>
Or you can directory download wminput and wmgui via apt-get or so.
+
* Or you can simply download wminput and wmgui via apt-get or so.
 +
<source lang="bash">
 +
apt-get install wminput wmgui
 +
</source>
  
 
* Make a new configuration file for wminput, and fill with the wiimote-only or wiimote-nunchuck(prefered) setup
 
* Make a new configuration file for wminput, and fill with the wiimote-only or wiimote-nunchuck(prefered) setup
Line 28: Line 28:
 
  vi /usr/local/etc/cwiid/wminput/opensim
 
  vi /usr/local/etc/cwiid/wminput/opensim
 
</source>
 
</source>
===Wiimote-Only===
+
=== Wiimote-Only ===
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.  
+
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.  
 
<source lang="bash">
 
<source lang="bash">
 
#ir_ptr
 
#ir_ptr
Line 42: Line 42:
 
</source>
 
</source>
  
===Wiimote-Nunchuck===
+
=== Wiimote-Nunchuck ===
 
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:
 
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:
 
<source lang="bash">
 
<source lang="bash">
Line 49: Line 49:
 
Plugin.ir_ptr.X = ~ABS_X
 
Plugin.ir_ptr.X = ~ABS_X
 
Plugin.ir_ptr.Y = ~ABS_Y
 
Plugin.ir_ptr.Y = ~ABS_Y
Wiimote.A       = BTN_LEFT
+
Wiimote.A = BTN_LEFT
Wiimote.B       = KEY_LEFTALT
+
Wiimote.B = KEY_LEFTALT
Nunchuk.C       = KEY_LEFTSHIFT
+
Nunchuk.C = KEY_LEFTSHIFT
Nunchuk.Z       = KEY_LEFTCTRL
+
Nunchuk.Z = KEY_LEFTCTRL
  
Wiimote.Up     = KEY_PAGEUP
+
Wiimote.Up = KEY_PAGEUP
Wiimote.Down   = KEY_PAGEDOWN
+
Wiimote.Down = KEY_PAGEDOWN
Wiimote.Left   = KEY_LEFT
+
Wiimote.Left = KEY_LEFT
Wiimote.Right   = KEY_RIGHT
+
Wiimote.Right = KEY_RIGHT
Wiimote.Plus   = BTN_RIGHT
+
Wiimote.Plus = BTN_RIGHT
Wiimote.Minus   = KEY_B
+
Wiimote.Minus = KEY_B
Wiimote.Home   =KEY_M
+
Wiimote.Home =KEY_M
#Wiimote.1     = KEY_PROG1
+
#Wiimote.1 = KEY_PROG1
#Wiimote.2     = KEY_PROG2
+
#Wiimote.2 = KEY_PROG2
Plugin.nunchuk_stick2btn.Up     = KEY_UP
+
Plugin.nunchuk_stick2btn.Up = KEY_UP
Plugin.nunchuk_stick2btn.Down   = KEY_DOWN
+
Plugin.nunchuk_stick2btn.Down = KEY_DOWN
Plugin.nunchuk_stick2btn.Left   = KEY_LEFT
+
Plugin.nunchuk_stick2btn.Left = KEY_LEFT
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 git-version of cwiid.''
  
 
* Load the uinput kernel module
 
* Load the uinput kernel module

Latest revision as of 20:20, 3 March 2012


[edit] Overview

You can use the Wiimote(Plus) 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).

[edit] Procedure

  • Install the bluez libraries (libbluetooth3 and libbluetooth-dev)
  • Run the bluetooth daemon
  • Download and compile cwiid from git
git clone https://github.com/abstrakraft/cwiid.git
cd ./cwiid
aclocal
autoconf
./configure 
make
make install
  • Or you can simply download wminput and wmgui via apt-get or so.
apt-get install wminput wmgui
  • Make a new configuration file for wminput, and fill with the wiimote-only or wiimote-nunchuck(prefered) setup
vi /usr/local/etc/cwiid/wminput/opensim

[edit] Wiimote-Only

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.

#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

[edit] Wiimote-Nunchuck

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 git-version of cwiid.

  • Load the uinput kernel module
modprobe uinput
  • Start wminput with the opensim config
wminput -c opensim
Personal tools
General
About This Wiki