#define _MAIN_ #include "fanuc_control.h" int main (int argc, char* argv[]) { int result; /** Checks the return value from the function check_for_input(argc,argv); If the result == -1, then, the node will shutdown **/ // this function will check for terminal arguments // result = check_for_input(argc,argv); if(result == -1) return 0; ros::init(argc , argv , "fanuc_control"); ros::NodeHandle n; ros::Publisher fanuc_cart = n.advertise("fanuc_cart", 1000); ros::Publisher fanuc_joint = n.advertise("fanuc_joint", 1000); ros::Rate loop_rate(20); dataReceiver data; try { boost::asio::io_service io_service; tcp::resolver resolver(io_service); tcp::resolver::query query(Global_IP,Global_Port); tcp::resolver::iterator iterator = resolver.resolve(query); // Communication Initiation // // robotCom c(io_service, iterator); // Necessary in included file!! #include "fanuc.cpp" }catch (std::exception& e) { std::cerr << "Exception: " << e.what() << "\n"; } while(ros::ok()) ros::spinOnce(); return 0; } string Int2Str(int a) { ostringstream temp; temp< fields, final; string tmp1 = "", result = ""; bool comma = false; // Rearranges the string for the first time (substitues " " for ", ") // split( fields, tmp, boost::is_any_of( " " ) ); for(size_t i=0; i