Is the iCommand 0.6 travel() method working correctly?

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

Is the iCommand 0.6 travel() method working correctly?

Postby Gert » Fri Jul 27, 2007 8:13 pm

Hi,

I have downloaded iCommand 6 from subversion and noticed that the travel() method of TachoNavigator and Pilot are doing the transformation from distance to counts double.

The TachoNavigator method travel() first calculates the counts by using COUNTS_PER_CM (line 221) and than calls Pilot's method travel(). This method seems to expect also a distance and does also a transformation from distance to rotation degrees (line 149 and 150).


Travel method from TachoNavigator.java

public void travel(long dist) {
219 // Do I want this to return immediately? Pretty easy to make it
220 // return and make it able to keep track of count even if interrupted.
221 int counts = (int)(dist * COUNTS_PER_CM);
222 //System.out.println("COUNTS_PER_CM = " + COUNTS_PER_CM);
223 //System.out.println("Counts = " + counts);
224 this.moving = true;
225 vehicle.travel(counts);
226 this.moving = false;
227 recalculate();
228 }

Travel method from Pilot.java

public void travel(float distance,boolean immediateReturn)
147 {
148 //setSpeed(_speed);
149 _left.rotate((int)(_parity*distance*_degPerDistance),true);
150 _right.rotate((int)(_parity*distance*_degPerDistance),true);
151 if(immediateReturn)return;
152 while(_left.isMoving())Thread.yield();
153 while(_right.isMoving())Thread.yield();
154 }
Gert
New User
 
Posts: 6
Joined: Sun May 13, 2007 3:40 pm
Location: Netherlands

Postby bbagnall » Sat Jul 28, 2007 4:48 pm

Those are very old methods from the iCommand released last October. The new iCommand uses totally different code. It should be released soon, hopefully this weekend.
User avatar
bbagnall
Site Admin
 
Posts: 392
Joined: Fri Aug 04, 2006 4:03 pm

Postby Gert » Sat Jul 28, 2007 6:50 pm

I am really looking forward to the new version. Magellan (from the book) is waiting patiently.

But what I don't understand is that you say I am looking to an old version. I got the version from Subversion and it was recently edited (last edit a day ago) with the remarks about bringing it up to date with version nxj 3.0.

I worked also with the iCommand 0.6 and that was completely different from the code I downloaded from subversion, which has the number 0.6

But I will wait for the official release and than check again. I really like controlling my robot in Java via iCommand. Great work!

Thanks,
Gert
Gert
New User
 
Posts: 6
Joined: Sun May 13, 2007 3:40 pm
Location: Netherlands

Postby Gert » Sat Jul 28, 2007 6:59 pm

I just looked at the the source and I saw it was updated with the new source today and now the problem is gone.

So, please ignore my last post.
Gert
Gert
New User
 
Posts: 6
Joined: Sun May 13, 2007 3:40 pm
Location: Netherlands


Return to NXJ Software

Who is online

Users browsing this forum: Google [Bot] and 1 guest

more stuff