View Single Post
  #3   Spotlight this post!  
Unread 12-02-2011, 16:54
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Re: Few Questions over WPILib Code

Well I can certainly field a few of these.

Quote:
Originally Posted by theprgramerdude View Post
First of all, for the Encoder->GetRate() function, it's return type is a double, but what units does it return it in?
In whatever units you'd like, you should be specifying a distance per pulse which the GetRate() function then uses. Which ever unit you are implicitly using in distance per pulse is the unit GetRate() returns.

Quote:
Originally Posted by WPILibRev2259
Code:
double Encoder::GetRate()
{
	return (m_distancePerPulse / GetPeriod());
}
Quote:
Originally Posted by theprgramerdude View Post
Is there a maximum rate at which this can be called, even though the physical limit at which meaningful data can be obtained might be around 10,000 revs /sec max?
The encoder will obviously only have a certain refresh rate due to hardware limitations, but there is no hard coded maximum of calling the function.

Quote:
Originally Posted by theprgramerdude View Post
Second, for the Timer functions, is it possible to obtain microsecond or better accuracy by subtracting two different timestamp functions, like GetPPCTimeStamp() or GetFPGATimeStamp(), and furthermore, are these timestamps just representations of how many clock cycles have passed, and thus dependent on the speed of the proccesor, or of the actual time in seconds passed?
Not entirely sure, however I frankly believe the accuracy the Timer object provides should be good enough for high-level applications - the Timer object will be the actual time in seconds passed.

http://mmrambotics.ca/wpilib/class_timer.html

It seems you are doing some interesting data acquisition. Care to elaborate?

EDIT: jwakeman beat me to the first answer, but I'll keep my post.
Reply With Quote