Robotics StackExchange | Archived questions

node handle.serviceClient -- for a python connection??

How do I set up the service in cpp code template which references a python service? The example for cpp client requires a .h file for the service:

2        #include "beginner_tutorials/AddTwoInts.h" 
...
15       ros::ServiceClient client = n.serviceClient("add_two_ints"); 

But even by looking at the github sources for node_handle, I'm not able to figure out the way to call this when the service is python based. The examples / tutorials further illustrate that cpp client can talk to a python service (and the other way around), but this is based on building both client and service in their respective worlds.

Asked by blakeh on 2014-05-01 10:30:49 UTC

Comments

The key to this turned out to be finding "AddTwoInts.h". despite triple checking my CMakelists.txt and package.xml files I could not get catkin to "autogenerate" this file. Instead I found it in the hydro examples and used it as is. This then worked. Not a satisfactory solution!
(there is an earlier question from 2011 with this same issue which was never answered!)

Asked by blakeh on 2014-05-02 06:20:27 UTC

Answers