Wiimote Project

Wiimote Projects => Wiimote accelerometer & motions detecting projects => Topic started by: eziosoft on December 10, 2008, 06:28:39 PM

Title: wiimote analyzer (eziosoft) [update 18/12/2008]
Post by: eziosoft on December 10, 2008, 06:28:39 PM
Update 18/12/2008   This is still a beta version.
- couple new functions


Update 17/12/2008   This is still a beta version.
I spent a couple of hours on this project and add what you said, but not all. If you like the program and you want to motivate me to continue to work on it, please donate or check my other programs: www.ssaa.ocom.pl

1. The current time is 0:00:00 can extend so brooken down more 0:00:00:00? Then in excel it is a simple current time verses last time to get a time line reference to graph from. - done

2. Can you include an option to average so user can select beteen 1:1, 2:1, 3:1, 5:1, 10:1. This will allow for accurate calculations for accute events and manageable data for long term events.- done


3. Start timer (as already suggested). User selects start in 30seconds, press "A" button, starts logging in 30seconds- done

4. Log timer (as already suggested). User selcts time frame (say 30 seconds) log only records for 30 seconds- done


Small update.
-I added the button that opens wii_log.txt in Excel

This is still a beta version. There is no error handling, etc. More features soon.



Hello everyone.
I could not find a good program, which draws the acceleration in real time. So I wrote a small program.

If you find a bug let me know.

Screenshot
(http://ezio.ovh.org/programy/pliki/wii.jpg)



Bart
Title: Re: wiimote analyzer
Post by: benpaddlejones on December 10, 2008, 08:34:18 PM
eziosoft

Awesome, this is exactly what science teachers need. Can it datalog to a text file so can be graphed in excel?

benpaddlejones :)
Title: Re: wiimote analyzer
Post by: eziosoft on December 10, 2008, 08:50:21 PM
The program creates wii_log.txt in the application folder. The file can be opened in Exel or just copy its contents.
Title: Re: wiimote analyzer
Post by: dice on December 10, 2008, 11:33:08 PM
very nice, looks like a great program.

Dice :)
Title: Re: wiimote analyzer
Post by: UndCon on December 11, 2008, 01:40:44 AM
Great application with lots of "impressive-factor"

Good job!

//UndCon


EDIT:On my initial test i ran into a problem...program crashed...

The batteries in the wiimote gave up :D

So it might be a good thing to add code that can handle if the Wiimote gets disconnected
Title: Re: wiimote analyzer
Post by: benpaddlejones on December 15, 2008, 05:23:37 PM
eziosoft
I have been looking at this with some Physics teachers, really cool!

I will soon post an excel file that includes some physics related graphs and concepts that will compliment your data file. Perhaps you could integrate into your package so the file is already there. This is being put together by a physics friend.

A suggested feature is a timer to start and finish. Thinking a count down timer to start the a user input to set record time in seconds. So a user can set start recording in 30 seconds (user setting) (perhaps a count down with beeps) then it records for records for 90 seconds (user setting).

benpaddlejones :)

Title: Re: wiimote analyzer
Post by: eziosoft on December 15, 2008, 05:59:39 PM
Any suggestion is welcome
Now working on a logging movements infrared light-emitting diodes, but I can not cope with Triangulation  ;D
Title: Re: wiimote analyzer
Post by: benpaddlejones on December 15, 2008, 10:29:06 PM
eziosoft

Some suggests from Science Teachers that see a huge potential for this in the classroom:

1. The current time is 0:00:00 can extend so brooken down more 0:00:00:00? Then in excel it is a simple current time verses last time to get a time line reference to graph from.

2. Can you include an option to average so user can select beteen 1:1, 2:1, 3:1, 5:1, 10:1. This will allow for accurate calculations for accute events and manageable data for long term events.

3. Start timer (as already suggested). User selects start in 30seconds, press "A" button, starts logging in 30seconds

4. Log timer (as already suggested). User selcts time frame (say 30 seconds) log only records for 30 seconds

5. Can you add a time factor column or change 'N' to a time factor (if 1:1 then time factor is n/100, if 2:1 then time factor is n/50, if 3:1 the time factor = n/33.333333)

6. Can the log go direct to a excel spreadsheet with Graphs already included. (I can help with the graphs).

Once again great program :)

benpaddlejones
Title: Re: wiimote analyzer
Post by: UndCon on December 16, 2008, 05:03:42 AM
I also showed this at work and they were really impressed :)

Then I imported the log into Excel and they wanted to have a go  in the car with wiimote to measure  Gforce
Title: Re: wiimote analyzer
Post by: benpaddlejones on December 16, 2008, 05:35:41 AM
Undcon
I remember you posting an application to connect wiimote to a windows mobile?

I have a dream:

my ZX6R (http://lh3.ggpht.com/_VQc-eJXOl00/SUeRL8mEViI/AAAAAAAAAXE/xPSWQvKLXAo/s400/P1010208.JPG),
my wiimote(http://www.prowellasia.com/showroom/images/wiimote.jpg),
my Dopod 838pro (http://www.techoni.com.au/images/dopod838pro_l5.jpg),
this application (http://ezio.ovh.org/programy/pliki/wii.jpg)

and some serious physics!

benpaddlejones :)
Title: Re: wiimote analyzer
Post by: Wiweeyum on December 16, 2008, 07:43:42 AM
We have an advanced group of middle-school aged students learning physics after school so they can go on a field trip to an amusement part to calculate different elements of the rides. (wow, a long sentence) Using the wiimote to calculate G's would be a fantastic resource.

I'm glad you posted that here. I wouldn't have thought of it myself. :P
Title: Re: wiimote analyzer
Post by: benpaddlejones on December 16, 2008, 03:52:26 PM
Wiweeyum
You could get a mini laptop with BT then gaffa tape the wiimote to a roller coaster chair. Sit next to it and record the data.

You would get some really interesting data between the 3 axis but also the pitch and roll.

Extension/Gifted & Talented students will be able to sort through the mass of data. Teach them a few Excel calculation tricks and they are away!

Worth reporting on.

benpaddlejones
Title: Re: wiimote analyzer
Post by: eziosoft on December 16, 2008, 04:49:26 PM
Thanks for the answers and suggestions. I'll try to slowly add options to my program to match your needs:)
Title: Re: wiimote analyzer (eziosoft) [update 17/12/2008]
Post by: eziosoft on December 16, 2008, 08:22:05 PM
Undcon
I remember you posting an application to connect wiimote to a windows mobile?

I have a dream:

my ZX6R ,
my wiimote,
my Dopod 838pro ,
this application

and some serious physics!

benpaddlejones :)

   
I think that this is not possible today. Connecting to Windows Mobile - No one's done that. If you have any information on this topic to let me know.



eziosoft

5. Can you add a time factor column or change 'N' to a time factor (if 1:1 then time factor is n/100, if 2:1 then time factor is n/50, if 3:1 the time factor = n/33.333333)


can you explain it to me?
Title: Re: wiimote analyzer (eziosoft) [update 17/12/2008]
Post by: insertnick on December 17, 2008, 05:03:55 AM
Quote from: eziosoft
I think that this is not possible today. Connecting to Windows Mobile - No one's done that. If you have any information on this topic to let me know.

I was able to retrieve and realtime-graph wii remote data with a Nokia 770 (http://europe.nokia.com/A4145104), but it was not Windows mobile (a sort of Linux thing).
Title: Re: wiimote analyzer (eziosoft) [update 17/12/2008]
Post by: Wiweeyum on December 17, 2008, 08:19:51 AM
Fantastic!
Title: Re: wiimote analyzer (eziosoft) [update 17/12/2008]
Post by: insertnick on December 17, 2008, 08:43:22 AM
If someone is interested as a starting point and hack a bit more, I think (digging in the hard drive) this was a working piece of code, after installing Python for Maemo (http://pymaemo.garage.maemo.org/) on my Nokia 770 (but it should work with few modifications also on PC, and other maemo platforms like N800, N810, N810 WiMax).

Code: [Select]
#!/usr/bin/python

#    This program is free software. It comes without any warranty, to
#    the extent permitted by applicable law. You can redistribute it
#    and/or modify it under the terms of the Do What The **LOVE** You Want
#    To Public License, Version 2, as published by Sam Hocevar. See
#    http://sam.zoy.org/wtfpl/COPYING for more details.

import pygame, os
from pygame.locals import *
from bluetooth import BluetoothSocket, BluetoothError, L2CAP
import thread, time

WIDTH = 512
HEIGHT = 256 # Don't change this one

# ADDRESS = '00:00:00:00:00:00' # PC1 - your PC bluetooth address here
# ADDRESS = '00:00:00:00:00:00' # Nokia 770 - your device bluetooth address here
ADDRESS = '00:00:00:00:00:00' # Wiimote - your wiimote bluetooth address here

def init_pygame(): 
  ISMAEMO         = False
  if os.name=="posix" and os.path.exists('/media/mmc1'): ISMAEMO=True
 
  SCREENRECT = Rect(0, 0, 512, 256)

  os.environ["SDL_VIDEO_X11_WMCLASS"]="wiimote"

  pygame.init()
  pygame.display.set_caption('wiimote')
  pygame.mixer.quit() # we don't want pygame hogging the audio device

  # set the display mode
  winstyle = FULLSCREEN
  if not ISMAEMO: winstyle = 1

  bestdepth = pygame.display.mode_ok(SCREENRECT.size, winstyle, 16)
  if not ISMAEMO: bestdepth = pygame.display.mode_ok(SCREENRECT.size, winstyle, 32)

  screen = pygame.display.set_mode(SCREENRECT.size, winstyle, bestdepth)
  if ISMAEMO: pygame.mouse.set_visible(False)
  return screen


# Listening thread
def listener():
    global connected, sensor, fdin, fdout
    # fdin.settimeout(0.1)
    while connected == 1:
        try:
            msg = fdin.recv(23)
        except BluetoothError:
            continue
        if len(msg) >= 7:
            sensor = ord(msg[4])
    print ord(msg[4])
    fdin.close()
    fdout.close()
    connected = -1


def main():
    global connected, sensor, fdin, fdout
    screen = init_pygame()

    # Try to connect
    print 'connecting to ' + ADDRESS + ', please be sure it is discoverable and connectable'
    fdin = BluetoothSocket(L2CAP)
    fdin.connect((ADDRESS, 0x13))
    fdout = BluetoothSocket(L2CAP)
    fdout.connect((ADDRESS, 0x11))
    if not fdin or not fdout:
            raise 'could not connect, check the address'
    # Open window
    pygame.init()
    window = pygame.display.set_mode((WIDTH, HEIGHT), 0)
    color_WHITE = window.map_rgb(255, 255, 255)
    pygame.display.set_caption('Receiving:')
    # Run listener
    old = 127
    sensor = 127
    connected = 1
    thread.start_new_thread(listener, ())
    fdout.send("\x52\x12\x00\x31")
    # Main display loop
    while connected == 1:
        pixels = pygame.surfarray.pixels2d(window)
        for t in range(min(old, sensor) + 1, max(old, sensor)):
            pixels[WIDTH - 3][t] = color_WHITE
        pixels[WIDTH - 2][sensor] = color_WHITE
        old = sensor
        del pixels
        window.unlock()
        window.blit(window, (-1, 0))
        pygame.display.flip()
        for ev in pygame.event.get():
            if ev.type == QUIT: connected = 0
            time.sleep(0.01)
    while connected == 0:
            time.sleep(0.01)
    pygame.display.quit()

if __name__ == '__main__': main()

Title: Re: wiimote analyzer (eziosoft) [update 17/12/2008]
Post by: benpaddlejones on December 17, 2008, 04:17:06 PM
eziosoft
Could the program replay a log? Or even better could it be recorded in a video format?

What would be really cool if the graphing as a video file was loaded next to a video recording of the event synced and played in slow-motion.

This would be something no other data logger on the market can do. You would have science teachers around the world using your application!

benpaddlejones :)


Title: Re: wiimote analyzer (eziosoft) [update 17/12/2008]
Post by: eziosoft on December 17, 2008, 05:02:50 PM
Reply is not a problem, but video hmmm I have to use google :)
Should I start to make money on this.

Again, I have a few new features such as measurement of distances, and automatic graph in Excel.
I'll post it soon
Title: Re: wiimote analyzer (eziosoft) [update 17/12/2008]
Post by: UndCon on December 17, 2008, 05:08:44 PM
I think i talked about connecting it to my PDa but I havent done anything with it...but I can connect to my SE P1i with MobiPad (symbian)
Title: Re: wiimote analyzer (eziosoft) [update 17/12/2008]
Post by: eziosoft on December 17, 2008, 05:17:28 PM
Yes, in symbian is possible. In Windows Mobile not yet. We need a driver:) Maybe one of you will write it?  :D
Title: Re: wiimote analyzer (eziosoft) [update 18/12/2008]
Post by: eziosoft on December 17, 2008, 09:09:49 PM
eziosoft
Could the program replay a log? Or even better could it be recorded in a video format?

What would be really cool if the graphing as a video file was loaded next to a video recording of the event synced and played in slow-motion.

This would be something no other data logger on the market can do. You would have science teachers around the world using your application!

benpaddlejones :)





