Wiimote Project

General Wiimote and Technology => Linux => General Software Talk => Applications => Topic started by: fnf on March 01, 2008, 07:07:21 AM

Title: Linux Whiteboard
Post by: fnf on March 01, 2008, 07:07:21 AM
Linux Whiteboard is a Linux version implementing Johnny Lee's idea. It's written in standard C/C++ and should compile/run in all Linux systems that are supported by libcwiid. Its current features are:
 - Left-click, right-click, click-and-drag supports.
 - Easy-to-use, but incomplete GUI.
 - High performance.

The project's homepage is located here: http://code.google.com/p/linux-whiteboard/ .
Currently there are prebuilt packages for Ubuntu Hardy Heron and Ubuntu Gutsy Gibbon, but it can be built and install to any user's directory.
Title: Re: Linux Whiteboard
Post by: fnf on March 04, 2008, 03:18:43 PM
Updated to version 0.2, with the following changes:
 - Now became entirely GUI-driven.
 - Dropped SDL dependency, everything GUI-related is handled by GTK+ .
 - Dependencies: gtkmm-2.4, libglademm-2.4, cairomm-1.0, xtst and sigc++-2.0 .
 - Added real-time notification of IR inaccuracies when calibrating.
 - New icon in the notification area.
Title: Re: Linux Whiteboard
Post by: dice on March 04, 2008, 03:30:36 PM
Sounds like a nice project, wish I was more into linux though.  I used Kubuntu for a little while but I always go back to windows.

Keep us up to date on this project :)

Dice
Title: Re: Linux Whiteboard
Post by: fnf on March 05, 2008, 05:06:15 AM
Sounds like a nice project, wish I was more into linux though.  I used Kubuntu for a little while but I always go back to windows.

Keep us up to date on this project :)

Dice

Thanks. I've got ideas to solve problems that many have been experiencing: jerky pointer motions and unreliable drag-n-drop (because of short disappearances of IR signals). Having implemented those, it would be feasible to use whiteboard as a real additional mouse pointer, even for drawing.

Supporting multiple languages (like most Linux applications) is also planned.

I see all of your Wiimote programs are written using .NET framework. Yeah, it's hard to get yourself untangled with Windows. But, if by any chance, you may try Ubuntu 7.10 (or the beta version Ubuntu 8.04 on "ubuntu" "daily" "build") on a virtual machine (VirtualBox is prefered over VMware :) ) to see how well whiteboard works.
Title: Re: Linux Whiteboard
Post by: Spindoctor on March 05, 2008, 05:43:51 AM
I would be glad to help you with a german translation if needed.
Title: Re: Linux Whiteboard
Post by: dice on March 05, 2008, 08:27:44 AM
Thanks. I've got ideas to solve problems that many have been experiencing: jerky pointer motions and unreliable drag-n-drop (because of short disappearances of IR signals). Having implemented those, it would be feasible to use whiteboard as a real additional mouse pointer, even for drawing.

Supporting multiple languages (like most Linux applications) is also planned.

I see all of your Wiimote programs are written using .NET framework. Yeah, it's hard to get yourself untangled with Windows. But, if by any chance, you may try Ubuntu 7.10 (or the beta version Ubuntu 8.04 on "ubuntu" "daily" "build") on a virtual machine (VirtualBox is prefered over VMware :) ) to see how well whiteboard works.

I think you are mistaken, I am not Johnny Lee Chung. He has made the apps that you are talking about.  I wish I was as smart as Johnny but I am not a coder at all, i just run this site and try to bring people together to share information.

I have Vmware with OS X 10.4.8, FreeBSD, and Kubuntu all loaded I mess with them when i get a chance.

Dice
Title: Re: Linux Whiteboard
Post by: fnf on March 06, 2008, 02:13:06 PM
@Spin: All tranlations are very welcome. Please wait while I modify the source for this.

