Skip to content

Service call #5

@tlund80

Description

@tlund80

Hi

I am trying to call a ros service via your library from a not ROS computer, but I face some problems in getting the feedback from ROS.

I can see that the Socket TCP connection receives the data, but I cannot register a callback function to readout the data.

` I call the service in the following way;

ROSService srv(ros,"/database/get_data","/database/get_data");
bson_t b;
bson_init (&b);
bson_t *ms = BCON_NEW("", "");
FunVrROSServiceResponseMsg fun = std::bind(&Ros::callback, this,std::placeholders::_1);
srv.CallService(ms, fun);`

And I have implemented the callback like this:

void Ros::callback(ROSBridgeServiceResponseMsg &msg){
bson_t bson;
msg.FromBSON(bson);
}

Do you have any sample code that show how to use the library?

Thanks
/Thomas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions