What is the best way to use a text file listing topics to filter a rosbag
I want to play a rosbag with hundreds of recorded topics
This ros bag is intended to test a node I am working on but the person who recorded it also included topics such as the ones my node is supposed to publish. I want to filter-out a list of specific topics.
I would like to avoid techniques involving creating another ros bag from my existing bag and removing the topics in this way. The reason is I am planning on using this in a build engine (Bazel) and it will be more convenient to have only rosbag and filter the playback as I please.
I would like to use a list of topics as a text file (it could be plain text or something like yaml).
I would like the playback to be started from a launch file.
I am looking for something like this:
<launch>
<node
pkg="rosbag"
name="play"
type="play"
args= --bags $(find test_package)/mybag.bag --topics=$(read-from-file file.yaml) />
</launch>