How to poke multiple node from a node?

asked 2020-09-29 12:46:00 -0500

gokhan.acer gravatar image

updated 2020-09-30 07:30:37 -0500

Hello everyone,

I have a node for common issues and there is a parameter in this node. When this parameter change, how can it poke the other nodes to be aware?

For example: I have a service to stop the robot. When I call this service, the other nodes should be aware because of some issues, e.g. waiting, putting in order, cancel plan.

Firstly, I tried to create services with same names in nodes, but it doesn't work. Only, the last run service works. Then, I tried to use parameter service. At this time, the other nodes should always listen parameter service and check it. I don't want to use this method for performs issues. Lastly, I tried to use dynamic reconfiguration. Unfortunately, the dynamic reconfiguration is related only for a specific node.

I have another opinion for this situation, which is Signal & Slot mechanism. But, I don't want to use QT or any other 3rd party framework.

I know, I am so delicate :) I would like to learn your approaches. Is there any light way?

Thank you!

Edit:

I tried two different strategies:

  1. I create a dynamic req. server in common_server. The server's callback handles the stop_robot request, then a publisher publishes the parameter to other nodes.
  2. I create a ros service in common_server. The server's callbacks also handles the stop_robot request, then a publisher publishes the parameters to other nodes.

When I test two strategies, the first method has 3 seconds delay nearly. The second method has 1 second delay.

edit retag flag offensive close merge delete

Comments

1

Can you use a topic to publish the information instead of using services?

jayess gravatar image jayess  ( 2020-09-29 16:20:08 -0500 )edit

Hello. I decide to create a common_service, which has dynamic reconfiguration server. Using this server, I can change variable, dynamically. When the parameter is changed, the server publishes this parameter. And finally, other nodes handle this changing with subscriber. For now, I use this strategy for this situation. Maybe there are other methods which are more sense.

gokhan.acer gravatar image gokhan.acer  ( 2020-09-30 05:09:10 -0500 )edit