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

On demand Publishing?

asked 2018-01-29 14:29:24 -0500

Ahmad gravatar image

I'm using ROS kinetic with Yumi package from KTH. I am getting some points from the camera and do some processing and send the coordinates back to the robot arms to move. What I'm doing is letting the camera input and processing system on a node (publisher) to publish the coordinates and the control and move of the robot one (subscriber) on another node. The problem is that the camera publish sequence of coordinates to the robot. My question is that how can I publish the first message only and then wait till demand or flag to publish the second message and so on?

Thank you in Advance

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2018-01-29 14:42:56 -0500

Airuno2L gravatar image

Instead of using a publisher and subscriber you could use a service and client.

The camera input and processing would be in the service, and the client would request the coordinate whenever it needs it.

Here is a service/client tutorial for C++ or here is one for Python.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2018-01-29 14:29:24 -0500

Seen: 491 times

Last updated: Jan 29 '18