Author Topic: Linux Whiteboard  (Read 37339 times)

Offline ujs

  • *
  • Posts: 134
  • Karma: +10/-0
    • View Profile
    • uweschmidt.org
Reply #15 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 (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 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

Java WiimoteWhiteboard for Mac OS X, Windows and Linux.


Offline fnf

  • *
  • Posts: 70
  • Karma: +2/-0
    • View Profile
Reply #16 on: March 10, 2008, 02:52:07 PM
I was referring to this 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?.
« Last Edit: March 10, 2008, 02:54:48 PM by fnf »

Download Linux Whiteboard from Linux Whiteboard homepage


Offline ujs

  • *
  • Posts: 134
  • Karma: +10/-0
    • View Profile
    • uweschmidt.org
Reply #17 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 (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

Java WiimoteWhiteboard for Mac OS X, Windows and Linux.


Offline fnf

  • *
  • Posts: 70
  • Karma: +2/-0
    • View Profile
Reply #18 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 (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.

Download Linux Whiteboard from Linux Whiteboard homepage


Offline ujs

  • *
  • Posts: 134
  • Karma: +10/-0
    • View Profile
    • uweschmidt.org
Reply #19 on: June 21, 2008, 07:37:31 AM
I got my Java Whiteboard running on Linux (latest Ubuntu) yesterday. Click here for instructions.

Uwe

Java WiimoteWhiteboard for Mac OS X, Windows and Linux.


Offline fnf

  • *
  • Posts: 70
  • Karma: +2/-0
    • View Profile
Reply #20 on: June 21, 2008, 09:33:50 PM
I got my Java Whiteboard running on Linux (latest Ubuntu) yesterday. Click here for instructions.

Uwe

It works great =) and seems to have more features than the current Linux Whiteboard. Do you have plan for future improvements?.

Download Linux Whiteboard from Linux Whiteboard homepage


Offline ujs

  • *
  • Posts: 134
  • Karma: +10/-0
    • View Profile
    • uweschmidt.org
Reply #21 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:

  • Spanning multiple screens (some people already asked for it).
  • Direct connection to preselected Wiimotes (BT addresses) instead of doing a device discovery every time. This could speed up the connection process and prevent other people from tampering with the software by pairing other Wiimotes (e.g. in a classroom)
  • 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).
  • Adaptive Mouse Smoothing: See this post.
  • 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)

Uwe

Java WiimoteWhiteboard for Mac OS X, Windows and Linux.


Offline fnf

  • *
  • Posts: 70
  • Karma: +2/-0
    • View Profile
Reply #22 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

    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]

    Download Linux Whiteboard from Linux Whiteboard homepage


    Offline ujs

    • *
    • Posts: 134
    • Karma: +10/-0
      • View Profile
      • uweschmidt.org
    Reply #23 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

    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

    Java WiimoteWhiteboard for Mac OS X, Windows and Linux.


    Offline fnf

    • *
    • Posts: 70
    • Karma: +2/-0
      • View Profile
    Reply #24 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.
    « Last Edit: June 26, 2008, 06:16:02 AM by fnf »

    Download Linux Whiteboard from Linux Whiteboard homepage


    Offline fnf

    • *
    • Posts: 70
    • Karma: +2/-0
      • View Profile
    Reply #25 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.

    Download Linux Whiteboard from Linux Whiteboard homepage