code/WPILib/CANJaguar.cpp
/**
 * Set the output set-point value.  
 * 
 * The scale and the units depend on the mode the Jaguar is in.
 * In PercentVbus Mode, the outputValue is from -1.0 to 1.0 (same as PWM Jaguar).
 * In Voltage Mode, the outputValue is in Volts.
 * In Current Mode, the outputValue is in Amps.
 * In Speed Mode, the outputValue is in Rotations/Minute.
 * In Position Mode, the outputValue is in Rotations.
 * 
 * @param outputValue The set-point to sent to the motor controller.
 * @param syncGroup The update group to add this Set() to, pending UpdateSyncGroup().  If 0, update immediately.
 */
Set the output set-point value.

The scale and the units depend on the mode the Jaguar is in.
In PercentVbus Mode, the outputValue is from -1.0 to 1.0 (same as PWM Jaguar).
In Voltage Mode, the outputValue is in Volts.
In Current Mode, the outputValue is in Amps.
In Speed Mode, the outputValue is in Rotations/Minute.
In Position Mode, the outputValue is in Rotations.

@param outputValue The set-point to sent to the motor controller.
@param syncGroup The update group to add this Set() to, pending UpdateSyncGroup().  If 0, update immediately.
Set the output set - point value . The scale and the units depend on the mode the Jaguar is in . In PercentVbus Mode the outputValue is from - 1 . 0 to 1 . 0 ( same as PWM Jaguar ) . In Voltage Mode the outputValue is in Volts . In Current Mode the outputValue is in Amps . In Speed Mode the outputValue is in Rotations / Minute . In Position Mode the outputValue is in Rotations . @param outputValue The set - point to sent to the motor controller . @param syncGroup The update group to add this Set () to pending UpdateSyncGroup () . If 0 update immediately .
void CANJaguar::Set(float outputValue, UINT8 syncGroup)
{
	UINT32 messageID;
	UINT8 dataBuffer[8];
	UINT8 dataSize;
	if (m_safetyHelper && !m_safetyHelper->IsAlive())
	{
		EnableControl();
	}
	switch(m_controlMode)
	{
	case kPercentVbus:
		{
			messageID = LM_API_VOLT_T_SET;
			if (outputValue > 1.0) outputValue = 1.0;
			if (outputValue < -1.0) outputValue = -1.0;
			dataSize = packPercentage(dataBuffer, outputValue);
		}
		break;
	case kSpeed:
		{
			messageID = LM_API_SPD_T_SET;
			dataSize = packFXP16_16(dataBuffer, outputValue);
		}
		break;
	case kPosition:
		{
			messageID = LM_API_POS_T_SET;
			dataSize = packFXP16_16(dataBuffer, outputValue);
		}
		break;
	case kCurrent:
		{
			messageID = LM_API_ICTRL_T_SET;
			dataSize = packFXP8_8(dataBuffer, outputValue);
		}
		break;
	case kVoltage:
		{
			messageID = LM_API_VCOMP_T_SET;
			dataSize = packFXP8_8(dataBuffer, outputValue);
		}
		break;
	default:
		return;
	}
	if (syncGroup != 0)
	{
		dataBuffer[dataSize] = syncGroup;
		dataSize++;
	}
	setTransaction(messageID, dataBuffer, dataSize);
	if (m_safetyHelper) m_safetyHelper->Feed();
}
void CANJaguar :: Set ( float outputValue , UINT8 syncGroup ) { UINT32 messageID ; UINT8 dataBuffer [ 8 ] ; UINT8 dataSize ; if ( m_safetyHelper && ! m_safetyHelper -> IsAlive ( ) ) { EnableControl ( ) ; } switch ( m_controlMode ) { case kPercentVbus : { messageID = LM_API_VOLT_T_SET ; if ( outputValue > 1.0 ) outputValue = 1.0 ; if ( outputValue < -1.0 ) outputValue = -1.0 ; dataSize = packPercentage ( dataBuffer , outputValue ) ; } break ; case kSpeed : { messageID = LM_API_SPD_T_SET ; dataSize = packFXP16_16 ( dataBuffer , outputValue ) ; } break ; case kPosition : { messageID = LM_API_POS_T_SET ; dataSize = packFXP16_16 ( dataBuffer , outputValue ) ; } break ; case kCurrent : { messageID = LM_API_ICTRL_T_SET ; dataSize = packFXP8_8 ( dataBuffer , outputValue ) ; } break ; case kVoltage : { messageID = LM_API_VCOMP_T_SET ; dataSize = packFXP8_8 ( dataBuffer , outputValue ) ; } break ; default : return ; } if ( syncGroup != 0 ) { dataBuffer [ dataSize ] = syncGroup ; dataSize ++ ; } setTransaction ( messageID , dataBuffer , dataSize ) ; if ( m_safetyHelper ) m_safetyHelper -> Feed ( ) ; }
Set the output set-point value.
Set the output set - point value .