@dice: I wrongly assumed you being Johnny, sorry :) . Anyway, you probably have used Ubuntu; but if not, I suggest trying the latest Ubuntu daily image, it's more polished than Kubuntu and more user-friendly (although KDE is more powerful, to each his own). Btw, Linux is not Windows.

May I ask what have been keeping you from being a Linux user?. Perhaps the solutions to your annoyances will be very simple.
Title: Re: Linux Whiteboard
Post by: dice on March 06, 2008, 03:16:54 PM
@dice: I wrongly assumed you being Johnny, sorry :) . Anyway, you probably have used Ubuntu; but if not, I suggest trying the latest Ubuntu daily image, it's more polished than Kubuntu and more user-friendly (although KDE is more powerful, to each his own).

I like KDE better than the others. I am more used to it.

Btw, Linux is not Windows.

Thats an under statement!!

May I ask what have been keeping you from being a Linux user?. Perhaps the solutions to your annoyances will be very simple.

I am a network administrator for a company that only uses Windows.  I have gone through allot of Microsoft Training and Certifications.  I dislike having to compile apps when a simple install would be nice, I know ubuntu has done allot for apps but some odd apps do not have an install.  I like being able to play mainstream games and there are some apps like Adobe Photoshop CS3 that I use daily. (gimp does not cut it)

These are a few reasons I do not move to a *nix distro.  I have used linux off and on for 8 years now, I get to the point where I can't get something to work and then I go back to windows.

Well thats about all

Dice :)
Title: Re: Linux Whiteboard
Post by: ujs on March 06, 2008, 04:47:28 PM
Thanks. I've got ideas to solve problems that many have been experiencing: jerky pointer motions and unreliable drag-n-drop (because of short disappearances of IR signals). Having implemented those, it would be feasible to use whiteboard as a real additional mouse pointer, even for drawing.

Supporting multiple languages (like most Linux applications) is also planned.

Hi, I'm the guy who codes the Java whiteboard app (http://www.uweschmidt.org/wiimote-whiteboard). I just wanted to let you know that I already did some enhancements to the Johnny's original software. I already added screen selection, right click and mouse movement smoothing (simply averaging last 7 points works well in practice without noticeable delay). My code is basically licensed under MIT, so feel free to borrow some.

I'm also interesed in your enhancements. We don't always have to reinvent the wheel...

The next release of my software will include instructions on how to get it to work on Linux too (using BlueZ). There is a license issue such that Linux users have to obtain a required library themselves...

Uwe
Title: Re: Linux Whiteboard
Post by: fnf on March 08, 2008, 10:27:46 AM
Hi, I'm the guy who codes the Java whiteboard app (http://www.uweschmidt.org/wiimote-whiteboard). I just wanted to let you know that I already did some enhancements to the Johnny's original software. I already added screen selection, right click and mouse movement smoothing (simply averaging last 7 points works well in practice without noticeable delay). My code is basically licensed under MIT, so feel free to borrow some.

I'm also interesed in your enhancements. We don't always have to reinvent the wheel...

The next release of my software will include instructions on how to get it to work on Linux too (using BlueZ). There is a license issue such that Linux users have to obtain a required library themselves...

Uwe

Sorry for the late reply, something came up and it's taking longer than expected.
I like your idea of damping pointer positions, I take a different approach though: It's a simple physics engine which supports accelerations, inertia and forces. The IR pointer is a force acting on the actual cursor, so under rapid and curvy movements like drawing, it will be smooth.

I also use that physics engine to detect disappearances of IR signals, who knows what else it would be useful for :) .

I've taken a look at the code, although I'm not really fond of Java so it did look a bit verbose to me. In Linux Whiteboard, only gtk-gui.cpp is the one handling everything GUI-related, and wii.cpp is to control the Wiimote.

