Go to the documentation of this file.00001
00071 #include <stdio.h>
00072 #include <stdlib.h>
00073 #include <string.h>
00074
00075 #include "sick_scan/sick_generic_laser.h"
00076 #include "sick_scan/sick_generic_imu.h"
00077 #include "sick_scan/binScanf.hpp"
00078 #include "sick_scan/binPrintf.hpp"
00079 #include "sick_scan/dataDumper.h"
00080
00081 #ifdef _MSC_VER
00082 #include "sick_scan/rosconsole_simu.hpp"
00083 #endif
00084
00085 #define MAX_NAME_LEN (1024)
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107 #define SICK_GENERIC_MAJOR_VER "001"
00108 #define SICK_GENERIC_MINOR_VER "003"
00109 #define SICK_GENERIC_PATCH_LEVEL "020"
00110
00111 #include <algorithm>
00112
00113
00114
00115
00116 std::string getVersionInfo();
00127 int main(int argc, char **argv)
00128 {
00129
00130
00131 DataDumper::instance().writeToFileNameWhenBufferIsFull("/tmp/sickscan_debug.csv");
00132 char nameId[] = "__name:=";
00133 char nameVal[MAX_NAME_LEN] = { 0 };
00134 char **argv_tmp;
00135 int argc_tmp;
00136 std::string scannerName = "????";
00137
00138
00139
00140 argc_tmp = argc;
00141 argv_tmp = argv;
00142
00143 const int MAX_STR_LEN = 1024;
00144 char nameTagVal[MAX_STR_LEN] = { 0 };
00145 char logTagVal[MAX_STR_LEN] = { 0 };
00146 char internalDebugTagVal[MAX_STR_LEN] = { 0 };
00147 char sensorEmulVal[MAX_STR_LEN] = { 0 };
00148
00149 if (argc == 1)
00150 {
00151
00152
00153 strcpy(nameTagVal, "__name:=sick_tim_5xx");
00154 strcpy(logTagVal, "__log:=/tmp/tmp.log");
00155 strcpy(internalDebugTagVal, "__internalDebug:=1");
00156
00157 strcpy(sensorEmulVal, "__emulSensor:=0");
00158 argc_tmp = 5;
00159 argv_tmp = (char **)malloc(sizeof(char *) * argc_tmp);
00160
00161 argv_tmp[0] = argv[0];
00162 argv_tmp[1] = nameTagVal;
00163 argv_tmp[2] = logTagVal;
00164 argv_tmp[3] = internalDebugTagVal;
00165 argv_tmp[4] = sensorEmulVal;
00166
00167 }
00168
00169 std::string versionInfo = "sick_generic_caller V. ";
00170 versionInfo += std::string(SICK_GENERIC_MAJOR_VER) + '.';
00171 versionInfo += std::string(SICK_GENERIC_MINOR_VER) + '.';
00172 versionInfo += std::string(SICK_GENERIC_PATCH_LEVEL);
00173
00174 setVersionInfo(versionInfo);
00175 ROS_INFO("%s", versionInfo.c_str());
00176 for (int i = 0; i < argc_tmp; i++)
00177 {
00178 if (strstr(argv_tmp[i], nameId) == argv_tmp[i])
00179 {
00180 strcpy(nameVal, argv_tmp[i] + strlen(nameId));
00181 scannerName = nameVal;
00182 }
00183 ROS_INFO("Program arguments: %s", argv_tmp[i]);
00184 }
00185
00186 int result = mainGenericLaser(argc_tmp, argv_tmp, scannerName);
00187 return result;
00188
00189 }