Page 1 of 2

iCommand 0.6 Bugwatch Thread

Posted: Mon Sep 03, 2007 9:30 pm
by bbagnall
iCommand 0.6 is out! The big additions are:
- It uses Bluecove (Windows) and Bluez (Linux) instead of RXTX.
- The API shadows NXJ much more closely.
- Should work fine with NXJ firmware and LEGO firmware

It isn't thoroughly tested, so if you find bugs or errors in the documentation, please let me know in this thread.

Not really a bug but....

Posted: Thu Sep 13, 2007 7:35 am
by akb1980
could someone please let me know where to find the native library for linux? It is not in the package as claimed in the docs


icommand completely uninstallable

Posted: Mon Sep 17, 2007 8:39 am
by Shawn
there is no native library for linux (is there?) reports a hardware failure so it is not installable for windows either as RXTXcomm.jar is not available.

Could someone please either make RXTXcomm.jar or so that it is installable?


Pretty please?

Re: icommand completely uninstallable

Posted: Mon Sep 17, 2007 9:29 am
by Shawn

Could someone please either make RXTXcomm.jar or so that it is installable?

OK I found RXTXcomm.jar at

Got the sample melody to work so yeah!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Useless typecasts?

Posted: Mon Sep 24, 2007 6:30 am
by Arkil
Hello everyone, I'm new to the forum.

I've been having some trouble using the TachoNavigator class (getX(), getY(), getAngle() returning wildly jumping values), so I decided to take a peek inside.

I noticed quite a few typecasts from double to double, especially in the updatePosition() method. Are they intentional?


Code: Select all

         double turnRadius =pilot._trackWidth/(1 - ratio) -  pilot._trackWidth/2 ; //
         double radians = (double) Math.toRadians(turnAngle); // turnAngle in radians
         double dx0 = turnRadius*(double)Math.sin(radians);  //displacement  in robot coordinates
         double dy0 = turnRadius*(1 -(double) Math.cos(radians));
         distance = (double) Math.sqrt(dx0*dx0+dy0*dy0);  //distance
         moveAngle = (double)Math.atan2(dy0,dx0); //in robot coordinates
         approx = false;
         projection = moveAngle + (double)Math.toRadians(_heading); // angle to project displacement onto world coordinates

I know they won't help me in my own problems, tried it already. Just thought I'd put in my couple of cents.

Some more cents...

Posted: Mon Sep 24, 2007 4:24 pm
by Arkil
After a working hard all day I got back to debugging my robot and rummaging through the Icommand classes in search of a bug.

My quest was not in vain. I think.


Code: Select all

   public int getLeftCount(){ return _parity*_left.getTachoCount();}
   public int getRightCount(){ return _parity*_right.getTachoCount();}

Now, the tachocount, according to, is the number of counts since last reset of the motor counter. This sounds all well and good, but for some reason I noticed after a couple of debug lines, it was never reset! It worked like blockTachoCount, counting degrees of rotation since the NXT was turned on. ("Current position relative to last programmed movement" -

Motor A Rotation Count : 240 Motor B Rotation Count : 243
Motor A Tacho Count :8987 Motor B Tacho Count :8993
Motor A Block Tacho :8987 Motor B Block Tacho :8993

Why was it not reset?

Code: Select all

  public void resetTachoCount()
     _left.resetRotationCounter(); // !! Which one is TachoCount???

This is why.

Interestingly, changing only resetTachoCount() to reset the correct count didn't seem to fix anything, so I changed getLeftCount() and its sibling, along with getTravelDistance() to read the correct counter, the RotationCounter.

In other news, after I'd recovered from this debugging ordeal, I noticed that using a lower ratio (0.8 as opposed to 0.95) in updatePosition() gave me highly accurate X and Y values.

I just hope it won't bork up my rotations.


Posted: Sat Oct 20, 2007 5:24 pm
by bbagnall
Thanks for debugging that, Arkil. I guess that one slipped through the cracks. I only recently started shadowing the leJOS NXJ navigator code. is in repository

Posted: Sun Oct 21, 2007 1:55 am
by ptg_joosten
Due to an error in the ant build system the library is missing in icommand 0.6 distribution at the sourceforge downloads section.
This error in the build system is fixed now. For the brave: the file can be found in de source repository at: ... o?view=log
At revision 119 select the download link. Please report back on any successes or failures. This latest version of is untested (maybe later this week).

Re: Not really a bug but....

Posted: Sun Oct 21, 2007 4:04 pm
by bbagnall
akb1980 wrote:could someone please let me know where to find the native library for linux? It is not in the package as claimed in the docs

Sorry about that Linux users. As soon as I get back from a trip this Wednesday I'll include that in the current distro. In the meantime you should be able to download the missing file from the link Peter supplied above.

not sure if this is a icommand bug

Posted: Thu Oct 25, 2007 3:12 pm
by fschuett
I downloaded the library and configured it
according to the file "Linux BlueZ install.txt".
When I run the test file "" as suggested, I get
a signal 11 in the Java JVM.
I attach the error log from the jvm.
============================= snip
# An unexpected error has been detected by Java Runtime Environment:
# SIGSEGV (0xb) at pc=0x0622c1f6, pid=23510, tid=3084446608
# Java VM: Java HotSpot(TM) Client VM (1.6.0_03-b05 mixed mode)
# Problematic frame:
# V []
# If you would like to submit a bug report, please visit:

--------------- T H R E A D ---------------

Current thread (0x08058800): JavaThread "main" [_thread_in_vm, id=23513]

siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0x00000000

EAX=0x00000000, EBX=0x08057268, ECX=0x000b7d8d, EDX=0x08058800
ESP=0xb7d8de74, EBP=0xb7d8ded8, ESI=0x00000000, EDI=0x08058ce8
EIP=0x0622c1f6, CR2=0x00000000, EFLAGS=0x00210296

Top of Stack: (sp=0xb7d8de74)
0xb7d8de74: 00000000 00000000 00000000 08057268
0xb7d8de84: 08058ce8 08058cf0 080590dc 08058800
0xb7d8de94: 00000000 b7d8dea0 062f201b 08058800
0xb7d8dea4: 08058800 00000000 00000000 08058800
0xb7d8deb4: 00000000 00000000 08058800 01000000
0xb7d8dec4: 08057268 08058ce8 b1e3e8a8 00000000
0xb7d8ded4: 080588ec b7d8df78 b7d1ee0a 080588ec
0xb7d8dee4: 00000000 00000000 b7d8df1c 062faed6

Instructions: (pc=0x0622c1f6)
0x0622c1e6: ac 8b 43 08 89 45 b0 8b 43 0c 89 45 b4 8b 45 0c
0x0622c1f6: 8b 00 50 e8 32 05 fe ff 83 ec 0c 89 c6 50 e8 3f

Stack: [0xb7d3e000,0xb7d8f000), sp=0xb7d8de74, free space=319k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V []
C [] Java_icommand_nxt_comm_NXTCommBluez_rcSocketConnect+0x3a
j icommand.nxt.comm.NXTCommBluez.rcSocketConnect(ILjava/lang/String;I)V+0
j Beep.main([Ljava/lang/String;)V+0
v ~StubRoutines::call_stub
V []
V []
V []
V []
V []
C [java+0x1b98] JavaMain+0x2c8
C []

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j icommand.nxt.comm.NXTCommBluez.rcSocketConnect(ILjava/lang/String;I)V+0
j Beep.main([Ljava/lang/String;)V+0
v ~StubRoutines::call_stub

--------------- P R O C E S S ---------------

Java Threads: ( => current thread )
0x080bf000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=23519]
0x080bd800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=23518]
0x080bc400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=23517]
0x080a8c00 JavaThread "Finalizer" daemon [_thread_blocked, id=23516]
0x080a7c00 JavaThread "Reference Handler" daemon [_thread_blocked, id=23515]
=>0x08058800 JavaThread "main" [_thread_in_vm, id=23513]

Other Threads:
0x080a4800 VMThread [id=23514]
0x080c0c00 WatcherThread [id=23520]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

