I am seeing strange behavior under Mac osX with the .0.91 beta code. The following program should drive the pilot forward 100cm and then backward 100cm. The behavior I see is a 90 degree rotation, 100cm of forward travel followed by -90 degrees rotation, 90 degrees rotation, 100cm of forward travel and finally -90 degrees rotation.
I am using the Mac's built in bluetooth capabilities.
I am running Java 1.6.0_29 and have the appropriate NXJ_HOME, etc variables set.
Running with the PC API from the command line via ant (build.properties and build.xml copied from the samples/org.lejos.pcexample directory w/ main.class=StraightTest). I see the same behavior when trying through Eclipse via the Eclipse leJOS plugin and creating a leJOS PC project.
Running this code on my Window XP machine with 0.91beta results in the expected forward travel/backward travel behavior.
My next step is to downgrade to earlier version of leJOS on the Mac.
Has any one else seen this? Am I missing something here?
Thanks,
legoZ
- Code: Select all
import lejos.nxt.Motor;
import lejos.robotics.navigation.DifferentialPilot;
public class StraightTest {
public static void main(String[] args) {
DifferentialPilot pilot = new DifferentialPilot(5.6f, 12.1f, Motor.C, Motor.A);
pilot.travel(100);
pilot.travel(-100);
}
}
