20 #include <boost/regex.hpp> 21 #include <boost/tokenizer.hpp> 24 #include <rtm/RtcNaming.h> 25 #include <rtm/RtcConfig.h> 26 #include <rtm/RtcManager.h> 32 int main(
int argc,
char** argv)
34 RtcConfig
config(argc, argv);
38 char** _argv = config.getOrbInitArgv();
39 int _argc = config.getOrbInitArgc();
42 orb = CORBA::ORB_init(_argc, _argv);
43 cout <<
"ORB init done" << endl;
46 cout <<
"error cought" << endl;
49 naming.initNaming(orb);
50 cout <<
"Naming init done" << endl;
52 string mgrname(
".*/.*/Manager.*");
53 vector<CORBA::Object_ptr> vObj;
54 naming.findManager(mgrname, vObj);
56 cout <<
"Number of objects:" << vObj.size() << endl;
58 if (vObj.size() == 0) {
59 cout <<
"Manager could not find." << endl;
63 CORBA::Object_ptr obj = *(vObj.end()-1);
64 if (CORBA::is_nil(obj)) {
65 cout <<
"manager not found" << endl;
69 RTM::RTCManager_var mgr = RTM::RTCManager::_narrow(obj);
70 if (CORBA::is_nil(mgr)) {
71 cout <<
"manager not found" << endl;
83 if (cmd.size() > 0 && !CORBA::is_nil(mgr)) {
84 bool ret = mgr->command(cmd.c_str(), retval);
88 cout <<
"Success: " << retval << endl;
91 cout <<
"Error" << endl;
RTC::ReturnCode_t ret(RTC::Local::ReturnCode_t r)
int main(int argc, char **argv)