How to make Player/Stage connect?
I am trying to setup a PlayerClient and connect the simulation to it. The code I have now is -
/*
* Player/Stage manual tutorial example
*/
#include <stdio.h>
#include </usr/local/include/player-3.0/libplayerc++/playerc++.h>
//main
int main(int arg开发者_高级运维c, 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;
}
The error I get is -
playerc error : connect call on [localhost:6665] failed with error [111:Connection refused]
terminate called after throwing an instance of 'PlayerCc::PlayerError'
Aborted
I think it has something to do with Player not currently running when I run the code. But I'm extremely new to this so I'm not sure. How can I go about fixing or at least debugging this more? Any help is appreciated.
you got an connection refused check if you have an ip address or if there is some firewall blocking you. In order to get your client working you cand read some sample code. i found some useful bits inside the .tar file from this page:
http://web.eecs.utk.edu/~parker/Courses/CS594-fall07/handouts/PlayerStageGettingStarted.html#eight
精彩评论