def new generation total 960K, used 384K [0xadc40000, 0xadd40000, 0xae120000)
eden space 896K, 42% used [0xadc40000, 0xadca03d8, 0xadd20000)
from space 64K, 0% used [0xadd20000, 0xadd20000, 0xadd30000)
to space 64K, 0% used [0xadd30000, 0xadd30000, 0xadd40000)
tenured generation total 4096K, used 0K [0xae120000, 0xae520000, 0xb1c40000)
the space 4096K, 0% used [0xae120000, 0xae120000, 0xae120200, 0xae520000)
compacting perm gen total 12288K, used 2044K [0xb1c40000, 0xb2840000, 0xb5c40000)
the space 12288K, 16% used [0xb1c40000, 0xb1e3f388, 0xb1e3f400, 0xb2840000)
No shared spaces configured.

Dynamic libraries:
06000000-06417000 r-xp 00000000 08:06 447651 /usr/lib/jvm/java-1.6.0.u3-sun-1.6.0.u3/jre/lib/i386/client/
06417000-06430000 rwxp 00417000 08:06 447651 /usr/lib/jvm/java-1.6.0.u3-sun-1.6.0.u3/jre/lib/i386/client/
06430000-0684f000 rwxp 06430000 00:00 0
08048000-08052000 r-xp 00000000 08:06 345521 /usr/lib/jvm/java-1.6.0.u3-sun-1.6.0.u3/jre/bin/java.bin
08052000-08053000 rwxp 00009000 08:06 345521 /usr/lib/jvm/java-1.6.0.u3-sun-1.6.0.u3/jre/bin/java.bin
08053000-082fb000 rwxp 08053000 00:00 0 [heap]
ad6d1000-ad6e3000 r-xp 00000000 08:06 2085097 /usr/lib/
ad6e3000-ad6e5000 rwxp 00011000 08:06 2085097 /usr/lib/
ad707000-ad708000 ---p ad707000 00:00 0
ad708000-ad788000 rwxp ad708000 00:00 0
ad788000-ad78b000 ---p ad788000 00:00 0
ad78b000-ad7d9000 rwxp ad78b000 00:00 0
ad7d9000-ad7dc000 ---p ad7d9000 00:00 0
ad7dc000-ad85a000 rwxp ad7dc000 00:00 0
ad85a000-ad85d000 ---p ad85a000 00:00 0
ad85d000-ad8ab000 rwxp ad85d000 00:00 0
ad8ab000-ad8b2000 r-xs 00000000 08:06 2234303 /usr/lib/gconv/gconv-modules.cache
ad8b2000-ad8f1000 r-xp 00000000 08:06 2250671 /usr/lib/locale/de_DE.utf8/LC_CTYPE
ad8f1000-ad8f4000 ---p ad8f1000 00:00 0
ad8f4000-ad942000 rwxp ad8f4000 00:00 0
ad942000-ad945000 ---p ad942000 00:00 0
ad945000-ad993000 rwxp ad945000 00:00 0
ad993000-ad994000 ---p ad993000 00:00 0
ad994000-ada44000 rwxp ad994000 00:00 0
ada44000-adbc0000 r-xs 02c90000 08:06 345505 /usr/lib/jvm/java-1.6.0.u3-sun-1.6.0.u3/jre/lib/rt.jar
adbc0000-adbc7000 rwxp adbc0000 00:00 0
adbc7000-adbe1000 rwxp adbc7000 00:00 0
adbe1000-adbe4000 rwxp adbe1000 00:00 0
adbe4000-adbff000 rwxp adbe4000 00:00 0
adbff000-adc00000 rwxp adbff000 00:00 0
adc00000-adc01000 rwxp adc00000 00:00 0
adc01000-adc04000 rwxp adc01000 00:00 0
adc04000-adc1f000 rwxp adc04000 00:00 0
adc1f000-adc25000 rwxp adc1f000 00:00 0
adc25000-adc3f000 rwxp adc25000 00:00 0
adc3f000-add40000 rwxp adc3f000 00:00 0
add40000-ae120000 rwxp add40000 00:00 0
ae120000-ae520000 rwxp ae120000 00:00 0
ae520000-b1c40000 rwxp ae520000 00:00 0
b1c40000-b2840000 rwxp b1c40000 00:00 0
b2840000-b5c40000 rwxp b2840000 00:00 0
b5c41000-b5c44000 rwxp b5c41000 00:00 0
b5c44000-b5cc1000 rwxp b5c44000 00:00 0
b5cc1000-b5d51000 rwxp b5cc1000 00:00 0
b5d51000-b7cc1000 rwxp b5d51000 00:00 0
b7cc1000-b7cd0000 r-xp 00000000 08:06 447710 /usr/lib/jvm/java-1.6.0.u3-sun-1.6.0.u3/jre/lib/i386/
b7cd0000-b7cd2000 rwxp 0000e000 08:06 447710 /usr/lib/jvm/java-1.6.0.u3-sun-1.6.0.u3/jre/lib/i386/
b7cd2000-b7cf5000 r-xp 00000000 08:06 447687 /usr/lib/jvm/java-1.6.0.u3-sun-1.6.0.u3/jre/lib/i386/
b7cf5000-b7cf7000 rwxp 00023000 08:06 447687 /usr/lib/jvm/java-1.6.0.u3-sun-1.6.0.u3/jre/lib/i386/
b7cf7000-b7cff000 r-xp 00000000 08:06 934425 /lib/
b7cff000-b7d01000 rwxp 00007000 08:06 934425 /lib/
b7d01000-b7d09000 r-xp 00000000 08:06 933919 /lib/
b7d09000-b7d0b000 rwxp 00007000 08:06 933919 /lib/
b7d0b000-b7d11000 r-xp 00000000 08:06 934423 /lib/
b7d11000-b7d13000 rwxp 00005000 08:06 934423 /lib/
b7d1e000-b7d20000 r-xp 00000000 08:06 442433 /usr/lib/jvm/java-1.6.0.u3-sun-1.6.0.u3/jre/lib/i386/
b7d20000-b7d21000 rwxp 00001000 08:06 442433 /usr/lib/jvm/java-1.6.0.u3-sun-1.6.0.u3/jre/lib/i386/
b7d21000-b7d2c000 r-xp 00000000 08:06 447709 /usr/lib/jvm/java-1.6.0.u3-sun-1.6.0.u3/jre/lib/i386/
b7d2c000-b7d2d000 rwxp 0000b000 08:06 447709 /usr/lib/jvm/java-1.6.0.u3-sun-1.6.0.u3/jre/lib/i386/
b7d2d000-b7d35000 rwxs 00000000 08:06 655436 /tmp/hsperfdata_fschuett/23510
b7d35000-b7d3c000 r-xp 00000000 08:06 934429 /lib/
b7d3c000-b7d3e000 rwxp 00006000 08:06 934429 /lib/
b7d3e000-b7d41000 ---p b7d3e000 00:00 0
b7d41000-b7d8f000 rwxp b7d41000 00:00 0
b7d8f000-b7db2000 r-xp 00000000 08:06 934421 /lib/
b7db2000-b7db4000 rwxp 00022000 08:06 934421 /lib/
b7db4000-b7db6000 rwxp b7db4000 00:00 0
b7db6000-b7ee3000 r-xp 00000000 08:06 933898 /lib/
b7ee3000-b7ee4000 r-xp 0012c000 08:06 933898 /lib/
b7ee4000-b7ee6000 rwxp 0012d000 08:06 933898 /lib/
b7ee6000-b7ee9000 rwxp b7ee6000 00:00 0
b7ee9000-b7eeb000 r-xp 00000000 08:06 934420 /lib/
b7eeb000-b7eed000 rwxp 00001000 08:06 934420 /lib/
b7eed000-b7ef4000 r-xp 00000000 08:06 447659 /usr/lib/jvm/java-1.6.0.u3-sun-1.6.0.u3/jre/lib/i386/jli/
b7ef4000-b7ef6000 rwxp 00006000 08:06 447659 /usr/lib/jvm/java-1.6.0.u3-sun-1.6.0.u3/jre/lib/i386/jli/
b7ef6000-b7f09000 r-xp 00000000 08:06 933925 /lib/
b7f09000-b7f0b000 rwxp 00013000 08:06 933925 /lib/
b7f0b000-b7f0d000 rwxp b7f0b000 00:00 0
b7f0d000-b7f0f000 r-xs 00011000 08:06 447730 /usr/lib/jvm/java-1.6.0.u3-sun-1.6.0.u3/jre/lib/ext/icommand.jar
b7f0f000-b7f22000 r-xp 00000000 08:06 933910 /lib/
b7f22000-b7f24000 rwxp 00012000 08:06 933910 /lib/
b7f24000-b7f26000 rwxp b7f24000 00:00 0
b7f26000-b7f2c000 r-xp 00000000 08:06 463897 /usr/lib/jvm/java-1.6.0.u3-sun-1.6.0.u3/jre/lib/i386/native_threads/
b7f2c000-b7f2d000 rwxp 00006000 08:06 463897 /usr/lib/jvm/java-1.6.0.u3-sun-1.6.0.u3/jre/lib/i386/native_threads/
b7f2d000-b7f2e000 rwxp b7f2d000 00:00 0
b7f2e000-b7f2f000 r-xp b7f2e000 00:00 0
b7f2f000-b7f30000 rwxp b7f2f000 00:00 0
b7f30000-b7f4a000 r-xp 00000000 08:06 934380 /lib/
b7f4a000-b7f4c000 rwxp 0001a000 08:06 934380 /lib/
bfc47000-bfc5c000 rwxp bfc47000 00:00 0 [stack]
ffffe000-fffff000 r-xp 00000000 00:00 0 [vdso]

VM Arguments:
java_command: Beep
Launcher Type: SUN_STANDARD

Environment Variables:

Signal Handlers:
SIGSEGV: [], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGBUS: [], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGFPE: [], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGPIPE: [], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGILL: [], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGUSR2: [], sa_mask[0]=0x00000000, sa_flags=0x10000004
SIGHUP: [], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGINT: [], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGQUIT: [], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGTERM: [], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGUSR2: [], sa_mask[0]=0x00000000, sa_flags=0x10000004

--------------- S Y S T E M ---------------

OS:openSUSE 10.3 (i586)
VERSION = 10.3

uname:Linux #1 SMP 2007/10/05 21:32:04 UTC i686
libc:glibc 2.6.1 NPTL 2.6.1
rlimit: STACK 8192k, CORE 0k, NPROC 4091, NOFILE 8192, AS 1414960k
load average:0.13 0.24 0.47

CPU:total 1 (1 cores per cpu, 1 threads per core) family 6 model 9 stepping 5, cmov, cx8, fxsr, mmx, sse, sse2

Memory: 4k page, physical 515604k(13700k free), swap 1253028k(1101868k free)

vm_info: Java HotSpot(TM) Client VM (1.6.0_03-b05) for linux-x86, built on Sep 24 2007 22:45:46 by "java_re" with gcc 3.2.1-7a (J2SE release)
================================= snap

