Wednesday, October 8, 2014

Eclipse SWT CheckboxCellEditor hangs on Mac OS X

.. when using the wrong value type.

The CheckboxCellEditor requires an Integer as its value, i.e. the index of one of its labels. When instead providing the label text, the SWT event loop will hang on Mac OS X. The combo editor's setValue method has an assertion to check the value type, but this doesn't result in an Exception with normal settings. Instead, the debugger will typically show that the main loop is stuck in handling the mouse-down event which activated the cell editor.

The fix is simply to provide the correct value, but unfortunately the reason of the hangup is not immediately obvious, there is no exception or log message that indicates the wrong value type as the reason for the hangup.

Tuesday, April 1, 2014

Graupner Amateur

Built by using parts from an original kit found on EBay.



Wingspan 110 cm
Area 18dm2
Weight 650g
Motor Atlas AM2312/26
Prop 9x6
Battery 3cell LiPo, 2200 mAh

Started building just before Christmas 2013, first flight on 1st of March 2014.
Compared to the original, built as tail-dragger and with electric motor. Hood and front window are held by magnets, removed to access battery. Completed weight matches what original estimated for the free-flight configuration, without radio!

Flying it couldn't be better in no-wind conditions. Current draw is up to 10Amp, but plane still slightly climbs at 1/3 power, so full throttle is rarely necessary.

I happened to have grey Monokote around, so I tried to cover it as shown on the kit's box art. I'm surprised how pleasant the color combination turned out. The lettering and "Graupner" logo were cut from Monokote based on copies from the plans.




Sunday, February 9, 2014

LEGO Mindstorms RCX 2.0 in 2014...

I still have a LEGO Mindstorms RCX 2.0 from 2003, and once more the question was: Is it still possible to program the device?

The Windows XP computer that I had used in 2010 (with difficulty, see post from back then) is no more. A brief search only indicated that there's no driver for Windows Vista/7/8, let alone 64 bit. BUT: I always preferred using the RCX with LeJOS, i.e. Java, instead of the Windows based GUI. Then it turns out that Linux actually contains a `linuxusbtower` kernel driver in most distributions. So overall, this sounded easier than ever?!

After installing a current Ubuntu release, the LEGO USB tower was indeed recognized, creating `/dev/usb/legousbtower1` whenever plugged in. But LeJOS 2.1.0 just didn't work, giving various communication errors in the `firmdl` program. I tried to compile the `linuxusbtower` kernel driver from the 2.1.0 sources, but could not find an easy way to get the required kernel source includes.

The solution was to use the LeJOS 3.0.0 "release candidate" (from 2006). It communicated with the Ubuntu-provided `legousbtower` kernel driver just fine. Only quirks:

  • `lejos/bin/*` scripts needed to be `chmod`ed as executable
  • `lejos/bin/lejos` needed the same "export LD_LIBRARY_PATH" and "java -cp .." for the `*.so` shared library that was already in `lejos/bin/lejosjc`
These changes might be included in the latest CVS checkout, but the `*.tgz` download has the advantage that for example `firmdl` can be invoked right away without having to build anything.

Used Eclipse by creating a plain Java project, then removing the default JRE links and instead adding the `lejos/lib/*.jar` files to the build path.
So with Linux and Java, it's possible to use a 10+ year old LEGO brick, and it works just fine.
Compared to an Arduino, it is actually still quite attractive as an into to computer fun for teenagers: In one box, with batteries, you get a motor controller, sensor reader, and simple display and "beeper". With an Arduino, you'd have to add a battery box, speaker, motor shield, LCD, plus put that all into an enclosure.