How is your porting to Linux going?. I'll be happy to try it out (though the licensing part is a put-off for permanent using). If libcwiid works under Windows and Mac, or there are other open-source equivalent in the Windows/Mac world, I'll take them into account. Since all other dependencies of Linux whiteboard are cross-platform.
Title: Re: Linux Whiteboard
Post by: fnf on March 08, 2008, 10:37:05 AM
Quote
I am a network administrator for a company that only uses Windows.  I have gone through allot of Microsoft Training and Certifications.  I dislike having to compile apps when a simple install would be nice, I know ubuntu has done allot for apps but some odd apps do not have an install.

Since you're not a programmer, I'll tell you: the thing about having to compile apps is more of a tradition (and technical advantage) than anything else. It is perfectly possible to compile everything into a binary blob than runs under any POSIX-compatible systems (Linux and UNIX) like the nVidia, ATI driver packages, Google Earth and most commercial Linux games.

You probably have heard of 'DLL Hell' in Windows: that's one of the many disadvantages of static linking. Although I can make a statically-linked Linux Whiteboard package so Ubuntu Gutsy users can use my package compiled for Hardy, I don't want to since it goes againts the tradition of Linux programs and is a burden to maintain. That also is the main reason why Windows becomes slower and more prone to crash over time.

Quote
I like being able to play mainstream games and there are some apps like Adobe Photoshop CS3 that I use daily. (gimp does not cut it)

These are a few reasons I do not move to a *nix distro.  I have used linux off and on for 8 years now, I get to the point where I can't get something to work and then I go back to windows.

Fair enough, I agree that there are some apps that people just cannot live without. Although I'd just run 'em in a virtual machine if needs be. In my case there's none though (happy GIMP user here) :-) .
Title: Re: Linux Whiteboard
Post by: fnf on March 08, 2008, 01:49:53 PM
ujs: Do you have a plan to make Whiteboard aware of multiple Wiimotes for a single pointer (so if user blocks the view of one, the other Wiimote still can see it)?. Does Mac support multiple cursors yet?.
Title: Re: Linux Whiteboard
Post by: ujs on March 08, 2008, 02:56:52 PM
I like your idea of damping pointer positions, I take a different approach though: It's a simple physics engine which supports accelerations, inertia and forces. The IR pointer is a force acting on the actual cursor, so under rapid and curvy movements like drawing, it will be smooth.

I also use that physics engine to detect disappearances of IR signals, who knows what else it would be useful for :) .

