Go to Post drill holes, that should fix it - E. The Kidd [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-02-2011, 16:29
theprgramerdude theprgramerdude is offline
WPI Freshman
AKA: Alex
FRC #2503 (Warrior Robotics)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2008
Location: Brainerd, Minnesota
Posts: 347
theprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud of
Few Questions over WPILib Code

First of all, for the Encoder->GetRate() function, it's return type is a double, but what units does it return it in? Revs/sec, rads/sec? 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?

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?
__________________
Attending: MN Duluth Regional
Reply With Quote
  #2   Spotlight this post!  
Unread 12-02-2011, 16:49
jwakeman jwakeman is offline
Registered User
FRC #0063 (Red Barons)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: 16510
Posts: 182
jwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nice
Re: Few Questions over WPILib Code

GetRate() uses the value you set with SetDistancePerPulse(). It returns distancePerPulse / the period between the last two pulses in seconds. So if you set distancePerPulse to 1.0 and the FPGA saw three pulses in the last second it would return 3.0. The units of the number you set with SetDistancePerPulse() is up to you. So if 1.0 was an inch then you are moving at 3 inches/second. If it was a foot then 3 feet / sec.
Reply With Quote
  #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
  #4   Spotlight this post!  
Unread 12-02-2011, 23:04
theprgramerdude theprgramerdude is offline
WPI Freshman
AKA: Alex
FRC #2503 (Warrior Robotics)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2008
Location: Brainerd, Minnesota
Posts: 347
theprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud of
Re: Few Questions over WPILib Code

My sensor setup this year will likely comprise 4 encoders, one each on the two SuperShifters, and then 1 per arm controller, although one arm controller will probably be a potentiometer instead as there wont be enough rotations to get meaningful data. Furthermore, roughly 10 Maxbotix sensors will be positioned around the robot, probably in 5-5 front-back format, with the last two on each side angled 45-90 degrees. Last, all three line sensors will be on a horizontal line in the front of the robot.

By taking samples from the sensors at such a high rate, I can automate most of the driving with enough precision that I will only need to tell the robot what type of tube it has and which peg to place it on, and presto! The greater the precision in sensing time differences I have, and the greater the amount of samples, I'll be able to do a more accurate integration of the distances traveled, as well as determine what obstacles I may need to avoid, like other robots, as well as their current velocity and position, or get additional references like just how far away the walls are when lining things up.
__________________
Attending: MN Duluth Regional
Reply With Quote
  #5   Spotlight this post!  
Unread 13-02-2011, 08:38
jwakeman jwakeman is offline
Registered User
FRC #0063 (Red Barons)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: 16510
Posts: 182
jwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nice
Re: Few Questions over WPILib Code

sounds ambitious..why not get the camera involved?
Reply With Quote
  #6   Spotlight this post!  
Unread 13-02-2011, 10:32
theprgramerdude theprgramerdude is offline
WPI Freshman
AKA: Alex
FRC #2503 (Warrior Robotics)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2008
Location: Brainerd, Minnesota
Posts: 347
theprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud oftheprgramerdude has much to be proud of
Re: Few Questions over WPILib Code

Because of the huge resources required in doing image processing, there will be too much trade off between speed and usable data, plus there's not much a camera can do for this system, other than provide another type of data acquisition. Ultrasonics can perform object detection just as well, at a far greater rate. With A few gyros, potentiometers and encoders thrown in, too, I'll be capable of placing the arm to the correct height without having to deal with a camera system's code.

Plus, our camera broke.
__________________
Attending: MN Duluth Regional
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 13:55.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi