26 #pragma comment(lib, "Shlwapi.lib") 29 #if defined (__linux) || defined (__APPLE__) 32 #define _stricmp(x,y) strcasecmp(x,y) 35 #define PLUGIN_VERSION 1 40 #define CONCAT(x,y,z) x y z 41 #define strConCat(x,y,z) CONCAT(x,y,z) 42 #define LUA_GET_SENSOR_DATA_COMMAND "simExtSkeleton_getSensorData" 69 std::string
LUA_SIM_EXT_HAND_EYE_CALIB_START_CALL_TIP(
"number result=simExtHandEyeCalibStart(string RobotBaseName , string RobotTipName, string OpticalTrackerBaseName, string OpticalTrackerDetectedObjectName) -- KukaCommandMode options are JAVA and FRI");
76 BOOST_LOG_TRIVIAL(info) <<
"v_repExtHandEyeCalibration Starting Hand Eye Calibration Plugin Data Collection\n";
82 std::vector<CLuaFunctionDataItem>* inData=data.
getInDataPtr();
83 std::string RobotBaseName((inData->at(0 ).stringData[0]));
84 std::string RobotTipName((inData->at(1 ).stringData[0]));
85 std::string OpticalTrackerBaseName((inData->at(2 ).stringData[0]));
86 std::string OpticalTrackerDetectedObjectName(inData->at(3 ).stringData[0]);
88 std::make_tuple(RobotBaseName , RobotTipName, OpticalTrackerBaseName, OpticalTrackerDetectedObjectName)
91 handEyeCalibrationPG->construct();
104 BOOST_LOG_TRIVIAL(info) <<
"v_repExtHandEyeCalibration Starting Hand Eye Calibration Plugin Data Collection\n";
112 BOOST_LOG_TRIVIAL(info) <<
"Ending v_repExtHandEyeCalibration plugin\n";
157 VREP_DLLEXPORT
unsigned char v_repStart(
void* reservedPointer,
int reservedInt)
162 char curDirAndFile[1024];
164 GetModuleFileName(NULL,curDirAndFile,1023);
165 PathRemoveFileSpec(curDirAndFile);
166 #elif defined (__linux) || defined (__APPLE__) 167 getcwd(curDirAndFile,
sizeof(curDirAndFile));
169 std::string currentDirAndPath(curDirAndFile);
171 std::string temp(currentDirAndPath);
174 #elif defined (__linux) 175 temp+=
"/libv_rep.so";
176 #elif defined (__APPLE__) 177 temp+=
"/libv_rep.dylib";
183 BOOST_LOG_TRIVIAL(error) <<
"Error, could not find or correctly load the V-REP library. Cannot start 'PluginSkeleton' plugin.\n";
188 BOOST_LOG_TRIVIAL(error) <<
"Error, could not find all required functions in the V-REP library. Cannot start 'PluginSkeleton' plugin.\n";
200 BOOST_LOG_TRIVIAL(error) <<
"Sorry, your V-REP copy is somewhat old. Cannot start 'PluginSkeleton' plugin.\n";
219 BOOST_LOG_TRIVIAL(info) <<
"Hand Eye Calibration plugin initialized. Build date/time: " << __DATE__ <<
" " << __TIME__ <<
"\n";
240 VREP_DLLEXPORT
void*
v_repMessage(
int message,
int* auxiliaryData,
void* customData,
int* replyData)
243 static bool refreshDlgFlag=
true;
266 int flags=auxiliaryData[0];
267 bool sceneContentChanged=((flags&(1+2+4+8+16+32+64+256))!=0);
268 bool instanceSwitched=((flags&64)!=0);
270 if (instanceSwitched)
275 if (sceneContentChanged)
328 }
catch (boost::exception& e){
330 std::string initerr(
"v_repExtHandEyeCalibration plugin initialization error:\n" + boost::diagnostic_information(e));
332 BOOST_LOG_TRIVIAL(error) << initerr;
348 if ( (customData==NULL)||(_stricmp(
"PluginSkeleton",(
char*)customData)==0) )
356 if ( (customData==NULL)||(_stricmp(
"PluginSkeleton",(
char*)customData)==0) )
364 if ( (customData==NULL)||(_stricmp(
"PluginSkeleton",(
char*)customData)==0) )
393 refreshDlgFlag=
false;
std::shared_ptr< grl::HandEyeCalibrationVrepPlugin > handEyeCalibrationPG
void LUA_SIM_EXT_HAND_EYE_CALIB_ADD_FRAME(SLuaCallBack *p)
int getVrepProcAddresses(LIBRARY lib)
LIBRARY loadVrepLibrary(const char *pathAndFilename)
VREP_DLLEXPORT void v_repEnd()
bool readDataFromLua(const SLuaCallBack *p, const int *expectedArguments, int requiredArgumentCount, const char *functionName)
void LUA_SIM_EXT_HAND_EYE_CALIB_STOP(SLuaCallBack *p)
void LUA_SIM_EXT_HAND_EYE_CALIB_GET_TRANSFORM(SLuaCallBack *p)
void LUA_SIM_EXT_HAND_EYE_CALIB_RESTORE_SENSOR_POSITION(SLuaCallBack *p)
ptrSimSetIntegerParameter simSetIntegerParameter
VREP_DLLEXPORT void * v_repMessage(int message, int *auxiliaryData, void *customData, int *replyData)
std::string LUA_SIM_EXT_HAND_EYE_CALIB_START_CALL_TIP("number result=simExtHandEyeCalibStart(string RobotBaseName , string RobotTipName, string OpticalTrackerBaseName, string OpticalTrackerDetectedObjectName) -- KukaCommandMode options are JAVA and FRI")
void LUA_SIM_EXT_HAND_EYE_CALIB_START(SLuaCallBack *p)
void LUA_SIM_EXT_HAND_EYE_CALIB_APPLY_TRANSFORM(SLuaCallBack *p)
ptrSimGetIntegerParameter simGetIntegerParameter
void unloadVrepLibrary(LIBRARY lib)
VREP_DLLEXPORT unsigned char v_repStart(void *reservedPointer, int reservedInt)
void LUA_SIM_EXT_HAND_EYE_CALIB_RESET(SLuaCallBack *p)
ptrSimRegisterCustomLuaFunction simRegisterCustomLuaFunction
const int inArgs_HAND_EYE_CALIB_START[]
void LUA_SIM_EXT_HAND_EYE_CALIB_FIND_TRANSFORM(SLuaCallBack *p)
ptrSimGetSimulationState simGetSimulationState
std::vector< CLuaFunctionDataItem > * getInDataPtr()
ptrSimAddStatusbarMessage simAddStatusbarMessage