ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You should be able to do thus by setting up your callback for the subscribe and then publishing out of the main loop.
def callback( data ):
<do stuff>
subscriber = rospy.Subscriber( topic, type, callback )
publisher = rospy.Publisher( topic, type )
while not rospy.is_shutdown():
<do stuff>
publisher.publish( msg )