ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You can use the rosbag filter command to generate a new bag file filtering out the topics you do not want.
2 | No.2 Revision |
You can use the rosbag filter command to generate a new bag file filtering out the topics you do not want.want.
For example, I used this command
rosbag filter input.bag output.bag 'topic == "/camera/image_raw/compressed" or topic == "/scan" or topic == "/timetag" or topic == "/tf" and m.transforms[0].header.frame_id != "/odom" and m.transforms[0].child_frame_id != "/odom"'
here I want to keep the topics /camera/image_raw/compressed , /scan and /timetag and also the /tf except the ones that had /odom either as a frame_id or as a child_frame_id.
in your case you can use only the condition 'topic != "/tf"' to filter out the /tf topic
3 | No.3 Revision |
You can use the rosbag filter command to generate a new bag file filtering out the topics you do not want. For example, I used this command
rosbag filter input.bag output.bag 'topic == "/camera/image_raw/compressed" or topic == "/scan" or topic == "/timetag" or topic == "/tf" and m.transforms[0].header.frame_id != "/odom" and m.transforms[0].child_frame_id != "/odom"'
here I want to keep the topics /camera/image_raw/compressed , /scan and /timetag and also the /tf except the ones that had /odom either as a frame_id or as a child_frame_id.
in your case you can use only the condition 'topic != "/tf"' to filter out the /tf topictopic:
rosbag filter input.bag output.bag 'topic != "/tf"'
4 | No.4 Revision |
You can use the rosbag filter command to generate a new bag file filtering out the topics you do not want. For example, I used this command
rosbag filter input.bag output.bag 'topic == "/camera/image_raw/compressed" or topic == "/scan" or topic == "/timetag" or topic == "/tf" and m.transforms[0].header.frame_id != "/odom" and m.transforms[0].child_frame_id != "/odom"'
here I want to keep the topics /camera/image_raw/compressed , /scan and /timetag and also the /tf except EXCEPT the ones that had /odom either as a frame_id or as a child_frame_id.child_frame_id, effectively removing only some /tf messages instead of all of them.
in your case you can use only the condition 'topic != "/tf"' to filter out the /tf topic:
rosbag filter input.bag output.bag 'topic == "ALL THE TOPICS YOU WANT TO KEEP" or topic == "/tf" and m.transforms[0].header.frame_id != "/tf"'
"/base_link" and m.transforms[0].child_frame_id != "/virtual_cam"'
5 | No.5 Revision |
You can use the rosbag filter command to generate a new bag file filtering out the topics you do not want. For example, I used this command
rosbag filter input.bag output.bag 'topic == "/camera/image_raw/compressed" or topic == "/scan" or topic == "/timetag" or topic == "/tf" and m.transforms[0].header.frame_id != "/odom" and m.transforms[0].child_frame_id != "/odom"'
here I want to keep the topics /camera/image_raw/compressed , /scan and /timetag and also the /tf EXCEPT the ones that had /odom either as a frame_id or as a child_frame_id, effectively removing only some /tf messages instead of all of them.
in your case you can use only adapt the condition 'topic != "/tf"' above example to filter out the /tf topic:fit your needs:
rosbag filter input.bag output.bag 'topic == "ALL THE TOPICS YOU WANT TO KEEP" or topic == "/tf" and m.transforms[0].header.frame_id != "/base_link" and m.transforms[0].child_frame_id != "/virtual_cam"'
6 | No.6 Revision |
You can use the rosbag filter command to generate a new bag file filtering out the topics you do not want. For example, I used this command
rosbag filter input.bag output.bag 'topic == "/camera/image_raw/compressed" or topic == "/scan" or topic == "/timetag" or topic == "/tf" and m.transforms[0].header.frame_id != "/odom" and m.transforms[0].child_frame_id != "/odom"'
here I want to keep the topics /camera/image_raw/compressed , /scan and /timetag and also the /tf EXCEPT the ones that had /odom either as a frame_id or as a child_frame_id, effectively removing only some /tf messages instead of all of them.
in your case you can use adapt the above example to fit your needs:
rosbag filter input.bag output.bag 'topic == "ALL THE TOPICS YOU WANT TO KEEP" or topic == "/tf" and m.transforms[0].header.frame_id != "/base_link" and m.transforms[0].child_frame_id != "/virtual_cam"'
EDIT: as pointed by @Ben_S, this is a more concise form, with the same results (from this answer):
rosbag filter input.bag output.bag 'topic != "tf" or m.transforms[0].header.frame_id != "/base_link" and m.transforms[0].child_frame_id != "/virtual_cam"'
7 | No.7 Revision |
You can use the rosbag filter command to generate a new bag file filtering out the topics you do not want. For example, I used this command
rosbag filter input.bag output.bag 'topic == "/camera/image_raw/compressed" or topic == "/scan" or topic == "/timetag" or topic == "/tf" and m.transforms[0].header.frame_id != "/odom" and m.transforms[0].child_frame_id != "/odom"'
here I want to keep the topics /camera/image_raw/compressed , /scan and /timetag and also the /tf EXCEPT the ones that had /odom either as a frame_id or as a child_frame_id, effectively removing only some /tf messages instead of all of them.
in your case you can use adapt the above example to fit your needs:
rosbag filter input.bag output.bag 'topic == "ALL THE TOPICS YOU WANT TO KEEP" or topic == "/tf" and m.transforms[0].header.frame_id != "/base_link" and m.transforms[0].child_frame_id != "/virtual_cam"'
EDIT: as pointed by @Ben_S, this is a more concise form, with the same results (from this answer):
rosbag filter input.bag output.bag 'topic != "tf" or m.transforms[0].header.frame_id != "/base_link" and m.transforms[0].child_frame_id != "/virtual_cam"'
8 | No.8 Revision |
You can use the rosbag filter command to generate a new bag file filtering out the topics you do not want. For example, I used this command
rosbag filter input.bag output.bag 'topic == "/camera/image_raw/compressed" or topic == "/scan" or topic == "/timetag" or topic == "/tf" and m.transforms[0].header.frame_id != "/odom" and m.transforms[0].child_frame_id != "/odom"'
here I want to keep the topics /camera/image_raw/compressed , /scan and /timetag and also the /tf EXCEPT the ones that had /odom either as a frame_id or as a child_frame_id, effectively removing only some /tf messages instead of all of them.
in your case you can use adapt the above example to fit your needs:
rosbag filter input.bag output.bag 'topic == "ALL THE TOPICS YOU WANT TO KEEP" or topic == "/tf" and m.transforms[0].header.frame_id != "/base_link" and m.transforms[0].child_frame_id != "/virtual_cam"'
EDIT: as pointed by @Ben_S, this is a more concise form, with the same results (from this answer):
rosbag filter input.bag output.bag 'topic != "tf" or topic == "/tf" and m.transforms[0].header.frame_id != "/base_link" and m.transforms[0].child_frame_id != "/virtual_cam"'
9 | No.9 Revision |
You can use the rosbag filter command to generate a new bag file filtering out the topics you do not want. For example, I used this command
rosbag filter input.bag output.bag 'topic == "/camera/image_raw/compressed" or topic == "/scan" or topic == "/timetag" or topic == "/tf" and m.transforms[0].header.frame_id != "/odom" and m.transforms[0].child_frame_id != "/odom"'
here I want to keep the topics /camera/image_raw/compressed , /scan and /timetag and also the /tf EXCEPT the ones that had /odom either as a frame_id or as a child_frame_id, effectively removing only some /tf messages instead of all of them.
in your case you can use adapt the above example to fit your needs:
rosbag filter input.bag output.bag 'topic == "ALL THE TOPICS YOU WANT TO KEEP" or topic == "/tf" and m.transforms[0].header.frame_id != "/base_link" and m.transforms[0].child_frame_id != "/virtual_cam"'
EDIT: as pointed by @Ben_S, this is a more concise form, with the same results (from this answer):
rosbag filter input.bag output.bag 'topic != "tf" "/tf" or topic == "/tf" and m.transforms[0].header.frame_id != "/base_link" and m.transforms[0].child_frame_id != "/virtual_cam"'