BUG in lejos.nxt.remote.RemoteMotor

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

Moderators: 99jonathan, roger, imaqine

BUG in lejos.nxt.remote.RemoteMotor

Postby Epimenides » Sun Jan 02, 2011 8:07 pm

Hello,

i have done some testing with the RemoteMotor class (lejos 0.85). One major problem, which i have observed, is the behaviour of the following program:

Code: Select all
import lejos.nxt.Motor;

public class Test {
   public static void main(String[] args) {
      Motor.A.rotate(0);
   }
}


Running this program causes the motor at port A to rotate infinitely. I think rotate(0) should cause the corresponding motor to do nothing, or? This wrong behavior is also a problem when using remotely (USB or Bluetooth) SimpleNavigator with TachoPilot.

Thanks for any comments on this problem,
Epi
Epimenides
New User
 
Posts: 12
Joined: Mon Nov 29, 2010 4:55 pm

Re: BUG in lejos.nxt.remote.RemoteMotor

Postby poohsen » Sun Jan 29, 2012 1:27 pm

it's funny nobody replied to this post. just stumbled upon it while looking for something else.
i ran into the same problem before with 0.8.5. I haven't done any further testing, but I believe it can also happen with small values >0
does anybody know if this has been fixed in 0.9?

chris
poohsen
New User
 
Posts: 20
Joined: Sun Nov 20, 2011 1:47 pm

Re: BUG in lejos.nxt.remote.RemoteMotor

Postby gloomyandy » Sun Jan 29, 2012 2:46 pm

Hi,
it depends if the problem was in the actual motor driver on the NXT then there is a good chance this has been fixed as the driver was changed considerably for 0.9.0. If the problem is in the remote part then it probably will not have been fixed.

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4173
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: BUG in lejos.nxt.remote.RemoteMotor

Postby poohsen » Mon Jan 30, 2012 10:36 am

I see. I'm using this LCP Listener Programm on the remote NXT from the samples dir.
Is there an alternative? I read something about a "PC API" somewhere but I didn't really understand how to use it

c.
poohsen
New User
 
Posts: 20
Joined: Sun Nov 20, 2011 1:47 pm

Re: BUG in lejos.nxt.remote.RemoteMotor

Postby gloomyandy » Mon Jan 30, 2012 11:08 am

Hi,
I think you need to provide more detail of exactly what it is you are doing. What software are you running on the NXT, what other programs and devices are you using... Why are you still using 0.8.5, rather than 0.9.0?

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4173
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: BUG in lejos.nxt.remote.RemoteMotor

Postby poohsen » Tue Jan 31, 2012 6:21 am

hopefully I'll find some time today in the evening to reproduce this problem in isolation.
the same goes for our discussion over at viewtopic.php?f=7&t=2735

but just to answer your last question quickly: I used to get this behaviour with 0.8.5 and I used a very crude workaround to circumvent it.
I am now using a DEV snapshot (rev 6270) and I haven't checked yet if the workaround is still necessary.

br,
chris
poohsen
New User
 
Posts: 20
Joined: Sun Nov 20, 2011 1:47 pm

Re: BUG in lejos.nxt.remote.RemoteMotor

Postby gloomyandy » Tue Jan 31, 2012 11:59 am

The motor driver in 0.9.x is totally different to that used in 0.8.5 and should not have these problems.

However in general I'm not sure that clearing the tacho count is a good idea and in particular it may cause problems it the motor is having to be used to hold a position at the time of change (at the very least you may lose some amount of positional accuracy). There is often no real need to zero it as you can simply keep track locally of any offset and factor that into move requests etc.

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4173
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: BUG in lejos.nxt.remote.RemoteMotor

Postby poohsen » Tue Jan 31, 2012 9:14 pm

yeah, you're right about that offset thing. zeroing out was somehow the "natural" thing to do when I thought about it for the first time, but any other value than 0 is just as good, really. but that comment was probably meant to go into the other thread...

now, as for the "rotating to 0 bug", i'm afraid I'm still getting the bug with my DEV snapshot. you can simply reproduce it by connecting two bricks via RS485. Run the "NXTLCPRespond" program from the samples dir on the remoteNXT and this one on the other brick:
Code: Select all
import java.io.IOException;
import lejos.nxt.LCD;
import lejos.nxt.comm.RS485;
import lejos.nxt.remote.RemoteNXT;

public class RotationBug {

   public static void main(String[] args) throws IOException {
      RemoteNXT rnxt = new RemoteNXT("NXT", RS485.getConnector());
      rnxt.B.rotateTo(0);
   }

}


that's all it takes... every time.
poohsen
New User
 
Posts: 20
Joined: Sun Nov 20, 2011 1:47 pm

Re: BUG in lejos.nxt.remote.RemoteMotor

Postby gloomyandy » Tue Jan 31, 2012 11:25 pm

Again what happens with the same code if you run it on a single NXT. Before we do anything we need to work out if this is a remote problem or a motor driver problem...
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4173
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: BUG in lejos.nxt.remote.RemoteMotor

Postby poohsen » Wed Feb 01, 2012 7:17 am

ah, I see. I didn't really understand your question before since I was already expecting it to be a problem with the RemoteMotor class and testing that class on a single NXT didn't make sense.
I'll test it again with the NXTRegulatedMotor class on a single brick and post the results

c.
poohsen
New User
 
Posts: 20
Joined: Sun Nov 20, 2011 1:47 pm

Re: BUG in lejos.nxt.remote.RemoteMotor

Postby poohsen » Wed Feb 01, 2012 7:43 pm

hi Andy,

I tested it again: Motor.B.rotateTo(0) does nothing.
So this seems to be a problem with the RemoteMotor.

c.
poohsen
New User
 
Posts: 20
Joined: Sun Nov 20, 2011 1:47 pm

Re: BUG in lejos.nxt.remote.RemoteMotor

Postby gloomyandy » Tue Feb 07, 2012 12:20 am

This should be fixed in 0.9.1...

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4173
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK


Return to NXJ Software

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

more stuff