View Single Post
  #9   Spotlight this post!  
Unread 15-02-2009, 23:28
Shira Shira is offline
Registered User
FRC #1836
Team Role: College Student
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Los Angeles
Posts: 30
Shira is an unknown quantity at this point
Re: Ultrasonics / Sonar

Quote:
Originally Posted by Alan Anderson View Post
Are you ever setting range anywhere else? The assignment in the constructor most likely occurs before any echoes have been received, so it won't be a valid value. I believe calling m_ultra->GetRangeInches() later should give you the current range.
We're calling it in Autonomous Periodic or Autonomous Continuous (I'm not sure where we're going to put our code yet but I think it is all going to go in autonomous continuous unless there is a good reason not to..)

There is no other setting of the range anywhere else. I declare the var in the class and then I set the range to the value returned by the get range function.
Reply With Quote