FmkRobotROSBridgeComp.cpp
Go to the documentation of this file.
00001 // -*- C++ -*-
00009 #include <rtm/Manager.h>
00010 #include <iostream>
00011 #include <string>
00012 #include "FmkRobotROSBridge.h"
00013 
00014 
00015 void MyModuleInit(RTC::Manager* manager)
00016 {
00017   FmkRobotROSBridgeInit(manager);
00018   RTC::RtcBase* comp;
00019 
00020   // Create a component
00021   comp = manager->createComponent("FmkRobotROSBridge");
00022 
00023 
00024   // Example
00025   // The following procedure is examples how handle RT-Components.
00026   // These should not be in this function.
00027 
00028   // Get the component's object reference
00029 //  RTC::RTObject_var rtobj;
00030 //  rtobj = RTC::RTObject::_narrow(manager->getPOA()->servant_to_reference(comp));
00031 
00032   // Get the port list of the component
00033 //  PortList* portlist;
00034 //  portlist = rtobj->get_ports();
00035 
00036   // getting port profiles
00037 //  std::cout << "Number of Ports: ";
00038 //  std::cout << portlist->length() << std::endl << std::endl; 
00039 //  for (CORBA::ULong i(0), n(portlist->length()); i < n; ++i)
00040 //  {
00041 //    Port_ptr port;
00042 //    port = (*portlist)[i];
00043 //    std::cout << "Port" << i << " (name): ";
00044 //    std::cout << port->get_port_profile()->name << std::endl;
00045 //    
00046 //    RTC::PortInterfaceProfileList iflist;
00047 //    iflist = port->get_port_profile()->interfaces;
00048 //    std::cout << "---interfaces---" << std::endl;
00049 //    for (CORBA::ULong i(0), n(iflist.length()); i < n; ++i)
00050 //    {
00051 //      std::cout << "I/F name: ";
00052 //      std::cout << iflist[i].instance_name << std::endl;
00053 //      std::cout << "I/F type: ";
00054 //      std::cout << iflist[i].type_name << std::endl;
00055 //      const char* pol;
00056 //      pol = iflist[i].polarity == 0 ? "PROVIDED" : "REQUIRED";
00057 //      std::cout << "Polarity: " << pol << std::endl;
00058 //    }
00059 //    std::cout << "---properties---" << std::endl;
00060 //    NVUtil::dump(port->get_port_profile()->properties);
00061 //    std::cout << "----------------" << std::endl << std::endl;
00062 //  }
00063 
00064   return;
00065 }
00066 
00067 int main (int argc, char** argv)
00068 {
00069   RTC::Manager* manager;
00070   manager = RTC::Manager::init(argc, argv);
00071   ros::init(argc, argv, "FmkRobotROSBridgeComp", ros::init_options::NoSigintHandler);
00072 
00073   // Initialize manager
00074   manager->init(argc, argv);
00075 
00076   // Set module initialization proceduer
00077   // This procedure will be invoked in activateManager() function.
00078   manager->setModuleInitProc(MyModuleInit);
00079 
00080   // Activate manager and register to naming service
00081   manager->activateManager();
00082 
00083   // run the manager in blocking mode
00084   // runManager(false) is the default.
00085   manager->runManager();
00086 
00087   // If you want to run the manager in non-blocking mode, do like this
00088   // manager->runManager(true);
00089 
00090   return 0;
00091 }
00092 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


fmk_ros_bridge
Author(s): Manabu Saito, Haseru Azuma
autogenerated on Thu Jun 27 2013 14:58:31