From: Geoffrey B. <g....@au...> - 2006-08-16 21:34:01
|
You're running in PUSH data mode, which means the read call will wait for a message to arrive, then return immediately, reading only that one message. You will need to keep reading until a bumper message makes it to the top of the queue to get bumper data. For a program like this, I would recommend you use PULL mode. See here for details: http://playerstage.sourceforge.net/doc/Player-2.0.0/player/group__libplayerc__datamodes.html Geoff David Bloom wrote: > I added another _pc.Read, and this fixed the blobfinder problem, but I still > am not recieving data from the bumper Proxy. > David > > using namespace PlayerCc; > using namespace std; > int main(int argc, char *argv[]) > { > using namespace PlayerCc; > cout<<"roombastart"<<endl; > PlayerClient _pc("localhost",6665); > cout<<"blobfinderstart"<<endl; > BlobfinderProxy _bfp(&_pc,0); > BumperProxy _bump(&_pc,0); > Position2dProxy _pp(&_pc,0); > > _pp.SetSpeed(.2,0); > sleep(1); > _pp.SetSpeed(0,0); > int m,j; > for (m=0;m<100;++m){ > _pc.Read(); > cout<<"There are "<<_bfp.GetCount()<<" blobs"<<endl; > _pc.Read(); > cout <<"BumpState ="<< _bump.IsAnyBumped()<<endl; > sleep(1); > } > } > -- Robotics research group, University of Auckland http://www.ece.auckland.ac.nz/~gbig005/ |