WiiNxtBalance
It’s cool if you can control the NXTway-GS robot using a gamepad as this guy is doing:
But since we are Wii addicted I’m going to teach you how to use the wiimote!
Follow the tutorial and you willl be driving the balancer (and eventually crash it
) like a cowboy!
What you need:
- lego NXT with OSEK firmware and the NXTway-gs program loaded
- a wiimote of course
- ubuntu and python with bluetooth modules
- rfcomm,pybluez and pyserial
- a python script to parse the wiimote data and send it to the lego nxt
First step is to install the nxtOsek firmware: instructions here. In the directory samples/nxtway_gs there’s the code for the balancing functions. I did a patch of the program to be controlled by the wiimote via bluetooth. You can download the code from here (already compiled).
The second step is to connect your NXT to your laptop via bluetooth and rfcomm -many thanx to Linus to helped me out with this problem!-, this script will help you to do it very easily btconnect).
#!/bin/bash
# script to ease connecting to an NXT brick
# (c) 2007 Johannes Ballé# call either with a Bluetooth address or device name
if echo $* | grep -q ‘^..:..:..:..:..:..$’; then
MAC=$*
else
echo -n “Scanning for ‘$*’ … ” >&2
MAC=$( hcitool scan | grep ‘^ ..:..:..:..:..:.. ‘”$* *$” | cut -f 2 )
if [ -z $MAC ]; then
echo “not found.” >&2
exit 1
fi
if echo $MAC | grep -q ” “; then
echo “found multiple devices:” >&2
echo >&2
for i in $MAC; do
echo ‘ ‘$i >&2
done
echo >&2
echo “Use ${0##*/} with one of the addresses above.” >&2
exit 2
fi
echo “found $MAC.” >&2
firfcomm -r connect rfcomm0 $MAC &
trap “kill $!” 1 3 9 15
wait
If the connection is going on well you should see this:
epokh@epokh-laptop:~/Documents/lego nxt$ sh btconnect.sh “NXT”
Scanning for ‘NXT’ … found 00:16:53:0A:8B:E4.
Connected /dev/rfcomm0 to 00:16:53:0A:8B:E4 on channel 1
Press CTRL-C for hangup
And the bluetooth-applet should ask for the passkey “1234″.
The last step is to run the wiimotenxt control script to interface your wiimote. Look for your wiimtoe address using:
hcitool scan
Then modifiy the script in the main function with the address you found:
w=Wiimote(”00:1E:35:DF:C5:75″,0)
Then run the script as:
epokh@epokh-laptop:~/wiimote$ python Wiimote.py
Attaching to Wiimote #1 at 00:1E:35:DF:C5:75
setled(0)
_send_command(0×52,0×11,[16])
opening serial port…
Enabling accelerometer.
_send_command(0×52,0×12,[0, 49])
_send_command(0×52,0×17,[0, 0, 0, 22, 0, 10])
Leaving _waitforpacket() after 2 packets
Got force calibration data: zero=[127, 128, 128], 1g=[152, 153, 153]
Receiving data from Wiimote #1
You can switch the control mode pressing B (’the rear button’). You can control either by the buttons either using the acceleration. The script corrects the gravity to give a better motion control.
Enjoy!

April 22nd, 2009 at 6:56 am
[...] Pour les détails swfobject.embedSWF(”http://www.youtube.com/v/dIdVl3c7HL8&rel=1&fs=1&showsearch=0&showinfo=0″, “vvq49eeb1a12540f”, “425″, “344″, “9″, vvqexpressinstall, vvqflashvars, vvqparams, vvqattributes); swfobject.embedSWF(”http://www.youtube.com/v/gUzgYcokIF4&rel=1&fs=1&showsearch=0&showinfo=0″, “vvq49eeb1a126422″, “425″, “344″, “9″, vvqexpressinstall, vvqflashvars, vvqparams, vvqattributes); Tags: robot, wiimot [...]
April 22nd, 2009 at 1:39 pm
[...] DarwiinRemote, that allows you to play World of Warcraft using the Wiimote; then, there’s a self-balancing robot made of LEGO NXT, that can be remotely controlled with [...]
April 23rd, 2009 at 11:12 am
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 11:15 am
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 11:16 am
[...] Read | Permalink | Email this | Comments Share and Enjoy: [...]
April 23rd, 2009 at 11:20 am
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 11:20 am
[...] Read | Permalink | Email this | Comments Share and Enjoy: [...]
April 23rd, 2009 at 11:20 am
[...] Read | Permalink | Email this | Comments No comments for this entry yet… [...]
April 23rd, 2009 at 11:22 am
[...] Read | Permalink | Email this | Comments ENGADGET [...]
April 23rd, 2009 at 11:30 am
[...] Read | Permalink | Email this | Comments Share and Enjoy: [...]
April 23rd, 2009 at 11:36 am
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 11:52 am
[...] Read | Permalink | Email this | Comments Share and Enjoy: [...]
April 23rd, 2009 at 11:59 am
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 12:07 pm
[...] appeared on Engadget on Thu, 23 Apr 2009 06:07:00 EST. Please see our terms for use of feeds.Read | Permalink | Email [...]
April 23rd, 2009 at 12:07 pm
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 12:07 pm
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 12:08 pm
[...] appeared on Engadget on Thu, 23 Apr 2009 06:07:00 EST. Please see our terms for use of feeds.Read | Permalink | Email [...]
April 23rd, 2009 at 12:09 pm
[...] appeared on Engadget on Thu, 23 Apr 2009 06:07:00 EST. Please see our terms for use of feeds.Read | Permalink | Email [...]
April 23rd, 2009 at 12:09 pm
[...] appeared on Engadget on Thu, 23 Apr 2009 06:07:00 EST. Please see our terms for use of feeds.Read | Permalink | Email [...]
April 23rd, 2009 at 12:10 pm
[...] appeared on Engadget on Thu, 23 Apr 2009 06:07:00 EST. Please see our terms for use of feeds.Read | Permalink | Email [...]
April 23rd, 2009 at 12:11 pm
[...] appeared on Engadget on Thu, 23 Apr 2009 06:07:00 EST. Please see our terms for use of feeds.Read | Permalink | Email this | Comments Posted in [...]
April 23rd, 2009 at 12:12 pm
[...] appeared on Engadget on Thu, 23 Apr 2009 06:07:00 EST. Please see our terms for use of feeds.Read | Permalink | Email this | Comments Filed under: DS, PC, PS2, PS3, [...]
April 23rd, 2009 at 12:12 pm
[...] appeared on Engadget on Thu, 23 Apr 2009 06:07:00 EST. Please see our terms for use of feeds.Read | Permalink | Email this | Comments Add this to : Digg it Save [...]
April 23rd, 2009 at 12:13 pm
[...] appeared on Engadget on Thu, 23 Apr 2009 06:07:00 EST. Please see our terms for use of feeds.Read | Permalink | Email [...]
April 23rd, 2009 at 12:13 pm
[...] appeared on Engadget on Thu, 23 Apr 2009 06:07:00 EST. Please see our terms for use of feeds.Read | Permalink | Email [...]
April 23rd, 2009 at 12:15 pm
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 12:16 pm
[...] appeared on Engadget on Thu, 23 Apr 2009 06:07:00 EST. Please see our terms for use of feeds.Read | Permalink | Email [...]
April 23rd, 2009 at 12:18 pm
[...] appeared on Engadget on Thu, 23 Apr 2009 06:07:00 EST. Please see our terms for use of feeds.Read | Permalink | Email [...]
April 23rd, 2009 at 12:20 pm
[...] appeared on Engadget on Thu, 23 Apr 2009 06:07:00 EST. Please see our terms for use of feeds.Read | Permalink | Email [...]
April 23rd, 2009 at 12:24 pm
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 12:25 pm
[...] appeared on Engadget on Thu, 23 Apr 2009 06:07:00 EST. Please see our terms for use of feeds.Read | Permalink | Email [...]
April 23rd, 2009 at 12:26 pm
[...] appeared on Engadget on Thu, 23 Apr 2009 06:07:00 EST. Please see our terms for use of feeds.Read | Permalink | Email [...]
April 23rd, 2009 at 12:27 pm
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 12:34 pm
[...] appeared on Engadget on Thu, 23 Apr 2009 06:07:00 EST. Please see our terms for use of feeds.Read | Permalink | Email [...]
April 23rd, 2009 at 12:35 pm
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 12:38 pm
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 12:57 pm
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 1:03 pm
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 1:10 pm
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 1:12 pm
[...] appeared on Engadget on Thu, 23 Apr 2009 06:07:00 EST. Please see our terms for use of feeds.Read | Permalink | Email [...]
April 23rd, 2009 at 1:17 pm
[...] appeared on Engadget on Thu, 23 Apr 2009 06:07:00 EST. Please see our terms for use of feeds.Read | Permalink | Email [...]
April 23rd, 2009 at 1:26 pm
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 1:36 pm
[...] appeared on Engadget on Thu, 23 Apr 2009 06:07:00 EST. Please see our terms for use of feeds.Read | Permalink | Email this | Comments Report This Post: Illegal content [...]
April 23rd, 2009 at 1:41 pm
[...] Read | Permalink | Email this | Comments Post tags: Bluetooth, Bot, Custom Firmware, Engadget, Hack, Lego Nxt, Nbsp, Robot, Robots, Video Tools, Wig, Wiimote Posted in: Gadżety | | [...]
April 23rd, 2009 at 2:16 pm
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 2:44 pm
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 4:08 pm
[...] Read [...]
April 23rd, 2009 at 4:21 pm
[...] Read | Permalink | Email this | Comments Linking code follows…Copy/Paste the following code into your own blog, web page, or social networking profile.<a href="http://inkandvirtue.com/2009/04/23/video-wiinxtbalance-tools-around-doesnt-fall-down/" >Video: WiiNxtBalance tools around, doesn’t fall down</a> April 23rd, 2009 | Tags: Bluetooth, Bot, Custom Firmware, engadget, Hack, Lego Nxt, Nbsp, Robot, Robots, Video Tools, Wig, Wiimote | Category: Games | [...]
April 23rd, 2009 at 5:55 pm
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 6:05 pm
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 7:09 pm
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 8:20 pm
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 10:01 pm
[...] Read | Permalink | Email this | Comments [...]
April 23rd, 2009 at 10:52 pm
[...] Read | Permalink | Email this | CommentsBy Laura June [...]
April 23rd, 2009 at 10:52 pm
[...] Read | Permalink | Email this | CommentsBy Laura June [...]
April 23rd, 2009 at 11:40 pm
[...] Read | Permalink | Email this | Comments [...]
April 24th, 2009 at 5:10 am
[...] Read | Permalink | Email this | Comments [...]
May 17th, 2009 at 10:16 am
[...] Read the original: WiiNxtBalance [...]
May 29th, 2009 at 4:09 am
[...] earlier. This hack is for the NXT enthusiast and the guy who likes to do things with his Wii. The project blog takes you through the programming needed to hack the NXT firmware and teach the robot some new [...]