Thread: Bug in WPILib
View Single Post
  #1   Spotlight this post!  
Unread 15-01-2013, 01:19
zsnow's Avatar
zsnow zsnow is offline
Head of Satire
AKA: Zachary Snow
FRC #2122 (Team Tators)
Team Role: Programmer
 
Join Date: Dec 2012
Rookie Year: 2012
Location: Boise, Idaho
Posts: 17
zsnow has a spectacular aura aboutzsnow has a spectacular aura about
Bug in WPILib

After scratching my head for a while dealing with peculiar behavior, I stumbled upon what I believe to be a bug in WPILib. The PIDGet for the AnalogChannel says it returns the average voltage of the channel in its documentation. However, it returns the average value, which is quite different.

Code:
/**
 * Get the Average voltage for the PID Source base object.
 * 
 * @return The average voltage.
 */
double AnalogChannel::PIDGet() 
{
	if (StatusIsFatal()) return 0.0;
	return GetAverageValue();
}
I confirmed this in code by noting the disparity between GetAverageVoltage and PIDGet when output to the console.

Has anyone else seen this problem? Is the average value the standard behavior? My workaround was to subclass AnalogChannel for the time being.

I have installed all the lates updates, I am using the latest version of the reference and WPILib source, and have re-imaged the the cRIO with this year's image.

Last edited by zsnow : 15-01-2013 at 01:23.
Reply With Quote