From: Martin S. <mar...@gm...> - 2009-08-06 00:24:28
|
With just this in the config file I get the same result: driver ( name "dummy" provides ["position2d:0"] rate 75 ) Martin 2009/8/5 Toby Collett <tco...@pl...<tcollett%2Bp...@pl...> > > > Are you able to reproduce this with a minimal configuration that requires > only standard stage, or a standalone driver you can attach? > > Toby > > 2009/8/2 Martin Spencer <mar...@gm...> > > > Hi everyone, > > > > I'm using the C++ client library with the trunk version of player. When I > > set the client to pull mode with replacement, I'm finding that the data > read > > into the proxies is sometimes old data. I think this is because each call > to > > client.Read() only reads until it gets a synch message but something is > > sending synch messages when not requested. This example demonstrates the > > problem: > > > > PlayerClient* robot; > > robot = new PlayerClient("localhost", 6665); > > robot->SetDataMode(PLAYER_DATAMODE_PULL); > > robot->SetReplaceRule(true, PLAYER_MSGTYPE_DATA); > > js = new Position2dProxy(robot,0); > > sleep(1); > > double start = Time()/1e6; > > for(;;) { > > js->NotFresh(); > > robot->Read(); > > cout<<"fresh: "<<js->IsFresh()<<" datatime: > > "<<js->GetDataTime()-start<<" actual time: "<<Time()/1e6-start<<endl; > > usleep(200000); > > } > > > > Output when the above code is run, with a joystick publishing data much > > faster than once every 0.2s: > > fresh: 1 datatime: -0.984458 actual time: 0.00039901 > > fresh: 1 datatime: -0.00469089 actual time: 0.201128 > > fresh: 1 datatime: 0.199529 actual time: 0.401752 > > fresh: 1 datatime: 0.393163 actual time: 0.602395 > > > > It looks like the data that's read into the proxy is that data that was > > received by the previous call to Read(), not the current one. > > > > Adding these two lines at line 708 of client.c seems to fix the problem > by > > checking for any data already waiting before we request more: > > > > if(client->mode == PLAYER_DATAMODE_PULL) > > playerc_client_read_nonblock_withproxy(client, &ret_proxy); > > > > But then I sometimes get errors where no data was received with a synch > > message. > > > > Any ideas? > > > > Martin Spencer > > > > > > > > > > > ------------------------------------------------------------------------------ > > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > > trial. Simplify your report design, integration and deployment - and > focus > > on > > what you do best, core application coding. Discover what's new with > > Crystal Reports now. http://p.sf.net/sfu/bobj-july > > _______________________________________________ > > Playerstage-users mailing list > > Pla...@li... > > https://lists.sourceforge.net/lists/listinfo/playerstage-users > > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > |