Skip to content

Add dora topic subcommand#1178

Merged
phil-opp merged 22 commits intodora-rs:mainfrom
Mivik:topic
Nov 12, 2025
Merged

Add dora topic subcommand#1178
phil-opp merged 22 commits intodora-rs:mainfrom
Mivik:topic

Conversation

@Mivik
Copy link
Copy Markdown
Contributor

@Mivik Mivik commented Nov 2, 2025

Description

This PR introduces a dora topic subcommand to inspect node outputs, inspired by rostopic.

Three subcommands are included:

  • topic list: Lists all available topics in a dataflow. Both table and JSON formats are supported.
  • topic echo: Subscribes to a topic and prints the received data to the console. Uses arrow-json to serialize arrow messages into JSON strings. Both table and JSON formats are supported.
  • topic hz: Subscribes to a topic and displays the frequency of messages. Uses ratatui to render realtime table TUI.

Backward Compatibility

The coordinator has been updated to store dataflow descriptors and provide them to the CLI.

@haixuanTao
Copy link
Copy Markdown
Collaborator

Could you add any documentation and example on how to use this?

git2 = { workspace = true, optional = true }
fs_extra = "1.3.0"
splitty = "1.0.2"
zenoh = { workspace = true, optional = true }
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be good to put it somewhere else than core because every time we modify core, including dependency we add breaking changes and cannot make backward compatibility as it is tied to dora messages

Copy link
Copy Markdown
Collaborator

@haixuanTao haixuanTao Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there might be a bigger issue that is to separate dora-core and dora-messages @phil-opp

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the other way around: The underlying crate is dora-message, which defines the message formats used for communicating between the different components. Whenever we update dora-message in a backwards-incompatible way, we need to bump it's minor version to avoid parsing errors. This then requires updating all Dora components together.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this change is fine with me. It's even behind an optional feature, so it's also included if exclititly enabled.

@haixuanTao
Copy link
Copy Markdown
Collaborator

haixuanTao commented Nov 5, 2025

Starting to look great!

Could we format the documentation a little bit better though:

dora topic hz --help

Gives me:

Examples: - Measure a single topic: `dora topic hz -d my-dataflow robot1/pose` - Measure
multiple topics with a short window: `dora topic hz -d my-dataflow robot1/pose robot2/vel
--window 5` - Measure all topics: `dora topic hz -d my-dataflow --window 10`

Note: Requires `_unstable_debug.publish_all_messages_to_zenoh: true` in the dataflow
descriptor so runtime messages are available for inspection.

is really hard to read.

Could we also use:


_unstable_debug:
  publish_all_messages_to_zenoh: true

Instead of _unstable_debug.publish_all_messages_to_zenoh: true

@phil-opp
Copy link
Copy Markdown
Collaborator

phil-opp commented Nov 5, 2025

Thanks a lot for this PR! Nice features!

@phil-opp
Copy link
Copy Markdown
Collaborator

phil-opp commented Nov 5, 2025

I'm not sure if topic is the best name here. I understand that this is because it's inspired by rostopic, but we typically don't talk about "topics" in Dora. Maybe something like dora outputs would fit our terminology better? E.g. dora outputs echo and dora outputs hz?

Copy link
Copy Markdown
Collaborator

@phil-opp phil-opp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates!

@phil-opp phil-opp merged commit 82edf64 into dora-rs:main Nov 12, 2025
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants