// Call back Declaration
ReturnType CNR_7DOFAnalyticInverseKinematicsComp::onInitialize()
{
	Property parameter;
	std::map<std::string, std::string> temp = getPropertyMap();
	parameter.SetProperty(temp);

	if(SetParameter(parameter) == false) {
		return OPROS_CALLER_ERROR;
	}

	return OPROS_SUCCESS;
}
// Call back Declaration
ReturnType KITECH_LinearTrajectoryGenerationComp::onInitialize()
{
	Property parameter;
	std::map<std::string, std::string> temp = getPropertyMap();
	parameter.SetProperty(temp);

	if(SetParameter(parameter) == false) {
		return OPROS_CALLER_ERROR;
	}

	return OPROS_SUCCESS;
}
// Call back Declaration
ReturnType KITECH_InverseDynamicsControlComp::onInitialize()
{
	Property parameter;
	std::map<std::string, std::string> temp = getPropertyMap();
	parameter.SetProperty(temp);

	if(SetParameter(parameter) == false) {
		return OPROS_CALLER_ERROR;
	}

	return OPROS_SUCCESS;
}
ReturnType KITECH_MonotoneCubicTrajectoryGenerationComp::onStart()
{
	Property parameter;
	std::map<std::string, std::string> temp = getPropertyMap();
	parameter.SetProperty(temp);

	if(SetParameter(parameter) == false) {
		return OPROS_CALLER_ERROR;
	}

	return OPROS_SUCCESS;
}
// Call back Declaration
ReturnType KitechSurfObjectRecognitionComp::onInitialize()
{
	PrintMessage ("KitechSurfObjectRecognitionComp::onInitialize()\n");

	std::map<std::string, std::string> temp = getPropertyMap();
	parameter.SetProperty(temp);
	
	if(parameter.FindName("DBName") == false) {
		PrintMessage("ERROR : KitechSurfObjectRecognitionComp::onInitialize() -> Can't find the DBName in property\n");
		return OPROS_FIND_PROPERTY_ERROR;
	}
	return OPROS_SUCCESS;
}
// Call back Declaration
ReturnType KITECH_MonteCarloLocalizationComp::onInitialize()
{
	PrintMessage ("KITECH_MonteCarloLocalizationComp::onInitialize()\n");

	parameter.SetProperty(getPropertyMap());
	if (!LoadProperty ()) {
		return OPROS_FIND_PROPERTY_ERROR;
	}

	error = 0;

	return OPROS_SUCCESS;
}
// Call back Declaration
ReturnType KITECH_OccupancyGridGlobalMapComp::onInitialize()
{
	PrintMessage ("KITECH_OccupancyGridGlobalMapComp::onInitialize()\n");

	parameter.SetProperty(getPropertyMap());
	if (!LoadProperty()) {
		error = -1;
		return OPROS_FIND_PROPERTY_ERROR;
	}

	occupancyGridMap = new OccupancyGridMap (mapWidth, mapHeight, mapResolution, 
		laserSensorCount, laserSensorStartAngle, laserSensorEndAngle, laserSensorMinimumRange, laserSensorMaximumRange);
	if (occupancyGridMap == NULL) {
		error = -1;
		return OPROS_INTERNAL_FAULT;
	}

	error = 0;

	return OPROS_SUCCESS;
}
예제 #8
0
파일: Updater.cpp 프로젝트: laizy/moose
/**
 * Initializes ICEupdater by creating the property map and setting threadCreated to false.
 * Called only from the constructors.
 *
 * @param propertyString A string formatted as a Java properties file containing name/value pairs.
 */
