From: kingwinter <kin...@gm...> - 2010-06-18 14:35:10
|
hi, there I am trying to update a shared data in 30Hz using blackboard. The first 10 seconds is fine but after that get " playerc error : queue overflow; discarding packets" error. Although the data is still updated even with this error, I want to know how to get rid of it. I tried to change replacerule but it doesn't help whatever I set to 1 or 0. Thanks very much for your time. Here is the code: >>>>>>robot1.cpp>>>>>>>>> #include <libplayerc++/playerc++.h> #include <iostream> #define KEY "SSL" #define GROUP "JD" using namespace std; void On_First_Device_Event(playerc_blackboard *blackboard, player_blackboard_entry_t event) { printf("First device event fired for key '%s'\n", event.key); printf("Key value = %d,%d,%d,%d\n", event.data[0], event.data[1], event.data[2], event.data[3]); } int main(int argc, char **argv) { using namespace PlayerCc; const char * key = strdup(KEY);; const char * group = strdup(GROUP); PlayerClient robot ("localhost", 6665); BlackBoardProxy bb (&robot, 0); bb.SubscribeToKey(key, group); player_blackboard_entry_t *entry = new player_blackboard_entry_t; memset(entry, 0, sizeof(entry)); entry->key = strdup(KEY); entry->group = strdup(GROUP); entry->key_count = strlen(KEY) + 1; entry->group_count = strlen(GROUP)+1; entry->data = new uint8_t[4]; entry->data[0] = 4; entry->data[1] = 3; entry->data[2] = 2; entry->data[3] = 1; entry->data_count = 4; bb.SetEventHandler(On_First_Device_Event); bb.SetReplaceRule(0); while(1) { bb.SetEntry(*entry); entry->data[0] = entry->data[0]+1; usleep(30)*1000; } } >>>>>>robot2.cpp>>>>>>>>> #include <libplayerc++/playerc++.h> #include <iostream> #define KEY "SSL" #define GROUP "JD" using namespace std; void On_First_Device_Event(playerc_blackboard_t *blackboard, player_blackboard_entry_t event) { printf("First device event fired for key '%s'\n", event.key); printf("Key value = %d,%d,%d,%d\n", event.data[0], event.data[1], event.data[2], event.data[3]); } int main(int argc, char **argv) { using namespace PlayerCc; const char * key = strdup(KEY); const char * group = strdup(GROUP); PlayerClient robot ("localhost", 6665); BlackBoardProxy bb (&robot, 0); bb.SubscribeToKey(key, group); player_blackboard_entry_t *entry; bb.SetEventHandler(On_First_Device_Event); bb.SetReplaceRule(0); while(1) { //robot.Read(); entry = bb.GetEntry(KEY,GROUP); printf("Key value = %d,%d,%d,%d\n", entry->data[0], entry->data[1], entry->data[2], entry->data[3]); usleep(15)*1000; } } >>>>>>localbb.cfg>>>>>>>> driver ( name "localbb" provides [ "blackboard:0" ] ) -- View this message in context: http://old.nabble.com/queue-overflow-problem-when-using-blackboard-in-high-update-rate-tp28926817p28926817.html Sent from the playerstage-users mailing list archive at Nabble.com. |