src/libYARP_dev/esdcan/linux/yarp/YARPEsdCanDeviceDriver.cpp
int YARPEsdCanDeviceDriver::getPid (void *cmd)
{
	SingleAxisParameters *tmp = (SingleAxisParameters *) cmd;
	const int axis = tmp->axis;
	ACE_ASSERT (axis >= 0 && axis <= (ESD_MAX_CARDS-1)*2);
	LowLevelPID *pid = (LowLevelPID *) tmp->parameters;
	short s;

	_readWord16 (CAN_GET_P_GAIN, axis, s); pid->KP = double(s);
	_readWord16 (CAN_GET_D_GAIN, axis, s); pid->KD = double(s);
	_readWord16 (CAN_GET_I_GAIN, axis, s); pid->KI = double(s);
	_readWord16 (CAN_GET_ILIM_GAIN, axis, s); pid->I_LIMIT = double(s);
	_readWord16 (CAN_GET_OFFSET, axis, s); pid->OFFSET = double(s);
	_readWord16 (CAN_GET_SCALE, axis, s); pid->SHIFT = double(s);
	_readWord16 (CAN_GET_TLIM, axis, s); pid->T_LIMIT = double(s);

	return YARP_OK;
}
/// cmd is a SingleAxis pointer with a LowLevelPID argument pointer
cmd is a SingleAxis pointer with a LowLevelPID argument pointer
cmd is a SingleAxis pointer with a LowLevelPID argument pointer
int YARPEsdCanDeviceDriver::getPid (void *cmd)
{
	SingleAxisParameters *tmp = (SingleAxisParameters *) cmd;
	const int axis = tmp->axis;
	ACE_ASSERT (axis >= 0 && axis <= (ESD_MAX_CARDS-1)*2);
	LowLevelPID *pid = (LowLevelPID *) tmp->parameters;
	short s;
	_readWord16 (CAN_GET_P_GAIN, axis, s); pid->KP = double(s);
	_readWord16 (CAN_GET_D_GAIN, axis, s); pid->KD = double(s);
	_readWord16 (CAN_GET_I_GAIN, axis, s); pid->KI = double(s);
	_readWord16 (CAN_GET_ILIM_GAIN, axis, s); pid->I_LIMIT = double(s);
	_readWord16 (CAN_GET_OFFSET, axis, s); pid->OFFSET = double(s);
	_readWord16 (CAN_GET_SCALE, axis, s); pid->SHIFT = double(s);
	_readWord16 (CAN_GET_TLIM, axis, s); pid->T_LIMIT = double(s);
	return YARP_OK;
}
int YARPEsdCanDeviceDriver :: getPid ( void * cmd ) { SingleAxisParameters * tmp = ( SingleAxisParameters * ) cmd ; const int axis = tmp -> axis ; ACE_ASSERT ( axis >= 0 && axis <= ( ESD_MAX_CARDS - 1 ) * 2 ) ; LowLevelPID * pid = ( LowLevelPID * ) tmp -> parameters ; short s ; _readWord16 ( CAN_GET_P_GAIN , axis , s ) ; pid -> KP = double ( s ) ; _readWord16 ( CAN_GET_D_GAIN , axis , s ) ; pid -> KD = double ( s ) ; _readWord16 ( CAN_GET_I_GAIN , axis , s ) ; pid -> KI = double ( s ) ; _readWord16 ( CAN_GET_ILIM_GAIN , axis , s ) ; pid -> I_LIMIT = double ( s ) ; _readWord16 ( CAN_GET_OFFSET , axis , s ) ; pid -> OFFSET = double ( s ) ; _readWord16 ( CAN_GET_SCALE , axis , s ) ; pid -> SHIFT = double ( s ) ; _readWord16 ( CAN_GET_TLIM , axis , s ) ; pid -> T_LIMIT = double ( s ) ; return YARP_OK ; }
cmd is a SingleAxis pointer with a LowLevelPID argument pointer
cmd is a SingleAxis pointer with a LowLevelPID argument pointer