File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ uv tool install pybag-sdk
1717
1818## Quick Start
1919
20+ ### CLI
21+
2022``` bash
2123# Get file information
2224pybag info data.mcap
@@ -28,6 +30,26 @@ pybag filter data.mcap -o output.mcap --include-topic /camera
2830pybag merge input1.mcap input2.mcap -o output.mcap
2931```
3032
33+ ### Unified Reader
34+
35+ The ` Reader ` class provides a common interface for reading both MCAP and ROS 1 bag files.
36+
37+ The file format is automatically detected from the file extension.
38+
39+ ``` python
40+ from pybag import Reader
41+
42+ # Works with both .mcap and .bag files
43+ with Reader.from_file(" data.mcap" ) as reader:
44+ for msg in reader.messages(" /camera" ):
45+ print (msg.log_time, msg.data)
46+
47+ # Same API for ROS 1 bag files
48+ with Reader.from_file(" data.bag" ) as reader:
49+ for msg in reader.messages(" /sensor/*" ): # glob patterns supported
50+ print (msg.topic, msg.msg_type, msg.data)
51+ ```
52+
3153### Reading MCAP Files
3254
3355``` python
You can’t perform that action at this time.
0 commit comments