当前位置: 首页>>代码示例>>C++>>正文


C++ Navigator::start方法代码示例

本文整理汇总了C++中Navigator::start方法的典型用法代码示例。如果您正苦于以下问题:C++ Navigator::start方法的具体用法?C++ Navigator::start怎么用?C++ Navigator::start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Navigator的用法示例。


在下文中一共展示了Navigator::start方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: configure

    virtual bool configure(yarp::os::ResourceFinder &rf)
    {
        yarp::os::Time::turboBoost();
        
        mNavThread=new Navigator(&rf);

        if (!mNavThread->start())
        {
            delete mNavThread;
            return false;
        }

        std::string local=rf.check("local",yarp::os::Value("/ikartnav")).asString().c_str();
        mHandlerPort.open(local.c_str());
        attach(mHandlerPort);
        //attachTerminal();

        return true;
    }
开发者ID:xufango,项目名称:contrib_bk,代码行数:19,代码来源:main.cpp

示例2: main

int main(int argc, char* argv[])
{

  bool createFromFile = false;
  std::string create_filename = "nothing";
  bool backup = false;
  std::string backup_filename = "no_backup";
  for(int i=0;i<argc;i++)
  {
    if(strcmp("-B",argv[i]) == 0 || strcmp("-b",argv[i]) == 0)
    {
      std::cout << "make continuous backups" << std::endl;
      if(i+1 < argc)
      {
        backup_filename = std::string(argv[i+1]);
        backup = true;
      }
    }

    if(strcmp("-F",argv[i]) == 0 || strcmp("-f",argv[i]) == 0)
    {
      std::cout << "Contruct from saved data" << std::endl;
      if(i+1 < argc)
      {
        create_filename = std::string(argv[i+1]);
        createFromFile = true;
      }
    }
  }

  std::cout << "------------------------------------"<< std::endl;
  std::cout << "---------------START----------------"<< std::endl;
  std::cout << "------------------------------------"<< std::endl;

  std::cout << "Main: program started" << std::endl;

  // (1) Create a  mission and a transmitter
  Mission* mission;

  if(!createFromFile)
  {
    std::vector<std::string> missionPlan;
    for(std::string line; std::getline(std::cin,line);)
    {
      //std::cout << "READING: " << line << std::endl;
      if(line[0] != '#')
        missionPlan.push_back(line);
    }
    //std::cout << missionPlan.size() << std::endl;
    mission = new Mission(missionPlan);
  }
  else{
    mission = new Mission(create_filename);
  }

  //return 0;


  //Mission* mission = new Mission(0);

  std::cout << "\n---------starting mission-----------\n"<< std::endl;

  Transmitter* transmitter = new Transmitter(2);
  transmitter->start();

  // (2) Create the navigator, and pass the transmitter to
  double delta = 15;
  double tol = 2;//delta / 3.0;

  int delay_data = 50000;
  int delay_scanner = 500000;

  Navigator* navigator = new Navigator(transmitter,delay_data,delay_scanner,delta,tol, backup, backup_filename);

  // (3) give the navigator a mission
  navigator->setMission(mission);

  // (4) start navigator
  navigator->start();


  //navigator.abort();
  //transmitter->abort();

  delete navigator;
  delete mission;
  delete transmitter;

  std::cout << "Main: program done" << std::endl;

  std::cout << "------------------------------------"<< std::endl;
  std::cout << "----------------DONE----------------"<< std::endl;
  std::cout << "------------------------------------"<< std::endl;
}
开发者ID:NiklasRolleberg,项目名称:asv-navigator,代码行数:94,代码来源:main.cpp


注:本文中的Navigator::start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。