我正在尝试设置PlayerClient并将模拟连接到它。我现在有的代码是-
/*
* Player/Stage manual tutorial example
*/
#include <stdio.h>
#include </usr/local/include/player-3.0/libplayerc++/playerc++.h>
//main
int main(int argc, char* argv[]) {
using namespace PlayerCc;
PlayerClient robot("localhost");
Position2dProxy p2dProxy(&robot, 0);
SonarProxy sonarProxy(&robot, 0);
BlobfinderProxy blobProxy(&robot, 0);
LaserProxy laserProxy(&robot, 0);
return 0;
}我得到的错误是-
playerc error : connect call on [localhost:6665] failed with error [111:Connection refused]
terminate called after throwing an instance of 'PlayerCc::PlayerError'
Aborted我认为这与我运行代码时播放器当前没有运行有关。但我对此非常陌生,所以我不确定。我怎样才能修复或者至少调试更多呢?任何帮助都是非常感谢的。
发布于 2011-12-07 06:37:02
如果您有ip地址或是否有防火墙阻止您,您将收到连接被拒绝的检查。为了让你的客户端正常工作,你可以阅读一些示例代码。我在这个页面的.tar文件中发现了一些有用的东西:
http://web.eecs.utk.edu/~parker/Courses/CS594-fall07/handouts/PlayerStageGettingStarted.html#eight
https://stackoverflow.com/questions/4575584
复制相似问题