Re: [Nxtcommand-developers] Motor
Status: Beta
Brought to you by:
bbagnall
From: Brian B. <bba...@mt...> - 2007-07-24 19:48:28
|
Hi Peter, Thanks for checking that out. I see what's going on now. I had to change some of the code to work with leJOS NXJ and didn't recheck with LEGO. That's why it's working for me and not you. It might require a tweak to the leJOS NXJ code to get them both working. My preference is to support primarily NXJ now that the menu system accepts LCP commands. It would be nice if it worked with LEGO firmware though. This might take some investigation to figure out a solution. Just an update, I'm coming along good with the navigation classes. So far Pilot and TachoNavigator seem to work well. The Compass ones will take a bit more fiddling. - Brian ----- Original Message ----- From: "Peter Joosten" <ptg...@up...> To: "'Brian Bagnall'" <bba...@mt...> Sent: Tuesday, July 24, 2007 1:17 PM Subject: RE: Motor > Just to be sure: On the NXT brick I am using the Lego firmware, not the > Lejos NXJ > > -----Original Message----- > From: Peter Joosten [mailto:ptg...@up...] > Sent: dinsdag 24 juli 2007 20:11 > To: 'Brian Bagnall' > Subject: RE: Motor > > > Hi Brian, > > I also reverted back locally to v96 to reprodruce the error I reported. > I detected the error using the TachoCount sample. To reproduce the > error I have used a simplified example: > > public static void main(String [] args) throws Exception { > NXTCommand.open(); > NXTCommand.setVerify(true); > System.out.println("Tachometer A: " + Motor.A.getTachoCount()); > Motor.A.rotate(5000); > System.out.println("Tachometer A: " + Motor.A.getTachoCount()); > NXTCommand.close(); > } > > Output: > > Looking for 'icommand.properties' in working dir: > C:\projecten\icommand\data\eclipse\workspace\icommand-samples > Looking for 'icommand.properties' in home dir: C:\Documents and > Settings\Peter > BlueCove version 2.0.0 on winsock > Tachometer A: 0 > > The 2nd tachometer position is not shown. The connection is not closed. > Debugging: > > public boolean isMoving() { > OutputState o = nxtCommand.getOutputState(id); > System.out.println(o.mode); > return ((MOTORON & o.mode) == MOTORON); > } > > The value is 7 and doesn't change. As a result isMoving stays true and the > rotate method > is in an endless loop. This bug occurs for all motors: A, B, or C. > > Peter Joosten. > > > -----Original Message----- > From: Brian Bagnall [mailto:bba...@mt...] > Sent: maandag 23 juli 2007 23:49 > To: Peter Joosten > Subject: Motor > > > Hi Peter, > > The Motor changes caused the Motor no longer wait until the command has > completed before continuing, so the following code no longer works > properly: > > Pilot p = new Pilot(5.6F, 16.0F,Motor.B, Motor.C, true); > p.travel(100); > p.rotate(90); > p.travel(-100); > > I reverted back to version 96 (locally) and that seems to work properly. > You > mentioned in your email that Motor A goes into an endless loop when the > tacholimit is reached. I'm using motors B and C for my example. Is the > problem only with Motor A? > > - Brian > > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.476 / Virus Database: 269.10.17/915 - Release Date: 24-7-2007 > 13:50 > > |