iCommand SyncMotors

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

Moderators: 99jonathan, roger, imaqine

iCommand SyncMotors

Postby migerh » Wed Mar 07, 2007 9:34 am

Hi,

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
migerh
New User
 
Posts: 6
Joined: Wed Mar 07, 2007 9:09 am

Postby bbagnall » Wed Mar 07, 2007 7:49 pm

It's been a while since I've looked at anything in iCommand (doing all leJOS NXJ lately). Do you have some new code that fixes it? Send that to me and I'll replace the old code.

BTW We could use someone like you on the iCommand project who will improve things like this. Let me know if you want to join.
User avatar
bbagnall
Site Admin
 
Posts: 392
Joined: Fri Aug 04, 2006 4:03 pm

Postby migerh » Wed Mar 07, 2007 9:55 pm

it's my job at the project i'm working on to get a workaround for that, so it should be possible to give you some code to fix this. :) but it's going to take some time, had to give back my borrowed bluetooth dongle yesterday so i can't test my code :(

BTW We could use someone like you on the iCommand project who will improve things like this. Let me know if you want to join.

thanks for your offer. the main problem here might be, that the NXT isn't mine :( so i'm able to test icommand only for the next 2-3 weeks.
migerh
New User
 
Posts: 6
Joined: Wed Mar 07, 2007 9:09 am

Postby migerh » Fri Mar 09, 2007 5:17 pm

Ok, got my new Bluetooth Dongle and started patching iCommand 0.5 (Rev 22) because the current source (it was about Rev 60 in the middle of the week) didn't work for me (NullPointerExceptions on startup, maybe i'm trying to look at this it on the weekend) and to build a fixed icommand.jar in version 0.5 i can work with.

You can download it here:

http://michael-gerhaeuser.de/dump/icomm ... tch.tar.gz
Patched Source-Files of SyncMotors.java and ServoNavigator.java (Diff-File to the original Rev 22 files included)

http://michael-gerhaeuser.de/dump/icommand-0.5.tar.gz
Compiled icommand.jar like v0.5-release with patched sourcefiles included
migerh
New User
 
Posts: 6
Joined: Wed Mar 07, 2007 9:09 am

Postby migerh » Mon Mar 26, 2007 3:51 pm

Hi,

i finished the project today and fixed a little bug i did while patching icommand. i also added inverted-motors handling to the new left() and right() methods of SyncMotors and added a rotateBackwards() method in ServoNavigator. with that you can rotate left/right by moving one wheel backward instead of forward. this is good if you're searching by rotating

you can download the new package (including modified sources of ServoNavigator.java and SyncMotors.java based upon rev22) here:
http://nxt.michael-gerhaeuser.de/icommand.tar.gz

of course comments are welcome. and a short note if this is going to be integrated in current trunk, because depending on that we'd stay on iCommand 0.5 or upgrade if a newer version is released.

greetings,
migerh
migerh
New User
 
Posts: 6
Joined: Wed Mar 07, 2007 9:09 am


Return to NXJ Software

Who is online

Users browsing this forum: Google [Bot] and 3 guests

more stuff