Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/133.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ naoqi框架如何处理RPC?_C++_Rpc_Nao Robot - Fatal编程技术网

C++ naoqi框架如何处理RPC?

C++ naoqi框架如何处理RPC?,c++,rpc,nao-robot,C++,Rpc,Nao Robot,最近我正在学习nao机器人的naoqi框架。下面是如何在文档中访问自定义模块的示例。 () #包括 #包括 #包括 int main(int argc,char*argv[]){ 如果(argc!=2) { 我建议你注册并直接在论坛上提问,在那里你会找到Naoqi开发者。Naoqi基于SOAP。。。 #include <iostream> #include <alerror/alerror.h> #include <alcommon/alproxy.h> i

最近我正在学习nao机器人的naoqi框架。下面是如何在文档中访问自定义模块的示例。 ()

#包括
#包括
#包括
int main(int argc,char*argv[]){
如果(argc!=2)
{

我建议你注册并直接在论坛上提问,在那里你会找到Naoqi开发者。Naoqi基于SOAP。。。
#include <iostream>
#include <alerror/alerror.h>
#include <alcommon/alproxy.h>

int main(int argc, char* argv[]) {
  if(argc != 2)
  {
    std::cerr << "Wrong number of arguments!" << std::endl;
    std::cerr << "Usage: testhelloworld NAO_IP" << std::endl;
    exit(2);
  }

  const std::string robotIP = argv[1];
  int port = 9559;

  try {
    boost::shared_ptr<AL::ALProxy> testProxy
    = boost::shared_ptr<AL::ALProxy>(new AL::ALProxy("HelloWorld", robotIP, port));

    /** Call the sayHello method from the module using its bound name.
    * Since it returns nothing, use the callVoid method.
    */
    testProxy->callVoid("sayHello");

    testProxy->callVoid("sayText", std::string("This is a test."));

    int sentenceLength = testProxy->call<int>("sayTextAndReturnLength",
                         std::string("This is another test"));
    std::cout << "Sentence length is " << sentenceLength << std::endl;
  }
  catch (const AL::ALError& e) {
    std::cerr << e.what() << std::endl;
  }
}