ROBOTC.net forums
http://www.robotc.net/forums/

understanding nMotorEncoderTarget
http://www.robotc.net/forums/viewtopic.php?f=55&t=5238
Page 1 of 1

Author:  matt snyder [ Mon Dec 10, 2012 12:48 am ]
Post subject:  understanding nMotorEncoderTarget

Hi all, I'm trying to run this sample code to test encoders, using the standard model NXT robot:

http://www.maelabs.ucsd.edu/cosmos/cont ... /encoder.c

When I run it in Virtual Worlds, the program completes instantly, and the robot does nothing. Further testing suggests that (nMotorRunState[xxx] != runStateIdle) is always false, no matter what. Is there something wrong with the sample program? Or does nMotorEncoderTarget not work with NXT motors?

Author:  mightor [ Mon Dec 10, 2012 2:23 am ]
Post subject:  Re: understanding nMotorEncoderTarget

You should check if it's runStateHoldPosition or runStateIdle.

= Xander

Author:  flvtxfreak [ Mon Dec 10, 2012 7:22 am ]
Post subject:  Re: understanding nMotorEncoderTarget

I thought jbflot said in another thread the target commands weren't supported yet in VW, only access with nMotorEncoder?

Author:  mightor [ Mon Dec 10, 2012 8:26 am ]
Post subject:  Re: understanding nMotorEncoderTarget

Could be, I was just saying what I usually check for on a real system.

= Xander

Author:  jbflot [ Mon Dec 10, 2012 8:59 am ]
Post subject:  Re: understanding nMotorEncoderTarget

Quote:
I thought jbflot said in another thread the target commands weren't supported yet in VW, only access with nMotorEncoder?


Correct. Encoder Targets and Motor Synching aren't supported yet in the virtual worlds. We definitely see the value in adding them, it's just a development that requires some big changes to the system. We'll keep you posted!

Author:  robusto [ Wed Jan 16, 2013 11:27 pm ]
Post subject:  Re: understanding nMotorEncoderTarget

So nMotorEncoderTarget is not supported? Nice if there was an error to the effect.
So this means it is not possible to do proper odometry in Virtual Worlds right?

Author:  robusto [ Thu Jan 17, 2013 2:40 am ]
Post subject:  Re: understanding nMotorEncoderTarget

The Lego Rem Bot is 160mm wide. But what is the distance between the wheel centres?

On another topic, why are the spaces measured in Imperial and not good old metric?

Author:  tclancey [ Fri Jan 18, 2013 9:23 am ]
Post subject:  Re: understanding nMotorEncoderTarget

I'm glad I found this, I was scratching my head for about 2 hours last night trying to figure out why it wasn't working.

Author:  JohnWatson [ Mon Jan 28, 2013 4:51 pm ]
Post subject:  Re: understanding nMotorEncoderTarget

A couple of things for reference:

nMotorEncoderTarget and nSyncedMotors currently will not work in Robot Virtual Worlds; this is because they depend on values generated by the NXT brick that are not yet emulated by Robot Virtual Worlds. However, the nMotorEncoder command does work and can be used to move the motors a set distance with precision.

We have a video trainer curriculum dedicated to the nMotorEncoder/nMotorEncoderTarget functions that you can view as a refresher; it is under the 'Movement -> Improved Movement -> Target Distance' section. We also have a rundown of the NXT Motor Functions on our wiki that can also be used as a quick reference guide.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/