Author |
Message |
matt snyder
Rookie
Joined: Mon Dec 10, 2012 12:39 am Posts: 3
|
 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.cWhen 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?
|
Mon Dec 10, 2012 12:48 am |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: understanding nMotorEncoderTarget
You should check if it's runStateHoldPosition or runStateIdle.
= Xander
_________________| Professional Conduit of Reasonableness| (Title bestowed upon on the 8th day of November, 2013) | My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
Mon Dec 10, 2012 2:23 am |
|
 |
flvtxfreak
Rookie
Joined: Sun Nov 04, 2012 11:42 pm Posts: 15
|
 Re: understanding nMotorEncoderTarget
I thought jbflot said in another thread the target commands weren't supported yet in VW, only access with nMotorEncoder?
|
Mon Dec 10, 2012 7:22 am |
|
 |
mightor
Site Admin
Joined: Wed Mar 05, 2008 8:14 am Posts: 3654 Location: Rotterdam, The Netherlands
|
 Re: understanding nMotorEncoderTarget
Could be, I was just saying what I usually check for on a real system.
= Xander
_________________| Professional Conduit of Reasonableness| (Title bestowed upon on the 8th day of November, 2013) | My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
Mon Dec 10, 2012 8:26 am |
|
 |
jbflot
Site Admin
Joined: Tue May 15, 2007 9:02 am Posts: 409
|
 Re: understanding nMotorEncoderTarget
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!
|
Mon Dec 10, 2012 8:59 am |
|
 |
robusto
Rookie
Joined: Thu Jul 19, 2012 11:14 am Posts: 18
|
 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?
|
Wed Jan 16, 2013 11:27 pm |
|
 |
robusto
Rookie
Joined: Thu Jul 19, 2012 11:14 am Posts: 18
|
 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?
|
Thu Jan 17, 2013 2:40 am |
|
 |
tclancey
Rookie
Joined: Sat Jan 12, 2013 7:26 am Posts: 12
|
 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.
|
Fri Jan 18, 2013 9:23 am |
|
 |
JohnWatson
Site Admin
Joined: Thu May 24, 2012 12:15 pm Posts: 722
|
 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.
_________________Check out our Blog! And our Facebook page! Need help? Take a look at our updated help documentation and the ROBOTC Forums.
|
Mon Jan 28, 2013 4:51 pm |
|
|