Go to the documentation of this file.00001 
00019 #include <stdlib.h>
00020 #include <string>
00021 #include <iostream>
00022 #include <sicktoolbox/SickLD.hh>
00023 
00024 using namespace std;
00025 using namespace SickToolbox;
00026 
00027 int main (int argc, char *argv[]) {
00028 
00029   
00030   string sick_ip_addr(DEFAULT_SICK_IP_ADDRESS);
00031 
00032   
00033   if(argc > 2 || (argc == 2 && strcasecmp(argv[1],"--help") == 0)) {
00034     cerr << "Usage: ld_more_config [SICK IP ADDRESS]" << endl
00035               << "Ex. ld_more_config 192.168.1.11" << endl;
00036     return -1;
00037   }
00038   
00039   
00040   if(argc == 2) {
00041     sick_ip_addr = argv[1];
00042   }
00043   
00044   
00045   SickLD sick_ld(sick_ip_addr);
00046 
00047   
00048 
00049 
00050   try {
00051     sick_ld.Initialize();
00052   }
00053 
00054   catch(...) {
00055     cerr << "Initialize failed! Are you using the correct IP address?" << endl;
00056     return -1;
00057   }
00058   
00059   try {
00060   
00061     
00062     
00063     
00064     
00065     
00066     
00067     
00068     
00069     
00070     
00071     
00072     
00073     
00074     
00075     
00076     
00077     
00078     
00079     
00080     
00081     
00082     
00083     
00084     
00085     
00086     
00087     
00088     
00089     
00090     
00091     
00092   }
00093 
00094   catch(...) {
00095     cerr << "An error occurred!" << endl;
00096   }
00097 
00098   
00099 
00100 
00101   try {
00102     sick_ld.Uninitialize();
00103   }
00104   
00105   catch(...) {
00106     cerr << "Uninitialize failed!" << endl;
00107     return -1;
00108   }
00109     
00110   
00111   return 0;
00112 
00113 }