Like this  8)

[youtube]http://fr.youtube.com/watch?v=8XafWDaoA7s[/youtube]

I'll relase this soon.
Title: Re: wiimote analyzer (eziosoft) [update 18/12/2008]
Post by: Wiweeyum on December 18, 2008, 04:35:02 AM
Fantastic! Doing a split screen type thing and syncing the playback log with footage of the roller-coaster, bike, or car the wiimote was attached to at the  time would be a wonderful learning resource.
Title: Re: wiimote analyzer (eziosoft) [update 18/12/2008]
Post by: benpaddlejones on December 18, 2008, 01:33:18 PM
Like this  8)

[youtube]http://fr.youtube.com/watch?v=8XafWDaoA7s[/youtube]

I'll relase this soon.

Awesome!

benpaddlejones
Title: Re: wiimote analyzer (eziosoft) [update 18/12/2008]
Post by: eziosoft on December 19, 2008, 11:23:01 AM
I decided that I will give you the ability to create video before christmas

to create video from jpg's you can use ie. JPGVideo

I am waiting for your movies

[youtube]http://fr.youtube.com/watch?v=khnXu6FNkoc[/youtube]
Title: Re: wiimote analyzer (eziosoft) [update 18/12/2008]
Post by: Wiweeyum on December 19, 2008, 11:59:20 AM
I'm assuming you select the wii_log.txt, then choose a folder where it's going to export the jpeg's?

