00001 /* 00002 * ClientTracker.cpp 00003 * 00004 * Created on: Dec 11, 2011 00005 * Author: mriedel 00006 */ 00007 00008 #include <telekyb_base/TeleKyb.hpp> 00009 00010 #include <telekyb_base/Options.hpp> 00011 00012 #include <telekyb_vrpn/VRPNTrackerClient.hpp> 00013 #include <telekyb_vrpn/VRPNTrackerClientOptions.hpp> 00014 00015 using namespace TELEKYB_NAMESPACE; 00016 00017 int main(int argc, char **argv) { 00018 TeleKyb::init(argc,argv,"VRPNClientTracker"); 00019 00020 VRPNTrackerClientOptions* options = new VRPNTrackerClientOptions(); 00021 00022 std::vector<std::string> clientObjectNames = options->tVRPNClientObjects->getValue(); 00023 std::vector<VRPNTrackerClient*> clients(clientObjectNames.size()); 00024 00025 for (unsigned int i = 0; i < clientObjectNames.size(); ++i) { 00026 clients[i] = new VRPNTrackerClient(clientObjectNames[i]); 00027 } 00028 00029 while(ros::ok()) { 00030 for (unsigned int i = 0; i < clientObjectNames.size(); ++i) { 00031 clients[i]->spin(); 00032 } 00033 00034 usleep(10); 00035 } 00036 00037 00038 for (unsigned int i = 0; i < clientObjectNames.size(); ++i) { 00039 delete clients[i]; 00040 } 00041 00042 delete options; 00043 00044 TeleKyb::shutdown(); 00045 return EXIT_SUCCESS; 00046 } 00047 00048 00049 00050