void Updater::initialize(std::string propertyString)
{
  // Get the map of configuration properties
  propertyMap = getPropertyMap(propertyString);

  // Set threadCreated to false
  threadCreated = false;

  // Set the ignoreSslPeerVerification flag to false by default
  ignoreSslPeerVerification = false;

  // Create an ErrorLoggerPtr object.
  errorLoggerPtr = ErrorLoggerPtr(new ErrorLogger());

  // Validate the propertyMap and store the results
  goodPropertyMap = validatePropertyMap();

  // If the propertyMap was not successfully validated,
  // dump the errors into an error file.
  if (!goodPropertyMap)
    errorLoggerPtr->dumpErrors();
}
예제 #9
0
// Call back Declaration
ReturnType GyroSensorComp::onInitialize()
{
	Property parameter;
	std::map<std::string, std::string> temp = getPropertyMap();
	parameter.SetProperty(temp);
	
	if(parameter.FindName("ApiName") == false) {
		PrintMessage("ERROR : GyroSensorComp::onInitialize() -> Can't find the APIName in property\n");
		return lastError = OPROS_FIND_PROPERTY_ERROR;
	}
	
#if defined(WIN32)
	//	DLL 로드
	hOprosAPI = LoadLibrary((LPCSTR)parameter.GetValue("ApiName").c_str());
	if(hOprosAPI == NULL) {
		PrintMessage("ERROR : GyroSensorComp::onInitialize() -> Can't find the %s\n", parameter.GetValue("ApiName").c_str());
		return lastError = OPROS_FIND_DLL_ERROR;
	}
	
	//	API 로드
	GET_OPROS_API getOprosAPI;
	getOprosAPI = (GET_OPROS_API)GetProcAddress(hOprosAPI, "GetAPI");
	if(getOprosAPI == NULL) {
		PrintMessage("ERROR : GyroSensorComp::onInitialize() -> Can't get a handle of GetAPI Funtion\n");
		FreeLibrary(hOprosAPI);
		hOprosAPI = NULL;
		return lastError = OPROS_LOAD_DLL_ERROR;
	}

	//	API Casting
	gyroSensor = dynamic_cast<GyroSensor *>(getOprosAPI());
	if(gyroSensor == NULL) {
		PrintMessage("ERROR : GyroSensorComp::onInitialize() -> Can't get a handle of AccelerationSensor API\n");
		FreeLibrary(hOprosAPI);
		hOprosAPI = NULL;
		return lastError = OPROS_LOAD_DLL_ERROR;
	}
#else
	//	Shared Library 로드
	hOprosAPI = dlopen(parameter.GetValue("ApiName").c_str(), RTLD_NOW);
	if(hOprosAPI == NULL) {
		PrintMessage("ERROR : GyroSensorComp::onInitialize() -> Can't find the %s\n", parameter.GetValue("ApiName").c_str());
		return lastError = OPROS_FIND_DLL_ERROR;
	}

	//	API 로드
	GET_OPROS_API getOprosAPI = (GET_OPROS_API)dlsym(hOprosAPI, "GetAPI");
	char *error = dlerror();
	if(error != NULL) {
		PrintMessage("ERROR : GyroSensorComp::onInitialize() -> Can't get a handle of GetAPI Funtion\n");
		dlclose(hOprosAPI);
		hOprosAPI = NULL;
		return lastError = OPROS_LOAD_DLL_ERROR;
	}
	
	//	API Casting
	gyroSensor = static_cast<GyroSensor *>(getOprosAPI());
	if(gyroSensor == NULL) {
		PrintMessage("ERROR : GyroSensorComp::onInitialize() -> Can't get a handle of AccelerationSensor API\n");
		dlclose(hOprosAPI);
		hOprosAPI = NULL;
		return lastError = OPROS_LOAD_DLL_ERROR;
	}
#endif

	if(gyroSensor->Initialize(parameter) != API_SUCCESS) {
		delete gyroSensor;
		gyroSensor = NULL;

#if defined(WIN32)
		FreeLibrary(hOprosAPI);
#else
		dlclose(hOprosAPI);
#endif
		hOprosAPI = NULL;
		return lastError = OPROS_INITIALIZE_API_ERROR;
	}

	return lastError = OPROS_SUCCESS;
}
// Call back Declaration
ReturnType KitechSkinColorFaceRecognitionComp::onInitialize()
{
	std::map<std::string, std::string> temp = getPropertyMap();
	parameter.SetProperty(temp);
	return OPROS_SUCCESS;
}
예제 #11
0
// Call back Declaration
ReturnType JoystickComp::onInitialize()
{
	//	XML에 저장된 프라퍼티를 parameter에 저장
	Property parameter;
	std::map<std::string, std::string> temp = getPropertyMap();
	parameter.SetProperty(temp);
	
	//	dll 파일이름을 확인하여 없으면 에러 리턴
	if(parameter.FindName("APIName") == false) {
		PrintMessage("ERROR : JoystickComp::onInitialize() -> Can't find the APIName in property\n");
		return OPROS_FIND_PROPERTY_ERROR;
	}

#if defined(WIN32)
	//	DLL 로드
	hOprosAPI = LoadLibrary((LPCSTR)parameter.GetValue("APIName").c_str());
	if(hOprosAPI == NULL) {
		PrintMessage("ERROR : JoystickComp::onInitialize() -> Can't find the %s\n", parameter.GetValue("APIName").c_str());
		return OPROS_FIND_DLL_ERROR;
	}
	
	//	API 로드
	GET_OPROS_API getOprosAPI;
	getOprosAPI = (GET_OPROS_API)GetProcAddress(hOprosAPI, "GetAPI");
	if(getOprosAPI == NULL) {
		PrintMessage("ERROR : JoystickComp::onInitialize() -> Can't get a handle of GetAPI Funtion\n");
		FreeLibrary(hOprosAPI);
		hOprosAPI = NULL;
		return OPROS_LOAD_DLL_ERROR;
	}
#else
	hOprosAPI = dlopen(parameter.GetValue("APIName").c_str(), RTLD_LAZY);
	if(hOprosAPI == NULL) {
		PrintMessage("ERROR : JoystickComp::onInitialize() -> Can't find the %s\n", parameter.GetValue("APIName").c_str());
		return OPROS_FIND_DLL_ERROR;
	}

	GET_OPROS_API getOprosAPI;
	getOprosAPI = (GET_OPROS_API)dlsym(hOprosAPI, "GetAPI");
	char *lastError = dlerror();
	if(lastError != NULL) {
		PrintMessage("ERROR : JoystickComp::onInitialize() -> Can't get a handle of GetAPI Funtion\n");
		dlclose(hOprosAPI);
		hOprosAPI = NULL;
		return OPROS_LOAD_DLL_ERROR;
	}
#endif
	
	joystick = static_cast<Joystick *>(getOprosAPI());
	if(joystick == NULL) {
		PrintMessage("ERROR : JoystickComp::onInitialize() -> Can't get a handle of Joystick API\n");
#if defined(WIN32)
		FreeLibrary(hOprosAPI);
#else
		dlclose(hOprosAPI);
#endif
		hOprosAPI = NULL;
		return OPROS_LOAD_DLL_ERROR;
	}

	//	API 초기화
	if(joystick->Initialize(parameter) != API_SUCCESS) {
		PrintMessage("ERROR : JoystickComp::onInitialize() -> Can't intilaize a Joystick API\n");
		
		delete joystick;
		joystick = NULL;

#if defined(WIN32)
		FreeLibrary(hOprosAPI);
#else
		dlclose(hOprosAPI);
#endif
		hOprosAPI = NULL;
		return OPROS_INITIALIZE_API_ERROR;
	}

	lastError = OPROS_SUCCESS;

	PrintMessage("SUCCESS : JoystickComp::onInitialize()\n");
	return OPROS_SUCCESS;
}
예제 #12
0
// Call back Declaration
ReturnType TCPIPComp::onInitialize()
{
	//	XML에 저장된 프라퍼티를 parameter에 저장
	Property parameter;
	std::map<std::string, std::string> temp = getPropertyMap();
	parameter.SetProperty(temp);
	
	//	dll 파일이름을 확인하여 없으면 에러 리턴
	if(parameter.FindName("APIName") == false) {
		PrintMessage("ERROR : TCPIPComp::onInitialize() -> Can't find the APIName in property\n");
		return OPROS_FIND_PROPERTY_ERROR;
	}

#if defined(WIN32)
	//	Load a DLL
	hOprosAPI = LoadLibrary((LPCSTR)parameter.GetValue("APIName").c_str());
	if(hOprosAPI == NULL) {
		PrintMessage("ERROR : TCPIPComp::onInitialize() -> Can't find the %s\n", parameter.GetValue("APIName").c_str());
		return OPROS_FIND_DLL_ERROR;
	}
	
	//	Load a API
	GET_OPROS_API getOprosAPI;
	getOprosAPI = (GET_OPROS_API)GetProcAddress(hOprosAPI, "GetAPI");
	if(getOprosAPI == NULL) {
		PrintMessage("ERROR : TCPIPComp::onInitialize() -> Can't get a handle of GetAPI Funtion\n");
		FreeLibrary(hOprosAPI);
		hOprosAPI = NULL;
		return OPROS_LOAD_DLL_ERROR;
	}
#else
	//	Load a shared library
	hOprosAPI = dlopen(parameter.GetValue("DllName").c_str(), RTLD_LAZY);
	if(hOprosAPI == NULL) {
		PrintMessage("ERROR : TCPIPComp::onInitialize() -> Can't find the %s\n", parameter.GetValue("DllName").c_str());
		return OPROS_FIND_DLL_ERROR;
	}

	//	Load a API
	GET_OPROS_API getOprosAPI;
	getOprosAPI = (GET_OPROS_API)dlsym(hOprosAPI, "GetAPI");
	char *error = dlerror();
	if(error != NULL) {
		PrintMessage("ERROR : TCPIPComp::onInitialize() -> Can't get a handle of GetAPI Funtion\n");
		dlclose(hOprosAPI);
		hOprosAPI = NULL;
		return OPROS_LOAD_DLL_ERROR;
	}
#endif
	
	tcpip = dynamic_cast<TCPIP *>(getOprosAPI());
	if(tcpip == NULL) {
		PrintMessage("ERROR : TCPIPComp::onInitialize() -> Can't get a handle of TCPIP API\n");
#if defined(WIN32)
		FreeLibrary(hOprosAPI);
#else
		dlclose(hOprosAPI);
#endif
		hOprosAPI = NULL;
		return OPROS_LOAD_DLL_ERROR;
	}

	if(tcpip->Initialize(parameter) != API_SUCCESS) {
		PrintMessage("ERROR : TCPIPComp::onInitialize() -> Can't initialize a TCPIP API\n");
		delete tcpip;
		tcpip = NULL;

#if defined(WIN32)
		FreeLibrary(hOprosAPI);
#else
		dlclose(hOprosAPI);
#endif
		hOprosAPI = NULL;
		return OPROS_INITIALIZE_API_ERROR;
	}

	error = 0;

	return OPROS_SUCCESS;
}
예제 #13
0
// Call back Declaration
ReturnType KinectComp::onInitialize()
{
	//	XML에 저장된 프라퍼티를 parameter에 저장	
	std::map<std::string, std::string>& propertyMap = getPropertyMap();
	Property parameter;
	parameter.SetProperty(propertyMap);

	//	dll 파일이름을 확인하여 없으면 에러 리턴
	if (parameter.FindName("APIName") == false)
	{
		PrintMessage(DEBUG_MESSAGE("Can't find the APIName in property").c_str());
		return OPROS_FIND_PROPERTY_ERROR;
	}

	//DLL 로드
	mhOprosAPI = LoadLibrary((LPCSTR)parameter.GetValue("APIName").c_str());
	if (mhOprosAPI == NULL)
	{
		PrintMessage(DEBUG_MESSAGE("Can't get a handle of GetAPI Funtion").c_str());
		PrintMessage(DEBUG_MESSAGE("Can't get a DLL").c_str());

		return OPROS_FIND_DLL_ERROR;
	}

	//API 로드
	GET_OPROS_API getOprosAPI = (GET_OPROS_API)GetProcAddress(mhOprosAPI, "GetAPI");
	if (getOprosAPI == NULL)
	{
		PrintMessage(DEBUG_MESSAGE("Can't get a handle of GetAPI Funtion").c_str());
		PrintMessage(DEBUG_MESSAGE("Can't load API").c_str());

		FreeLibrary(mhOprosAPI);
		mhOprosAPI = NULL;

		return OPROS_LOAD_DLL_ERROR;
	}

	mpKinect = dynamic_cast<Kinect *>(getOprosAPI());
	if(mpKinect == NULL)
	{
		PrintMessage(DEBUG_MESSAGE("Can't get a handle of Kinect API").c_str());
		PrintMessage(DEBUG_MESSAGE("Can't get a Casting").c_str());

		FreeLibrary(mhOprosAPI);
		mhOprosAPI = NULL;

		return OPROS_LOAD_DLL_ERROR;
	}

	//API 초기화
	if(mpKinect->Initialize(parameter) != API_SUCCESS)
	{
		PrintMessage(DEBUG_MESSAGE("Can't initialize a Kinect API").c_str());

		delete mpKinect;
		mpKinect = NULL;

		FreeLibrary(mhOprosAPI);
		mhOprosAPI = NULL;

		return OPROS_INITIALIZE_API_ERROR;
	}

	return OPROS_SUCCESS;
}