Did I do something wrong?
Dos this have to do with my java version?

Thanks for your help.

BMW 6 Series history

Posted: Sat Oct 27, 2007 10:04 am
by bas
I got the very same error for iCommand 0.6 with Bluez and Java 1.6 as well. So maybe the issue is really related to (y)our java version!


Posted: Tue Oct 30, 2007 3:03 pm
by chewie
I'm having the same problem with iCommand in Linux. I started with Java v1.4, had this problem and upgraded to 1.6. I still cannot talk to my NXT brick with iCommand, but I can use, say, nxjbrowse to connect to it via bluetooth.

Posted: Tue Oct 30, 2007 3:54 pm
by fschuett
the same is true for me.
I can connect with lejos_nxj without problems via bluetooth.
Pretty much the same program gives an error with icommand.
I tested meanwhile four different java versions (2 different 1.4,
1.5 and 1.6) with the same result:

Segmentation fault, when calls a function inside
Ford Fairlane (North America) specifications

solution (at least for me)

Posted: Tue Oct 30, 2007 4:52 pm
by fschuett
today I experimented some more and I changed
in my file.
With bluez.address=... I get the segmentation fault and
with nxt.btaddress=... the nxt brick works as expected!!!

I hope this helps with your problems, too.


Posted: Tue Oct 30, 2007 6:26 pm
by ptg_joosten
Hi Frank,

You are correct!

There has been a change in the software wihout updating the documentation.
You must use the property nxt.btaddress to specify the bluetooth address of your NXT brick.

I did some debugging yesterday, and came to the same conclusion.