That sounds like a good idea. I know nothing about physics engines but I might have a look into that.
Cursor movement smoothing is implemented in my program using the so-called  Strategy pattern (http://en.wikipedia.org/wiki/Strategy_pattern). This has the advantage that the user can change the smoothing algorithm during run-time. Thus I could add "physics engine smoothing" to the list of selectable algorithms.

I've taken a look at the code, although I'm not really fond of Java so it did look a bit verbose to me. In Linux Whiteboard, only gtk-gui.cpp is the one handling everything GUI-related, and wii.cpp is to control the Wiimote.

The initial port of Johnny's app was a single class with about 400 lines of code. I changed and added a lot since then. I try to break the program down into separate comprehensible parts adhering to well-known software engineering practices.

How is your porting to Linux going?. I'll be happy to try it out (though the licensing part is a put-off for permanent using).

The next release will include instructions how it should work on Linux (can't test it though). A GPL'd library is required to use BlueZ under Linux with BlueCove (http://www.bluecove.org/) (which my program uses). As far as I understand (and I could be wrong about that) I am not allowed to ship a GPL'd library with my code since my license (modfied MIT) is not compatible with the GPL.

ujs: Do you have a plan to make Whiteboard aware of multiple Wiimotes for a single pointer (so if user blocks the view of one, the other Wiimote still can see it)?. Does Mac support multiple cursors yet?.

I was planning to include that feature in a future release, probably not soon though.


Uwe
Title: Re: Linux Whiteboard
Post by: fnf on March 09, 2008, 02:08:44 PM
I would be glad to help you with a german translation if needed.

I've finished i18n-izing it. Are you familiar with the translation process?. If you are, I will just add you as a translator and you'dd have access to the repository. If not, can you provide me the locale you'd want to add and (additionally) your email address in case someone found a bug. The supported locales can be found in /usr/share/i18n/SUPPORTED.

Thanks.
Title: Re: Linux Whiteboard
Post by: fnf on March 09, 2008, 02:15:47 PM
The initial port of Johnny's app was a single class with about 400 lines of code. I changed and added a lot since then. I try to break the program down into separate comprehensible parts adhering to well-known software engineering practices.

Your code is clean, you shouldn't have any problem porting my engine over. I'll let you know when it's finished. Sorry, I'm in the middle of an exam.

Quote
The next release will include instructions how it should work on Linux (can't test it though). A GPL'd library is required to use BlueZ under Linux with BlueCove (http://www.bluecove.org/) (which my program uses). As far as I understand (and I could be wrong about that) I am not allowed to ship a GPL'd library with my code since my license (modfied MIT) is not compatible with the GPL.

That's true, users will have to install it themselves or better yet, Johnny Lee agrees to change it to GPL.
Title: Re: Linux Whiteboard
Post by: ujs on March 10, 2008, 12:39:21 PM

Quote
The next release will include instructions how it should work on Linux (can't test it though). A GPL'd library is required to use BlueZ under Linux with BlueCove (http://www.bluecove.org/) (which my program uses). As far as I understand (and I could be wrong about that) I am not allowed to ship a GPL'd library with my code since my license (modfied MIT) is not compatible with the GPL.

That's true, users will have to install it themselves or better yet, Johnny Lee agrees to change it to GPL.

I was referring to this (http://snapshot.bluecove.org/bluecove-gpl/) Java Bluetooth library. The license of my software is in no way influenced by Johnny Lee since I'm not using his code.

The new, presumably linux compatible, release of my program is out. Give it a shot if you want.

Uwe
Title: Re: Linux Whiteboard
Post by: fnf on March 10, 2008, 02:52:07 PM
I was referring to this (http://snapshot.bluecove.org/bluecove-gpl/) Java Bluetooth library. The license of my software is in no way influenced by Johnny Lee since I'm not using his code.

I was under the impression of yours being a Java port since you mentioned porting of Johnny's code. Anyway, you probably want to include the full GPL license in LICENSE/COPYING, or just copying gpl-<ver> from their website. It wasn't quite clear what the license of your code is.

To the fun part :) : I downloaded the latest snapshot of bluecove-xxx.jar and bluecove-gpl-xxx.jar (not the source code) from their server, copied both files into the root directory of WiimoteWhiteboard and ran it with:

Code: [Select]
java -cp bluecove-2.0.3-20080112.060257-1.jar:bluecove-gpl-2.0.3-20080115.211318-1.jar.jar:WiimoteWhiteboard.jar -jar WiimoteWhiteboard.jar
It ran and spitted out an error message on the GUI, and these in the terminal:

Code: [Select]
java.lang.IllegalStateException: Bluetooth failed to initialize. There is probably a problem with your local Bluetooth stack or API.
        at wiiremotej.WiiRemoteJ.<clinit>(WiiRemoteJ.java:57)
        at org.uweschmidt.wiimote.whiteboard.WiimoteDataHandler.<init>(WiimoteDataHandler.java:92)
        at org.uweschmidt.wiimote.whiteboard.WiimoteWhiteboard.startup(WiimoteWhiteboard.java:73)
        at org.jdesktop.application.Application$1.run(Application.java:171)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: javax.bluetooth.BluetoothStateException: BlueCove com.intel.bluetooth.BluetoothStackBlueZ not available
        at com.intel.bluetooth.BlueCoveImpl.loadStackClass(BlueCoveImpl.java:277)
        at com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:312)
        at com.intel.bluetooth.BlueCoveImpl.access$100(BlueCoveImpl.java:64)
        at com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:533)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged(BlueCoveImpl.java:531)
        at com.intel.bluetooth.BlueCoveImpl.getBluetoothStack(BlueCoveImpl.java:520)
        at javax.bluetooth.LocalDevice.<init>(LocalDevice.java:67)
        at javax.bluetooth.LocalDevice.getLocalDeviceInstance(LocalDevice.java:74)
        at javax.bluetooth.LocalDevice.getLocalDevice(LocalDevice.java:90)
        at wiiremotej.WiiRemoteJ.<clinit>(WiiRemoteJ.java:49)
        ... 11 more

The same messages were output if I ran it without the classpath param.

My system is the latest Ubuntu 8.04, fully updated and has no problem with java applets in the browser. It does seem like the library wasn't found. What's your idea?.
Title: Re: Linux Whiteboard
Post by: ujs on March 10, 2008, 03:18:41 PM
I was under the impression of yours being a Java port since you mentioned porting of Johnny's code. Anyway, you probably want to include the full GPL license in LICENSE/COPYING, or just copying gpl-<ver> from their website. It wasn't quite clear what the license of your code is.

It all started with a port of Johnny's app but I didn't really take Johnny's code since I used entirely different libraries.
I don't really understand the license confusion. The file LICENSE.txt as well as a folder Licenses should be present in the ZIP-file you downloaded. My code is licensed under MIT. I slightly modified the license though because of the license of one of the libraries I use (WiiRemoteJ).

To the fun part :) : I downloaded the latest snapshot of bluecove-xxx.jar and bluecove-gpl-xxx.jar (not the source code) from their server, copied both files into the root directory of WiimoteWhiteboard and ran it with:

Code: [Select]
java -cp bluecove-2.0.3-20080112.060257-1.jar:bluecove-gpl-2.0.3-20080115.211318-1.jar.jar:WiimoteWhiteboard.jar -jar WiimoteWhiteboard.jar

You don't need the bluecove-2.0.3-SNAPSHOT.jar since it is bundled with the JAR-file. And why did you take the oldest snapshots (1)? Try the latest bluecove-gpl (http://www.pyx4me.com/maven2-snapshot/net/sf/bluecove/bluecove-gpl/2.0.3-SNAPSHOT/bluecove-gpl-2.0.3-20080309.181821-45.jar) (45).
And do you have a working BlueZ Bluetooth stack on your Linux system? This is required to run since BlueCove is just using the native OS Bluetooth stack.

Thanks for trying it out!
Uwe
Title: Re: Linux Whiteboard
Post by: fnf on March 10, 2008, 04:18:02 PM
It all started with a port of Johnny's app but I didn't really take Johnny's code since I used entirely different libraries.
I don't really understand the license confusion. The file LICENSE.txt as well as a folder Licenses should be present in the ZIP-file you downloaded. My code is licensed under MIT. I slightly modified the license though because of the license of one of the libraries I use (WiiRemoteJ).

Fair enough :) .

Quote
You don't need the bluecove-2.0.3-SNAPSHOT.jar since it is bundled with the JAR-file. And why did you take the oldest snapshots (1)? Try the latest bluecove-gpl (http://www.pyx4me.com/maven2-snapshot/net/sf/bluecove/bluecove-gpl/2.0.3-SNAPSHOT/bluecove-gpl-2.0.3-20080309.181821-45.jar) (45).

Duh! Thanks. I was being silly, just grabbed the top tarball. But it still didn't work:

Code: [Select]
$ java -cp bluecove-gpl-2.0.3-20080309.181821-45.jar:WiimoteWhiteboard.jar -jar WiimoteWhiteboard.jar
java.lang.IllegalStateException: Bluetooth failed to initialize. There is probably a problem with your local Bluetooth stack or API.
        at wiiremotej.WiiRemoteJ.<clinit>(WiiRemoteJ.java:57)
        at org.uweschmidt.wiimote.whiteboard.WiimoteDataHandler.<init>(WiimoteDataHandler.java:92)
        at org.uweschmidt.wiimote.whiteboard.WiimoteWhiteboard.startup(WiimoteWhiteboard.java:73)
        at org.jdesktop.application.Application$1.run(Application.java:171)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: javax.bluetooth.BluetoothStateException: BlueCove com.intel.bluetooth.BluetoothStackBlueZ not available
        at com.intel.bluetooth.BlueCoveImpl.loadStackClass(BlueCoveImpl.java:277)
        at com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:312)
        at com.intel.bluetooth.BlueCoveImpl.access$100(BlueCoveImpl.java:64)
        at com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:533)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged(BlueCoveImpl.java:531)
        at com.intel.bluetooth.BlueCoveImpl.getBluetoothStack(BlueCoveImpl.java:520)
        at javax.bluetooth.LocalDevice.<init>(LocalDevice.java:67)
        at javax.bluetooth.LocalDevice.getLocalDeviceInstance(LocalDevice.java:74)
        at javax.bluetooth.LocalDevice.getLocalDevice(LocalDevice.java:90)
        at wiiremotej.WiiRemoteJ.<clinit>(WiiRemoteJ.java:49)
        ... 11 more

bluecove-gpl is still experimental though, I'm not expecting much. Can't you download a Ubuntu Live CD and test it out in the virtual machine?. USB devices will work under most modern VM like VMware and VirtualBox. Installing sun-java6-jre using the package manager and you should be good to go (just in case, most everything in Linux should be installed by the package manager, not from a random website).

Quote
And do you have a working BlueZ Bluetooth stack on your Linux system? This is required to run since BlueCove is just using the native OS Bluetooth stack.

Sure I do :) I test Linux Whiteboard all the time.

I'm currently implementing support for multiple Wiimotes to increase IR signal availability. It supports virtually unlimited number of Wiimotes with a single bluetooth device. It should be done in a day or two :) easier than the physics engine.
Title: Re: Linux Whiteboard
Post by: ujs on June 21, 2008, 07:37:31 AM
I got my Java Whiteboard running on Linux (latest Ubuntu) yesterday. Click here for instructions (http://www.uweschmidt.org/node/48/303#comment-303).

Uwe
Title: Re: Linux Whiteboard
Post by: fnf on June 21, 2008, 09:33:50 PM
I got my Java Whiteboard running on Linux (latest Ubuntu) yesterday. Click here for instructions (http://www.uweschmidt.org/node/48/303#comment-303).

Uwe

It works great =) and seems to have more features than the current Linux Whiteboard. Do you have plan for future improvements?.
Title: Re: Linux Whiteboard
Post by: ujs on June 24, 2008, 08:26:56 AM
It works great =) and seems to have more features than the current Linux Whiteboard. Do you have plan for future improvements?.

Thanks. I'm glad it finally works.

I would really like to make the Wiimote communication more reliable. But this is handled by a library I use (WiiRemoteJ), and its author currently seems to be busy doing other things and doesn't have the time to work on it.

Other features that might be included in future versions:


Uwe
Title: Re: Linux Whiteboard
Post by: fnf on June 24, 2008, 10:58:53 AM
Quote
  • Localization: The software is kinda ready to be localized. But I won't do it unless people really want it since supporting multiple languages potentially slows down development (more people involved).

IMO it'd better be done sooner rather than later, it would take a huge amount of time/effort when your app gets big enough. You can make it i18n-ready but leave other locales alone until someone volunteers.

Quote
  • Adaptive Mouse Smoothing: See this post (http://www.uweschmidt.org/comment/289).

It is done in Linux Whiteboard during the calibration process. The default number of past cursor positions remembered is 7. But depending on the jerkiness, it will be increased if the precision is low and decreased otherwise. That allows drawing with good precision: to 1px when needed.

Quote
  • Supporting more than 2 Wiimotes: Currently restricted by the user interface and the clustering algorithm (for now only simple pairing of IR dots from 2 Wiimotes)
That actually put me off for quite sometime in implementing battery and otherwise individual Wiimotes' information in fear of cluttering the interface. Besides, with the current Linux Whiteboard, there is only 1 Wiimote as far as it concerns. All IR signals (and battery :s ) are processed in the API before they get to the main program.

[/list]

Uwe

[/quote]
Title: Re: Linux Whiteboard
Post by: ujs on June 26, 2008, 04:01:56 AM
IMO it'd better be done sooner rather than later, it would take a huge amount of time/effort when your app gets big enough. You can make it i18n-ready but leave other locales alone until someone volunteers.

My app is basically i18n-ready. Almost all strings (some few exceptions) are stored in .properties-files (Java's way of localizing).

Quote
  • Adaptive Mouse Smoothing: See this post (http://www.uweschmidt.org/comment/289).

It is done in Linux Whiteboard during the calibration process. The default number of past cursor positions remembered is 7. But depending on the jerkiness, it will be increased if the precision is low and decreased otherwise. That allows drawing with good precision: to 1px when needed.

Nice. But why during the calibration? I wanted to constantly adjust the averaging based on "IR Pen movement speed", if you know what I mean.

Quote
  • Supporting more than 2 Wiimotes: Currently restricted by the user interface and the clustering algorithm (for now only simple pairing of IR dots from 2 Wiimotes)

That actually put me off for quite sometime in implementing battery and otherwise individual Wiimotes' information in fear of cluttering the interface. Besides, with the current Linux Whiteboard, there is only 1 Wiimote as far as it concerns. All IR signals (and battery :s ) are processed in the API before they get to the main program.

So you support more than 2 Wiimotes? How are you solving the problem of "clustering" IR dots: As you know, each Wiimote reports the positions of up to four IR dots. How do you calculate which IR dots "belong together"?

Uwe
Title: Re: Linux Whiteboard
Post by: fnf on June 26, 2008, 06:13:18 AM
Quote
Nice. But why during the calibration? I wanted to constantly adjust the averaging based on "IR Pen movement speed", if you know what I mean.

Because as I see it, there is no way to know -during real usages- whether the jerkiness is caused by the Wiimotes itself or the user, thus that data cannot be used to determine immediate IR stability. But during calibration users are instructed to hold the pointer still, that is a good opportunity to figure out how far off the IR signal can be from the original position.

Quote
So you support more than 2 Wiimotes? How are you solving the problem of "clustering" IR dots: As you know, each Wiimote reports the positions of up to four IR dots. How do you calculate which IR dots "belong together"?
There are a few steps:
 - All virtual IR dots from a single event in each Wiimote are ignored except the one nearest to the last IR position. I then have a set of IR (and buttons, etc) events in each Wiimote. With multiple Wiimotes, I have multiple sets of events.
 - I rebalance these sets of events to have the same size, the smaller sets are filled with 'empty' events.
 - To determine the next IR pointer's position: I compare the 1st IR events picked from all sets of events and take the one nearest to the last IR position. Then I pick all 2nd IR events from these set for the next IR position, and so on and so forth.
 - Eventually the main application gets a single set of IR and button events to process.

The complexity stemmed from the fact that each Wiimote reports different numbers of events in each processing cycle.
Title: Re: Linux Whiteboard
Post by: fnf on June 26, 2008, 12:52:38 PM
Quote
Nice. But why during the calibration? I wanted to constantly adjust the averaging based on "IR Pen movement speed", if you know what I mean.

Forgot to add: although the move tolerance (the 'stray' distance to determine between a right-click and a click-and-drag) is optimized during calibration (default is 7px), it is reduced very quickly as the program remembers past IR position. Usually after a couple of IR events, the move tolerance should reduce to 1px, which allows drawing of small distance.

The code for which is in /src/irfilter.cpp should you find it helpful.