ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Another potential solution is to write the second part of your system (the part that takes input from the keyboard) as a separate ROS node that communicates with the original node. Then, you don't have to drop out of the spin()
. This doesn't solve the problem of knowing when rosbag
is done, though.
One hack that might work is to record a second bag file done.bag
with a single message in it on a new topic (let's call it done
). Then play the bags back-to-back: rosbag play subset.bag done.bag
. When you see the message on the done
topic, then you know that the first bag is finished, and that you can start listening for command-line input (using the method in the first part of this answer).
A bit kludgey, but it might work.