To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 27289
27288  |  27290
Subject: 
Need help combining steering with odometry in NXC
Newsgroups: 
lugnet.robotics
Date: 
Tue, 4 Dec 2007 03:59:01 GMT
Viewed: 
5359 times
  
I'm working on an NXT bot to do the Trinity College Fire Fighting Robot Contest
(http://www.trincoll.edu/events/robot/), at least well enough to get through
this Saturday's demo at the local science museum.  At the moment, I'm just
trying to get the robot to follow the wall (which is white on a black floor, so
think of it as line-following), while also having odometry to tell how far I've
gone.

But so far, nothing I've tried seems to work.  I thought I could just do

  OnFwdSync( OUT_AC, 75, 0 );

before my wall-following loop, and then within the loop, based on the sensor
input, call

  SetOutput( OUT_AC, TurnRatio, turnRatio );

(where I'm confident that "turnRatio" is properly calculated).  But this doesn't
seem to make the robot turn at all.  So instead, I've had to call OnFwdSync with
my continually-updated turnRatio inside the loop.  That makes it turn fine, but
it also seems to continually reset the tachometer counts.  This is true even
when I instead use

  OnFwdSyncEx( OUT_AC, 75, turnRatio, RESET_NONE );

which I thought explicitly told it not to reset the tacho counts.

This seems like such a simple task, surely I'm not the first to attempt it.
What's the recommended procedure for steering (adjusting the turn ratio) inside
a sensor loop, without losing your tachometer counts?

Many thanks,
- Joe



Message has 2 Replies:
  Re: Need help combining steering with odometry in NXC
 
(...) Update: upon a couple more hours' testing, I found that the above command actually prevents the bot from turning at all. It will only turn if I pass at least RESET_BLOCK_COUNT for the last parameter (of course other combinations that include (...) (17 years ago, 4-Dec-07, to lugnet.robotics)
  Re: Need help combining steering with odometry in NXC
 
(...) If you are really following a line then you should use a traditional line following algorithm rather than try to use motor synchronization and turn ratios. There isn't any reason to synchronize the motors since following a line usually (...) (17 years ago, 5-Dec-07, to lugnet.robotics)

4 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR