View unanswered posts | View active topics It is currently Sun Apr 20, 2014 4:20 am






Reply to topic  [ 9 posts ] 
understanding nMotorEncoderTarget 
Author Message
Rookie

Joined: Mon Dec 10, 2012 12:39 am
Posts: 3
Post 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?


Mon Dec 10, 2012 12:48 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3107
Location: Rotterdam, The Netherlands
Post 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
Profile WWW
Rookie

Joined: Sun Nov 04, 2012 11:42 pm
Posts: 15
Post 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
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3107
Location: Rotterdam, The Netherlands
Post 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
Profile WWW
Site Admin
Site Admin

Joined: Tue May 15, 2007 9:02 am
Posts: 403
Post 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!

_________________
Jesse Flot
CMU Robotics Academy
ROBOTC Support


Mon Dec 10, 2012 8:59 am
Profile
Rookie

Joined: Thu Jul 19, 2012 11:14 am
Posts: 18
Post 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
Profile
Rookie

Joined: Thu Jul 19, 2012 11:14 am
Posts: 18
Post 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
Profile
Rookie

Joined: Sat Jan 12, 2013 7:26 am
Posts: 12
Post 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
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 534
Post 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 Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Mon Jan 28, 2013 4:51 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 9 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.