Monthly Archives: March 2008

Wiimote Gestures with Mingle

Once you have plugged in your USB Sensor Bar you will notice the markedly improved cursor movements. The Wiimote can now be used as a replacement for your mouse. You can move the cursor around by moving the Wiimote in the direction that you want the cursor to move. You can also press the A and B buttons for left and right click mouse functionality respectively.

To make the most of the Wiimote when working with Mingle it is worth installing the Mouse Gestures plugin for Firefox. You can activate a mouse gesture or Wiimote gesture by holding down the B button and moving the Wiimote around to activate a command. For example you can hold the B button and draw an X within Firefox to close a tab, or move the Wiimote upward then to the right to navigate to the next tab on the right.

I created a custom Wiimote gesture by registering a line of javascript for opening a web page with the gesture: Up, Down-Right, Up-Right, Down. This gesture launches Mingle in Firefox by associating the gesture with some javascript, ie window._content.document.location.href=”http://localhost:8080” (assuming Mingle is running on port 8080 on your laptop). The following screen shots convey this action, as well as a similar gesture for signing into Mingle by literally signing my initials on the screen with the Wiimote.

M for Mingle

Signing In with Wiimote Gesture

Signed into Mingle

You can also lasso a bunch of links and all the links will open up in their own tabs. Navigating up and down a page is as easy as drawing up and down arrows respectively. The Wiimote just works beautifully with the Mouse Gestures plugin.

Custom built USB Sensor Bar

I had a few days off work to recharge the batteries and was looking forward to heading to the beach, but ended up taking a rain check due to the bad weather. Sydney just had the wettest Summer in years, which was good in a way as it ended up breaking the drought and putting water in the dams. So to make the most of my time off I decided to build my own USB Sensor Bar so that I could get a Wiimote working with my laptop.

If you followed my previous post on getting the Wiimote to work with Ubuntu, then you should be able to move the cursor around using your Wiimote, and using the A and B buttons as left and right clicks respectively. However, using the accelerometer alone for moving the cursor around does not make for a great user experience. To enable the Wiimote to work more effectively you need to setup a point of reference that can be used by the Wiimote driver to calculate the directional movement of the Wiimote accelerometers. This point of reference for the Wii is the Sensor Bar that sites on top of the television set. So you can either buy a battery powered Sensor Bar or make your own USB Sensor Bar. I ended up doing the latter by following the instructions at Terbidium.

To get started you need a USB cable, four infrared LEDs, LED holders, aluminium tubing, electrical tape or heat shrink tubing, and a laptop.

Sensor Bar Components

The USB Sensor Bar is a simple serial circuit that consists of four infrared LEDs that are grafted to an old USB cable.

Soldering USB Cable

You may need to add a resistor into the circuit if your LEDs don’t produce a voltage drop of 5 Volts, which is the standard power source for USB devices. It is worth testing your circuit design on a circuit board as shown below.

Working IR LED Circuit

The circuit is then squeezed into a tight-fitting aluminium tubing that is cut to about 30cm in length. The USB cable hangs out one end of the tubing, and the LEDs sit in LED holders that have been positioned into some neatly drilled holes. The completed USB Sensor Bar is pictured below.

Testing USB Sensor Bar

Wiimote on Ubuntu Gutsy Gibbon

I wrote earlier about using Mingle on a Nintendo Wii as an Agile project management tool. I figured it would be cumbersome to lug around a data projector, laptop, Airport Express, and Nintendo Wii to every meeting in which you want to use Mingle, such as a Showcase or technical stand-up. Not to mention the setup time in establishing a connection between the Wii and your Wi-Fi access point. So wouldn’t it be nice to remove the Nintendo Wii and the Airport Express from the equation and just use the Wiimote with your laptop? Well you can do just that, and it is really easy to setup on Ubuntu!

You find where download mp3 music on player, You need mp3 music download from online mp3 archive

You can follow these instructions or just run the following in a terminal.

  • Install Wiimote drivers using apt-get. Could it be any easier?
    $ sudo apt-get install libcwiid0 lswm wmgui wminput
  • Test Wiimote connection with your Bluetooth dongle. You should just plug in your USB Bluetooth dongle and Bluez will enable Bluetooth for you, assuming it has a driver that can support your dongle. I just have a run-of-the-mill ASUS Bluetooth dongle.
    $ wmgui

    Select Connect from the menu and hold buttons 1 and 2 on your Wiimote to make it discoverable. You may need to do this a couple of times before wmgui picks up your Wiimote before timing out. Once connected, wmgui allows you to test the inputs of your Wiimote. You can enable rumble and accelerometer inputs from the menus.

  • Run the mouse emulator.
            $ sudo modprobe uinput
            $ sudo wminput
            

    Then put your Wiimote into discoverable mode by holding buttons 1 and 2 together again.

  • The man pages for wminput does not recommend running wminput as root. So run the following command so that you can gain access to /dev/input/uinput without having to use sudo.
    $ sudo sh -c 'echo "KERNEL=="uinput", GROUP="admin"" > /etc/udev/rules.d/50-cwiid-input.rules' /etc/init.d/udev restart

You should now be able to move the cursor around using your Wiimote, and using the A and B buttons as left and right clicks respectively. However, using the accelerometer alone for moving the cursor around does not make for a great user experience. The wminput driver is configured by default for the accelerometer, and if you want to move windows around with your Wiimote, then you’ll need to use the IR configurations instead. Simply replace the default soft link to the accelerometer config file with the ir_ptr config file.

$ cd /etc/cwiid/wminput
$ sudo rm default
$ sudo ln -s ir_ptr default

The Wiimote now needs a point of reference to use when sending coordinates back to the CWiiD driver. This is what the Sensor Bar is for. The Sensor Bar is simply an array of infra red LEDs that creates a plane for the Wiimote as a point of reference. The plane is used for rotation instructions such as the rotating hand effect on the Wii. You can’t use the Wii Sensor Bar with your laptop as it doesn’t have USB or a compatible connector with the laptop. I ended up building my own USB Sensor Bar, and will write about my experience in a later post. It was relatively simple and works quite well. However, it does require doing a bit of soldering, so if you aren’t comfortable with DIY electronics then I would recommend getting a Nyco battery powered Sensor Bar from eBay.

Testing USB Sensor Bar

Now you should be able to fire up Mingle and start moving those story cards around on your laptop with just your Wiimote!

If you are using a Mac then you might want to try Darwin Remote [Free] or Remote Buddy [Not Free]. Windows users can use GlovePie or WiinRemote.