code/WPILib/CANJaguar.cpp
/**
 * Get the Proportional gain of the controller.
 * 
 * @return The proportional gain.
 */
Get the Proportional gain of the controller.

@return The proportional gain.
Get the Proportional gain of the controller . @return The proportional gain .
double CANJaguar::GetP()
{
	UINT8 dataBuffer[8];
	UINT8 dataSize;
	switch(m_controlMode)
	{
	case kPercentVbus:
	case kVoltage:
		break;
	case kSpeed:
		getTransaction(LM_API_SPD_PC, dataBuffer, &dataSize);
		if (dataSize == sizeof(INT32))
		{
			return unpackFXP16_16(dataBuffer);
		}
		break;
	case kPosition:
		getTransaction(LM_API_POS_PC, dataBuffer, &dataSize);
		if (dataSize == sizeof(INT32))
		{
			return unpackFXP16_16(dataBuffer);
		}
		break;
	case kCurrent:
		getTransaction(LM_API_ICTRL_PC, dataBuffer, &dataSize);
		if (dataSize == sizeof(INT32))
		{
			return unpackFXP16_16(dataBuffer);
		}
		break;
	}
	return 0.0;
}
double CANJaguar :: GetP ( ) { UINT8 dataBuffer [ 8 ] ; UINT8 dataSize ; switch ( m_controlMode ) { case kPercentVbus : case kVoltage : break ; case kSpeed : getTransaction ( LM_API_SPD_PC , dataBuffer , & dataSize ) ; if ( dataSize == sizeof ( INT32 ) ) { return unpackFXP16_16 ( dataBuffer ) ; } break ; case kPosition : getTransaction ( LM_API_POS_PC , dataBuffer , & dataSize ) ; if ( dataSize == sizeof ( INT32 ) ) { return unpackFXP16_16 ( dataBuffer ) ; } break ; case kCurrent : getTransaction ( LM_API_ICTRL_PC , dataBuffer , & dataSize ) ; if ( dataSize == sizeof ( INT32 ) ) { return unpackFXP16_16 ( dataBuffer ) ; } break ; } return 0.0 ; }
Get the Proportional gain of the controller.
Get the Proportional gain of the controller .
// TODO: Error, Not Valid