Robotics StackExchange | Archived questions

How to publish/subscribe when a specific event occurs

Hello everyone. I'm a ROS beginner.

I would like to publish/subscribe a ROS Topic when a specific event occurs

For example,

when -20 < angle < 20, I want to publish motor speed msg.

Is there any good way?

Asked by secrisa11 on 2021-06-03 18:54:31 UTC

Comments

The question does not have enough details. Where all in your code is angle updated? Every time angle is updated, the "obvious way" is to check for that condition and if true publish. However, without more info, it's difficult to see why the "obvious way" might not work.

Asked by abhishek47 on 2021-06-04 04:47:03 UTC

Answers