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

Standby mode for nodes depending on topic value

asked 2020-08-22 09:21:11 -0500

definitive gravatar image

Let's assume we have 10 nodes performing various operations. We run all the nodes with one launch file at a time. We also have one topic "/mode" in which we specify the value of int. Now we want certain nodes to execute depending on the value of "/mode". Is there any better way to do this in the ROS environment than subscribe the "/mode" topic, check the value, and if it is incorrect, we just do return in callbacks? Can I freeze the nodes somehow depending on topic value? I mean, nodes should be in standby mode and wait for specific output of "/mode" topic and run callbacks until "/mode" is correct. I want to run and stop node several times through topic value.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2020-08-22 09:51:54 -0500

gvdhoorn gravatar image

updated 2020-08-23 09:20:02 -0500

Not sure about how much use it sees, but for ROS 1, perhaps boschresearch/ros1_lifecycle could be an option.

It's essentially a/the ROS 2 lifecycle, but for ROS 1.

edit flag offensive delete link more
1

answered 2020-08-22 09:47:09 -0500

fergs gravatar image

In ROS1, I think what you've proposed is the best possible solution available.

If you were to move to ROS2 in the future, check out Managed Nodes which implement a lifecycle, so you could have a central node that starts and stops the desired nodes at different times.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-08-22 09:21:11 -0500

Seen: 190 times

Last updated: Aug 23 '20