Perhaps, that would be a good idea to stablish the playerclient asociated to each robot using a different port for each one, and then cheking always if there is fresh data available for the robot you want to handle a each time before doing the comunication.

More over, if you wish to comunicate the robots, then having different ports assigned could also be of your help for other things.


Hope that helps you anyway,


Andrés



> Date: Sat, 21 Mar 2009 10:10:55 +0900
> From: gbiggs@killbots.net
> To: playerstage-users@lists.sourceforge.net
> Subject: Re: [Playerstage-users] how two robots interact in P/S?
>
> You need to call read() more often than just at the beginning of your
> program.
>
> Geoff
>
> Rebble wrote:
> > 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
> >>
> >>
> >>
> >
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> Playerstage-users mailing list
> Playerstage-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/playerstage-users


Share your photos with Windows Live Photos – Free. Try it Now!