It crashed on me after I selected the the folder, so I'm not really sure. If you'd like, I can post the crash log.
Title: Re: wiimote analyzer (eziosoft) [update 18/12/2008]
Post by: eziosoft on December 19, 2008, 01:49:24 PM
sorry this was my mistake. I forgoted to add one file.
This is very very alfa.
Title: new version is coming soon
Post by: eziosoft on January 05, 2009, 03:47:16 PM
I intend to write a new version of wiimote analyzer. The current version is not refined and contains errors.
Waiting for your proposals, what need to be improved, added, changed ...
Title: Re: wiimote analyzer (eziosoft) [update 18/12/2008]
Post by: benpaddlejones on January 07, 2009, 05:24:03 AM
eziosoft
Neat code is always nice!

My only addition would be multiple wiimote support. How cool would it be to compare the same event from two perspectives.

benpaddlejones :)
Title: Re: wiimote analyzer (eziosoft) [update 18/12/2008]
Post by: imoet on January 08, 2009, 12:44:45 AM
Hi...
I'm sorry I can't seem to find the download link... where can I download this from?
Do you have the source code?
Thanks
Title: Re: wiimote analyzer (eziosoft) [update 18/12/2008]
Post by: eziosoft on January 08, 2009, 08:25:21 PM
Hi...
I'm sorry I can't seem to find the download link... where can I download this from?
Do you have the source code?
Thanks

the file is attached to the first post

source code ..?? yes I have it. I've wrote it... and maybe I'll post it here someday
Title: Re: wiimote analyzer (eziosoft) [update 18/12/2008]
Post by: KeYhOle on March 27, 2009, 11:20:55 AM
This is really great. As a coming science teacher i really love this:P
Title: wiimote analyzer new version
Post by: eziosoft on May 14, 2009, 08:31:43 PM
Hey
I'm working on new version of this tool.
Looking forward for your ideas:what to add, what to improve ...

Short video from new version is here:
http://www.youtube.com/watch?v=8anbDP6p14A
Title: Re: wiimote analyzer (eziosoft) [update 18/12/2008]
Post by: eyucel on May 15, 2009, 01:26:23 AM
Hi, first of all thanks for sharing your genuinely wonderful software. My recommandation is an graphics add-onn on the bottom of the screen showing the position of the actual wiimote. Take care
Title: Re: wiimote analyzer (eziosoft) [update 18/12/2008]
Post by: benpaddlejones on May 15, 2009, 03:05:25 AM
eziosoft

I'm excited!!!

:)

benpaddlejones
Title: Re: wiimote analyzer (eziosoft) [update 18/12/2008]
Post by: eziosoft on May 17, 2009, 05:35:20 PM
it is here http://www.wiimoteproject.com/wiimote-accelerometer-and-motions-detecting-projects/g-force-analyzer-(wiimote-analyser)-v1-0-rc1-(online)(18052009)/

:)