View Single Post
  #4   Spotlight this post!  
Unread 26-05-2010, 00:17
vamfun vamfun is offline
Mentor :Contol System Engineer
AKA: Chris
FRC #0599 (Robodox)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 2003
Location: Van Nuys, California
Posts: 182
vamfun is a glorious beacon of lightvamfun is a glorious beacon of lightvamfun is a glorious beacon of lightvamfun is a glorious beacon of lightvamfun is a glorious beacon of lightvamfun is a glorious beacon of light
Send a message via AIM to vamfun
Re: Encoder::GetRate()

Quote:
Originally Posted by masoug View Post
Thanks for the quick reply, so if there are no errors, it returns the number of pulses over time?

How would I get a speed value from it? IF GetRate() is REALLY not THAT good, then would GetDistance() work?

THANKS!!!

-Masoug
GetRate() automatically scales the pulse rate to get speed. The output = distance_per_pulse/pulse_period, where pulse_period is the time between the last two recorded pulses unless there is a stall condition. In a stall condition, pulse_period is set to "infinity" after the max_period time is exceeded. This drives GetRate() to zero.

GetDistance() is working ok. Only GetRate() has a few bugs. As I mentioned before, a temporary patch has been defined to get this operational on first forge and will surely be corrected in a software update before next season.

Last edited by vamfun : 26-05-2010 at 01:48.
Reply With Quote