The character you are getting is a 3 just as you wrote into the data array. If you want the character 3 you need to write '3', or cast the output to an int before you print it.

uint8_t is just an unsigned char in a portable way (from stdint.h)

The array is just opaque data, you can put anything you like in there. There are some helper methods like playerc_pack_blackboard_entry_double to help with floating point etc.

See for similar methods for packing data types,


On 16 February 2013 20:57, kparvate <> wrote:
Hi all,

I have tried to set up a communication system for multiple robots, but I am
facing some issues with the Blackboard Proxy associated with the localbb

Here is my code thus far:

#include <stdio.h>

#include <string.h>
#include <iostream>
#include <libplayerc++/playerc++.h>
#include <sstream>
using namespace std;
using namespace PlayerCc;
int main(int argc, char **argv) {
        PlayerClient robot("localhost", 6665);
        BlackBoardProxy bb(&robot, 0);
        char *key = (char *) "myKey";
        char *group = (char *) "myGroup";

                        player_blackboard_entry_t data,* output;

       = new uint8_t[1];
                data.data_count = 1;
      [0] = 3;
                data.key = key;
                data.key_count = strlen((const char*) key) + 1;
       = group;
                data.group_count = strlen((const char*) group) + 1;
                time_t rawtime;
                data.timestamp_sec = rawtime;

                try {
                        //updating the key
                } catch (PlayerError pe) {
                        cout << "Error: " << pe.GetErrorStr() << endl;
                        return (-1);

                try {

                        output = bb.GetEntry(key,group);
                } catch (PlayerError pe) {
                        cout << "Error: " << pe.GetErrorStr() << endl;
                        return (-1);
                int datacount = output->data_count;
                for(int i=0; i<datacount; i++){
                        cout &lt;&lt; &quot;Data value at &quot; &lt;&lt; i&lt;&lt; &quot; is:
&quot; &lt;&lt; output->data[i];
                cout << endl;

Here is the relevant portion of the cfg file just in case:
  name "localbb"
  provides ["blackboard:0"]

However, I am getting a very weird out put from  output->data[i].         It
doesn't seem to be a normal character. I have attached a picture of it.
<> . Could
someone explain why this is happening, and how to fix it?

Furthermore, I am unfamiliar with the type uint8_t, and I am unsure as to
how I am supposed to store strings or doubles. Any help would be greatly



View this message in context:
Sent from the playerstage-users mailing list archive at

The Go Parallel Website, sponsored by Intel - in partnership with Geeknet,
is your hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials, tech docs,
whitepapers, evaluation guides, and opinion stories. Check out the most
recent posts - join the conversation now.
Playerstage-users mailing list