本文整理汇总了C++中rtc::Manager类的典型用法代码示例。如果您正苦于以下问题:C++ Manager类的具体用法?C++ Manager怎么用?C++ Manager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Manager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main (int argc, char** argv)
{
RTC::Manager* manager;
manager = RTC::Manager::init(argc, argv);
ros::init(argc, argv, "ImageSensorROSBridgeComp", ros::init_options::NoSigintHandler);
// Initialize manager
manager->init(argc, argv);
// Set module initialization proceduer
// This procedure will be invoked in activateManager() function.
manager->setModuleInitProc(MyModuleInit);
// Activate manager and register to naming service
manager->activateManager();
// run the manager in blocking mode
// runManager(false) is the default.
manager->runManager();
// If you want to run the manager in non-blocking mode, do like this
// manager->runManager(true);
return 0;
}
示例2: main
int main (int argc, char** argv)
{
if(!mclInitializeApplication(NULL,0))
{
std::cerr << "アプリケーションを初期化できません" << std::endl;
mclGetLastErrorMessage();
return -1;
}
RTC::Manager* manager;
manager = RTC::Manager::init(argc, argv);
// Initialize manager
manager->init(argc, argv);
// Set module initialization proceduer
// This procedure will be invoked in activateManager() function.
manager->setModuleInitProc(MyModuleInit);
// Activate manager and register to naming service
manager->activateManager();
// run the manager in blocking mode
// runManager(false) is the default.
manager->runManager();
// If you want to run the manager in non-blocking mode, do like this
// manager->runManager(true);
mclTerminateApplication();
return 0;
}
示例3: main
int main (int argc, char** argv)
{
RTC::Manager* manager;
manager = RTC::Manager::init(argc, argv);
// Initialize manager
manager->init(argc, argv);
// Set module initialization proceduer
// This procedure will be invoked in activateManager() function.
manager->setModuleInitProc(MyModuleInit);
// Activate manager and register to naming service
manager->activateManager();
// run the manager in blocking mode
// runManager(false) is the default.
// manager->runManager();
// If you want to run the manager in non-blocking mode, do like this
manager->runManager(true);
system(SKYPEKIT_PATH);
return 0;
}
示例4: main
int main (int argc, char** argv)
{
RTC::Manager* manager;
manager = RTC::Manager::init(argc, argv);
// Initialize manager
manager->init(argc, argv);
// Set module initialization proceduer
// This procedure will be invoked in activateManager() function.
manager->setModuleInitProc(MyModuleInit);
// Activate manager and register to naming service
manager->activateManager();
// run the manager in blocking mode
// runManager(false) is the default.
manager->runManager(true);
QApplication app( argc, argv );
MainWindow *mainWindow = new MainWindow();
mainWindow->resize( 600, 400 );
mainWindow->show();
return app.exec();
// If you want to run the manager in non-blocking mode, do like this
// manager->runManager(true);
return 0;
}
示例5: initializeOpenHRPModel
int initializeOpenHRPModel (char* _filename)
{
int rtmargc=0;
char** argv=NULL;
//std::vector<char *> rtmargv;
//rtmargv.push_back(argv[0]);
rtmargc++;
RTC::Manager* manager;
//manager = RTC::Manager::init(rtmargc, rtmargv.data());
manager = RTC::Manager::init(rtmargc, argv);
std::string nameServer = manager->getConfig()["corba.nameservers"];
int comPos = nameServer.find(",");
if (comPos < 0){
comPos = nameServer.length();
}
nameServer = nameServer.substr(0, comPos);
RTC::CorbaNaming naming(manager->getORB(), nameServer.c_str());
std::string filename(_filename);
if (!loadBodyFromModelLoader(m_robot, filename.c_str(),
CosNaming::NamingContext::_duplicate(naming.getRootContext()),
true)){
std::cerr << print_prefix << " Failed to load model[" << filename << "]" << std::endl;
return 1;
} else {
std::cerr << print_prefix << " Success to load model[" << filename << "]" << std::endl;
}
return 0;
};
示例6: main
int main (int argc, char** argv)
{
RTC::Manager* manager;
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
manager = RTC::Manager::init(argc, argv);
// Initialize manager
manager->init(argc, argv);
// Set module initialization proceduer
// This procedure will be invoked in activateManager() function.
manager->setModuleInitProc(MyModuleInit);
// Activate manager and register to naming service
manager->activateManager();
// run the manager in blocking mode
// runManager(false) is the default.
manager->runManager();
// If you want to run the manager in non-blocking mode, do like this
// manager->runManager(true);
return 0;
}
示例7: main
int main (int argc, char** argv)
{
RTC::Manager* manager;
manager = RTC::Manager::init(argc, argv);
manager->init(argc, argv);
manager->setModuleInitProc(MyModuleInit);
manager->activateManager();
manager->runManager();
return 0;
}
示例8: clear
void Simulator::clear()
{
RTC::Manager* manager = &RTC::Manager::instance();
for (unsigned int i=0; i<numBodies(); i++){
BodyRTC *bodyrtc = dynamic_cast<BodyRTC *>(body(i).get());
bodyrtc->exit();
}
manager->cleanupComponents();
clearBodies();
constraintForceSolver.clearCollisionCheckLinkPairs();
setCurrentTime(0.0);
pairs.clear();
receivers.clear();
}
示例9: main
int main (int argc, char** argv)
{
RTC::Manager* manager;
manager = RTC::Manager::init(argc, argv);
// Initialize manager
manager->init(argc, argv);
#ifdef _WINDOWS
std::string path = getParam("manager.modules.load_path");
coil::eraseBlank(path);
coil::vstring pathList = coil::split(path, ",");
for (int i = 0; i < pathList.size(); i++)
{
std::string filepath = pathList[i];
char szFullPath[MAX_PATH];
_fullpath(szFullPath, filepath.c_str(), sizeof(szFullPath) / sizeof(szFullPath[0]));
std::string path = "PATH=";
path += getenv("PATH");
path += ";";
path += szFullPath;
putenv(path.c_str());
}
#endif
// Set module initialization proceduer
// This procedure will be invoked in activateManager() function.
manager->setModuleInitProc(MyModuleInit);
// Activate manager and register to naming service
manager->activateManager();
// run the manager in blocking mode
// runManager(false) is the default.
manager->runManager();
// If you want to run the manager in non-blocking mode, do like this
// manager->runManager(true);
return 0;
}
示例10: main
int main(int argc, char* argv[])
{
int ret = 0;
RTC::Manager* rtcManager;
try {
unsigned int i;
int rtc_argc = 1;
char** rtc_argv = (char **)malloc(sizeof(char *)*argc);
rtc_argv[0] = argv[0];
for (i=1; i<argc; i++){
if (strncmp(argv[i], "--", 2)!=0 ) {
rtc_argv[rtc_argc] = argv[i];
rtc_argc++;
}else {
i++;
}
}
rtcManager = RTC::Manager::init(rtc_argc, rtc_argv);
rtcManager->activateManager();
}
catch(...) {
cerr << "Cannot initialize OpenRTM" << endl;
exit(1);
}
BridgeConf* bridgeConf;
try {
bridgeConf = BridgeConf::initialize(argc, argv);
} catch (std::exception& ex) {
cerr << argv[0] << ": " << ex.what() << endl;
exit(1);
}
if(bridgeConf->isReady()){
if(setup(rtcManager, bridgeConf)){
cout << "ready" << endl;
rtcManager->runManager();
} else {
ret = 1;
}
}
return ret;
}
示例11: main
int main (int argc, char** argv)
{
RTC::Manager* manager;
#if defined(__linux)
Gtk::Main kit(argc, argv);
DialogWin dialogwin;
Gtk::Main::run( dialogwin );
#elif defined(_WIN32)
//HINSTANCE hInst = GetModuleHandle( NULL );
HWND hwnd = GetWindow( NULL, GW_OWNER );
OpenDiaog(hwnd,"Wave Files(*.wav)\0*.wav\0All Files(*.*)\0*.*\0\0",
WaveFileName,OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY);
printf("Wave File Name:%s\n", WaveFileName);
#endif
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
manager = RTC::Manager::init(argc, argv);
// Initialize manager
manager->init(argc, argv);
// Set module initialization proceduer
// This procedure will be invoked in activateManager() function.
manager->setModuleInitProc(MyModuleInit);
// Activate manager and register to naming service
manager->activateManager();
// run the manager in blocking mode
// runManager(false) is the default.
manager->runManager();
// If you want to run the manager in non-blocking mode, do like this
// manager->runManager(true);
return 0;
}
示例12: addShapeFromFile
void PyLink::addShapeFromFile(std::string url)
{
RTC::Manager* manager = &RTC::Manager::instance();
std::string nameServer = manager->getConfig()["corba.nameservers"];
int comPos = nameServer.find(",");
if (comPos < 0){
comPos = nameServer.length();
}
nameServer = nameServer.substr(0, comPos);
RTC::CorbaNaming naming(manager->getORB(), nameServer.c_str());
OpenHRP::ModelLoader_var modelloader = hrp::getModelLoader(CosNaming::NamingContext::_duplicate(naming.getRootContext()));
OpenHRP::ModelLoader::ModelLoadOption opt;
opt.readImage = true;
opt.AABBdata.length(0);
opt.AABBtype = OpenHRP::ModelLoader::AABB_NUM;
OpenHRP::BodyInfo_var binfo = modelloader->getBodyInfoEx(url.c_str(), opt);
OpenHRP::LinkInfoSequence_var lis = binfo->links();
loadShapeFromLinkInfo(this, lis[0], binfo, createPyShape);
}
示例13: getManagerAddress
NameServerInfo RTCCommonUtil::getManagerAddress()
{
NameServerInfo result;
RTC::Manager* rtcManager = &RTC::Manager::instance();
if (!rtcManager) return result;
coil::Properties prop = rtcManager->getConfig();
std::string val = prop.getProperty("corba.nameservers");
DDEBUG_V("RTCCommonUtil::getManagerAddress: %s", val.c_str());
vector<string> elems = RTCCommonUtil::split(val, ':');
if (elems.size() == 0) return result;
result.hostAddress = elems[0];
result.portNo = 2809;
if (1 < elems.size()) {
result.portNo = QString::fromStdString(elems[1]).toInt();
}
result.isRtmDefaultNameServer = true;
return result;
}
示例14: main
int main (int argc, char** argv)
{
RTC::Manager* manager;
manager = RTC::Manager::init(argc, argv);
// Initialize manager
manager->init(argc, argv);
// Set module initialization proceduer
// This procedure will be invoked in activateManager() function.
manager->setModuleInitProc(MyModuleInit);
// Activate manager and register to naming service
manager->activateManager();
// run the manager in blocking mode
// runManager(false) is the default.
manager->runManager(true);
while(!pView);
cv::namedWindow("Image Window", CV_WINDOW_AUTOSIZE);
while(pView->isAlive()) {
//std::cout << "Show Image" << std::endl;
if (pView->imageQueue.size() > 0) {
cv::Mat image = pView->imageQueue.front();
pView->imageQueue.pop();
imshow("Image Window", image);
int c = cvWaitKey(1);
}
}
// If you want to run the manager in non-blocking mode, do like this
// manager->runManager(true);
cv::destroyWindow("Image Window");
return 0;
}
示例15: main
int main (int argc, char** argv)
{
RTC::Manager* manager;
manager = RTC::Manager::init(argc, argv);
// Initialize manager
manager->init(argc, argv);
// Set module initialization proceduer
// This procedure will be invoked in activateManager() function.
manager->setModuleInitProc(MyModuleInit);
// Activate manager and register to naming service
manager->activateManager();
// run the manager in blocking mode
// runManager(false) is the default.
#ifdef WIN32
manager->runManager(false);
#elif __APPLE__
manager->runManager(true);
while(!pCap);
bool active_flag = false;
while(pCap->isAlive()) {
bool flag = pCap->isActive();
if (!active_flag && flag) { // Rising Edge
pCap->onInitCalib(0);
}
if (flag) {
pCap->onProcess(0);
}
if (active_flag && !flag) { // Falling Edge
pCap->onFiniCalib(0);
}
active_flag = flag;
}
#else // Linux
manager->runManager(false);
#endif
// If you want to run the manager in non-blocking mode, do like this
// manager->runManager(true);
return 0;
}