setAcceleration on remote NXT motor

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

Moderators: 99jonathan, roger, imaqine

setAcceleration on remote NXT motor

Postby numb » Fri Oct 18, 2013 1:46 pm

Hi

We have two NXT's where one NXT controls the other NXT. But we have a problem setting the acceleration on a motor connected to the NXT controlled by the other NXT.

We have this method:

Code: Select all
   private void stopMotorsReset(){
      motorX.stop();
      motorZ.stop();
      bottomNXT.A.stop();
      bottomNXT.B.stop();
      motorX.setSpeed(900);
      motorZ.setSpeed(700);
      bottomNXT.A.setSpeed(900);
      bottomNXT.B.setSpeed(900);


      bottomNXT.B.smoothAcceleration(true);
      bottomNXT.A.smoothAcceleration(true);
       bottomNXT.A.setAcceleration(300);
       bottomNXT.B.setAcceleration(300);
   }


Which should set the acceleration on the remote NXT (bottomNXT) but it seems nothing happens - it still runs on full power with no acceleration
numb
New User
 
Posts: 5
Joined: Tue Oct 15, 2013 11:10 am

Re: setAcceleration on remote NXT motor

Postby gloomyandy » Fri Oct 18, 2013 2:40 pm

With problems like this the first step is always to look at the source code. In this case for the remote motor:
https://sourceforge.net/p/lejos/code/HE ... Motor.java

You can clearly see that in this case the methods to set acceleration are not implemented. This is because the Lego protocol we use (LCP) to talk to the remote device dose not support the setting of acceleration.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3642
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: setAcceleration on remote NXT motor

Postby numb » Mon Oct 21, 2013 9:38 am

Ah I see. Thank you, next time I will consult the source code first.
numb
New User
 
Posts: 5
Joined: Tue Oct 15, 2013 11:10 am


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff