ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
The closest thing to an "interrupt" in ROS is that ROS uses callbacks that get called when particular ROS events happen. For example, when creating a subscriber you provide a callback function that executes every time a message on a particular topic is received. You could easily publish a topic in a subscriber callback. There are also callbacks for service providers (which could also contain a publish command).
One thing you may be interested in is a Timer (Python and CPP). These allow you to specify a callback and a time period (as a ros::Duration
). The callback will then be executed at the frequency specified by the time period. You can, of course, publish messages in that timer callback as well.