src/libYARP_dev/esdcan/linux/yarp/YARPEsdCanDeviceDriver.cpp
int YARPEsdCanDeviceDriver::getPosition (void *cmd)
{
	/// prepare can message.
	SingleAxisParameters *tmp = (SingleAxisParameters *) cmd;
	const int axis = tmp->axis;
	ACE_ASSERT (axis >= 0 && axis <= (ESD_MAX_CARDS-1)*2);

	int value;
	if (_readDWord (CAN_GET_ENCODER_POSITION, axis, value) == YARP_OK)
	{
		*((double *)tmp->parameters) = double(value);
		return YARP_OK;
	}
	
	*((double *)tmp->parameters) = 0;
	return YARP_FAIL;
}
/// cmd is a SingleAxisParameters pointer with double arg
cmd is a SingleAxisParameters pointer with double arg
cmd is a SingleAxisParameters pointer with double arg
int YARPEsdCanDeviceDriver::getPosition (void *cmd)
{
	SingleAxisParameters *tmp = (SingleAxisParameters *) cmd;
	const int axis = tmp->axis;
	ACE_ASSERT (axis >= 0 && axis <= (ESD_MAX_CARDS-1)*2);
	int value;
	if (_readDWord (CAN_GET_ENCODER_POSITION, axis, value) == YARP_OK)
	{
		*((double *)tmp->parameters) = double(value);
		return YARP_OK;
	}
	*((double *)tmp->parameters) = 0;
	return YARP_FAIL;
}
int YARPEsdCanDeviceDriver :: getPosition ( void * cmd ) { SingleAxisParameters * tmp = ( SingleAxisParameters * ) cmd ; const int axis = tmp -> axis ; ACE_ASSERT ( axis >= 0 && axis <= ( ESD_MAX_CARDS - 1 ) * 2 ) ; int value ; if ( _readDWord ( CAN_GET_ENCODER_POSITION , axis , value ) == YARP_OK ) { * ( ( double * ) tmp -> parameters ) = double ( value ) ; return YARP_OK ; } * ( ( double * ) tmp -> parameters ) = 0 ; return YARP_FAIL ; }
cmd is a SingleAxisParameters pointer with double arg
cmd is a SingleAxisParameters pointer with double arg
/// prepare can message.