Skip to content

Commit 7013857

Browse files
committed
docs: Add event CLI documentation to README
Document the new event command and its subcommands: - event list: List events with optional filtering - event add: Add events to MCAP files (appends in place) - event delete: Remove events from MCAP files - event clip: Extract MCAP portion around an event timestamp
1 parent 40326c3 commit 7013857

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,3 +276,51 @@ pybag inspect channels recording.mcap --topic "/camera/*"
276276
pybag inspect metadata recording.mcap --name "calibration"
277277
pybag inspect attachments recording.mcap --name "calib.yaml" --data
278278
```
279+
280+
### event
281+
282+
Manage events in MCAP files. Events are markers that indicate when something
283+
significant happens in the recording (e.g., collisions, waypoints, incidents).
284+
Events are stored as metadata records.
285+
286+
**List events:**
287+
288+
```bash
289+
pybag event list recording.mcap
290+
pybag event list recording.mcap --name "collision"
291+
pybag event list recording.mcap --json
292+
```
293+
294+
**Add events (appends in place):**
295+
296+
```bash
297+
pybag event add recording.mcap "collision" 10.5
298+
pybag event add recording.mcap "start" 0.0 --description "Recording started"
299+
pybag event add recording.mcap "waypoint" 25.0 --extra waypoint_id=42
300+
```
301+
302+
**Delete events:**
303+
304+
```bash
305+
pybag event delete recording.mcap -o cleaned.mcap
306+
pybag event delete recording.mcap --name "collision" -o cleaned.mcap
307+
pybag event delete recording.mcap --start-time 5.0 --end-time 10.0 -o cleaned.mcap
308+
```
309+
310+
**Clip around an event:**
311+
312+
Extract a portion of the recording centered on an event's timestamp:
313+
314+
```bash
315+
# Clip 5s before and 10s after the event
316+
pybag event clip recording.mcap "collision" --before 5 --after 10
317+
318+
# Symmetric: 3s before AND after (only specify one)
319+
pybag event clip recording.mcap "incident" --before 3
320+
321+
# Default: 5s before and after
322+
pybag event clip recording.mcap "start"
323+
324+
# With topic filtering
325+
pybag event clip recording.mcap "crash" --include-topic "/camera/*" -o clip.mcap
326+
```

0 commit comments

Comments
 (0)