Skip to content

mcap filter can break Foxglove User Scripts #1454

@philsc

Description

@philsc

Description

I'm trying to cut the size of an MCAP file down to a small size. This is the command I'm using:

$ mcap filter --start-secs 6114 --end-secs 6144 --include-topic-regex '.*' --output /home/philipp.schrader/logs/pro-35553/from_stop_increase.before.trimmed.mcap /home/philipp.schrader/logs/pro-35553/from_stop_increase.before.mcap

The command finishes successfully and I can look at the trimmed MCAP file.

The problem comes from mcap filter appearing to drop topics that have no messages during the specified time range.
This means that User Scripts on Foxglove stop working, erroring out with messages like this:

Type '"/spray/a brt.vpu.planner.PlannerDebug"' does not satisfy the constraint 'keyof MessageTypeByTopic'.
'event.message' is of type 'unknown'.
Parameter 'command' implicitly has an 'any' type.
Parameter 'index' implicitly has an 'any' type.
'event.message' is of type 'unknown'.
Parameter 'command' implicitly has an 'any' type.
Parameter 'index' implicitly has an 'any' type.
'event.message' is of type 'unknown'.
  • Version:
$ mcap version
v0.0.54
  • Platform:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.5 LTS
Release:        22.04
Codename:       jammy

Steps To Reproduce

Trim a log file in a range where a topic doesn't have any messages.
This also happens with topics that never had any messages to begin with.

Expected Behavior

I would expect the empty channels to be present.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions