ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Can a node act as a server and a publisher?

asked 2011-08-15 12:28:15 -0500

Gideon gravatar image

Hello all, I have a piece of hardware (LabJack UE9) I am using to interface with a diesel generator for data acquisition as well as for some simple controls (turning it on and off), and I would like to have the node that interfaces with it to be capable of both publishing acquired data and servicing client requests to turn the generator on and off. Is this possible? I have successfully implemented client/servers as well as publishers/subscribers, but I am having problems stitching them together.



edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2011-08-15 13:24:40 -0500

Gideon gravatar image

Yes it can, although I am still uncertain what happens to the published messages when the service takes a while to fulfill the request. For anyone else trying to do this, I found the stitching together of examples from the tutorials much easier once I found class based examples (

edit flag offensive delete link more


Once the message has been "published" the service call will not effect it.
tfoote gravatar image tfoote  ( 2011-08-15 16:29:54 -0500 )edit

answered 2011-08-16 04:25:03 -0500

Thomas D gravatar image

updated 2011-08-30 05:01:42 -0500

I have written a set of tutorials that should help clear up how to have a publisher/subscriber along with a dynamic reconfigure server running within a single node. The nodes also use classes for the majority of the work/callback functions which I have found to be the cleanest way to do things with pub/sub in general. It should not be too difficult to stitch in a server/client to the example provided in the tutorial.

edit flag offensive delete link more

answered 2012-06-01 19:40:41 -0500

malong gravatar image

updated 2012-06-03 17:28:42 -0500

hi ,i have ever thought this problem,and find a way to realise using message in the request and response. you can see it :

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2011-08-15 12:28:15 -0500

Seen: 3,258 times

Last updated: Jun 03 '12