i'm currently working on a project with lego mindstorms. we want to control a NXT over bluetooth und choosed iCommand. it works fine, sometimes getting NoSuchPortException or PortInUseException but this seems to be a system/rxtx-problem.
the problem with iCommand are the ServoNavigator rotation Methods. i tried to let it drive forward, rotate right, drive forward, rotate left. but it didn't work. not with ServoNavigator, not with SyncMotors and it also didn't work with just Motors.
then i looked into the sources and grabbed the Direct Command SDK from lego and tried this code:
- Code: Select all
Motor.C.setSpeed(24);
Motor.B.setSpeed(24);
Motor.C.forward(360);
Motor.B.forward(360);
Motor.C.setRegulationMode(icommand.nxtcomm.NXTProtocol.REGULATION_MODE_MOTOR_SYNC);
Motor.B.setRegulationMode(icommand.nxtcomm.NXTProtocol.REGULATION_MODE_MOTOR_SYNC);
Motor.C.forward(1080, true);
Motor.B.forward(1080, false);
Motor.B.setRegulationMode(icommand.nxtcomm.NXTProtocol.REGULATION_MODE_MOTOR_SPEED);
Motor.C.setRegulationMode(icommand.nxtcomm.NXTProtocol.REGULATION_MODE_MOTOR_SPEED);
Motor.C.forward(720);
looking at your code it seems that you're moving left motor forward and right motor backward to turn left. this is good if you want to stay at current point (that is in the middle of the axis where the tires are on. using abocve code it rotates around the tire that doesn't move), but it just won't work for me (and i could'nt find any other reason why it should be done like that
now my question is: is this going to be improved? do you want to stay at this method to turn left or right? it shouldn't be a problem for me to fix this by myself but it would be nice to have this working like that in coming icommand-releases
migerh

