-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ros bag reindex failed to generate topic inside metadata.yaml if the message_count is 0 #1719
Comments
Preliminary analysis. Lines 491 to 548 in 579fddf
|
Thank. Yes you are right, the JOIN statement eliminate the 0 message count topic. I added a dedicated SQL query to specifically detect this case. : |
This generates the topics with message_count:0 inside the metadate.yaml. (I notice some error with colcon test, i am working on it but my patch already solve the problem) |
I solve all but 1 problem during colcon test. And here it is a dilemma that should be assert by the team working on the ros2 play.
|
OK, i truly needed this function that i took the lead over the team (sorry). I implement the 2nd solution. On re-index only the patch is applied. All colcon test are working now without any errors or warnings. |
this is correct, just sharing that this does not happen with root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 bag info -v rosbag2_2024_06_22-11_00_14
Files: rosbag2_2024_06_22-11_00_14_0.mcap
Bag size: 26.4 KiB
Storage id: mcap
ROS Distro: rolling
Duration: 0.10s
Start: Jun 22 2024 11:00:14.320 (1719079214.320)
End: Jun 22 2024 11:00:14.331 (1719079214.331)
Messages: 10
Topic information: Topic: /events/write_split | Type: rosbag2_interfaces/msg/WriteSplitEvent | Count: 0 | Serialization Format: cdr
Topic: /greetings | Type: example_interfaces/msg/String | Count: 0 | Serialization Format: cdr
Topic: /rosout | Type: rcl_interfaces/msg/Log | Count: 9 | Serialization Format: cdr
Topic: /some_topic | Type: std_msgs/msg/Bool | Count: 1 | Serialization Format: cdr
Topic: /parameter_events | Type: rcl_interfaces/msg/ParameterEvent | Count: 0 | Serialization Format: cdr
Service: 0
Service information:
root@tomoyafujita:~/ros2_ws/colcon_ws# rm rosbag2_2024_06_22-11_00_14/metadata.yaml
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 bag info -v rosbag2_2024_06_22-11_00_14
Could not find metadata in bag directory rosbag2_2024_06_22-11_00_14
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 bag reindex rosbag2_2024_06_22-11_00_14/
[INFO] [1719079320.832050674] [rosbag2_cpp]: Beginning reindexing bag in directory: "rosbag2_2024_06_22-11_00_14/"
closing.
[INFO] [1719079320.846152483] [rosbag2_cpp]: Reindexing complete.
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 bag reindex rosbag2_2024_06_22-11_00_14/
[INFO] [1719079320.832050674] [rosbag2_cpp]: Beginning reindexing bag in directory: "rosbag2_2024_06_22-11_00_14/"
closing.
[INFO] [1719079320.846152483] [rosbag2_cpp]: Reindexing complete.
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 bag info -v rosbag2_2024_06_22-11_00_14
Files: rosbag2_2024_06_22-11_00_14_0.mcap
Bag size: 26.3 KiB
Storage id: mcap
ROS Distro: rolling
Duration: 0.10s
Start: Jun 22 2024 11:00:14.320 (1719079214.320)
End: Jun 22 2024 11:00:14.331 (1719079214.331)
Messages: 10
Topic information: Topic: /events/write_split | Type: rosbag2_interfaces/msg/WriteSplitEvent | Count: 0 | Serialization Format: cdr
Topic: /greetings | Type: example_interfaces/msg/String | Count: 0 | Serialization Format: cdr
Topic: /parameter_events | Type: rcl_interfaces/msg/ParameterEvent | Count: 0 | Serialization Format: cdr
Topic: /rosout | Type: rcl_interfaces/msg/Log | Count: 9 | Serialization Format: cdr
Topic: /some_topic | Type: std_msgs/msg/Bool | Count: 1 | Serialization Format: cdr
Service: 0
Service information: |
|
Description
On re-indexing a sqllite3 rosbag which originally contains a topic with 0 data inside (message_count:0), the metadata.yaml is not generated properly. The full topic is absent.
This bug was discovered using the python Teranis rosbags reader's library. (Confer https://gitlab.com/ternaris/rosbags/-/issues/91).
Expected Behavior
The reindex rosbag 's metadata.yaml file shall contains the topic with message_count:0
eg:
Actual Behavior
Actually, the full topic section is not present after re-index.
To Reproduce
Steps to reproduce the behavior:
ros2 bag reindex -s sqlite3 mybag
PS: This permit to re-generate the problem. In the true world, it shall permit to generate the metadata.yaml in case it has not been generated (which happens several time a day in my case.)
System (please complete the following information)
Additional context
If we place back from the original data to the re-indexed one the topic section, the python Teranis rosbags reader's library read the file properly. If not it failed. We conclude that the information shall be present inside the db3 but not reported in metadata.yaml.
The text was updated successfully, but these errors were encountered: