From: Rebble <hyy...@16...> - 2009-03-21 00:39:32
|
Dear Toby: I have searched in the forum for a day, but I haven't found out the effective way to solve the problem as following when i run the program for testing two -robot communication: playerc error : got NACK from request playerc error : failed to get response terminate called after throwing an instance of 'PlayerCc::PlayerError' Aborted (core dumped) this is my com.cc file(similar to other has posted) #include <libplayerc++/playerc++.h> #include<stdio.h> //#include <libplayerc/player.h> #include "math.h" #include <iostream> #include "args.h" using namespace PlayerCc; using namespace std; PlayerClient r1("localhost",6665);// Position2dProxy pp1(&r1); LaserProxy lp1(&r1); OpaqueProxy op1(&r1); player_opaque_data_t op1Data,op2Data; uint8_t op1GetData[1024]; PlayerClient r2("localhost",6665);// Position2dProxy pp2(&r2, 0); LaserProxy lp2(&r2, 0); OpaqueProxy op2(&r2,0); uint8_t op2GetData[1024]; int main(int argc, char **argv) { parse_args(argc,argv); for(;;) { r1.Read(); r2.Read(); pp1.SetSpeed(0.5,dtor(30)); pp1.SetSpeed(0.5,dtor(30)); op1Data.data = new uint8_t[3];" op1Data.data_count = 3; op1Data.data[0]='a'; op1Data.data[1]='b'; op1Data.data[2]='c'; // send the data structure to opaque proxy op1.SendCmd(&op1Data); std::cout << "Sent Data"<< op1Data.data << std::endl; // get back the opaque data uint count = op2.GetCount(); std::cout << "Sent Count" << count << std::endl; op1.GetData(op2Data.data); std::cout << "op1GetData[0]=" << op1GetData[0] << std::endl; std::cout << "op1GetData[1]=" << op1GetData[1] << std::endl; } return 0; } Could you tell me how to solve the problem??I am really impatient. Please give me a hand. Thank you! Rebble Dear Toby: I will try the method you advised to me. Thanks again! Happy everyday! Rebble Toby Collett-3 wrote: > > Probably your best bet is to write a custom driver that directly > subscribes > to these player interfaces on the other robots, or a client that runs for > each robot that does this. In simulation the limit will be the processing > power and RAM that your computer has for simulation. > > Toby > > > -- View this message in context: http://www.nabble.com/how-two-robots-interact-in-P-S--tp22397315p22631347.html Sent from the playerstage-users mailing list archive at Nabble.com. |