Skip to main content

btview

Watch your behaviour tree run — in the terminal, over SSH, on the robot.

A live monitor for BehaviorTree.CPP and Nav2 that needs no GUI, no X11, no ROS client library — just the ZMQ port your tree already publishes on.

CI Python License

btview demo

▶ Watch the 75-second tour — install, live monitoring, the line-based commands, and record/replay.


Why

Debugging a behaviour tree usually means running Groot2 on a laptop, on the same network, with a display. Robots are rarely that convenient: you are on a serial console in a lab, or SSH'd into a machine over a flaky link, or reading a bag from a run that already ended.

btview puts the tree where you already are.

pipx install git+https://github.com/guilyx/btview
btview demo        # a synthetic Nav2 robot, no hardware required
btview             # the real thing, on 127.0.0.1:1667

What it does

  • Live tree view — every node, its status, and what changed, refreshed as the tree ticks.
  • Two ways to look at it — an indented list for hunting a node, or a drawn graph (g, or --graph) for seeing which branch the robot is down. Per-node sparklines make a flapping node obvious at a glance.
  • Both wire protocols — Groot2 / BehaviorTree.CPP 4.x (Groot2Publisher, what Nav2 uses) and BehaviorTree.CPP 3.x (PublisherZMQ).
  • Works on a dumb terminal — --ascii drops every box-drawing and unicode glyph; NO_COLOR is honoured. Fine over a 9600-baud serial console.
  • More than a UI — snapshot for scripts, echo for logs and CI, export for issues and docs, record/play for after the fact.
  • No ROS dependency — pure Python over ZMQ. It does not import rclpy, and it does not care which distro you run.
  • Try before you connect — btview demo runs a synthetic Nav2 tree through the real protocol stack, so you can learn the tool (and verify your install) with no robot.

Install

pipx install git+https://github.com/guilyx/btview     # isolated, recommended
pip install git+https://github.com/guilyx/btview      # into the current environment

Python 3.9+ and nothing else — the ZMQ, Rich and Textual wheels come from PyPI. Full instructions, including ROS 2 workspaces, Docker and robots without internet access, are in docs/install.md.

Use it

On a robot running Nav2

Enable monitoring in your BT navigator, then point btview at the port:

bt_navigator:
  ros__parameters:
    enable_groot_monitoring: true
    groot_server_port: 1667
btview --host 192.168.1.42          # full-screen monitor
btview snapshot --host 192.168.1.42 # one shot, then exit

See docs/nav2.md for BehaviorTree.CPP 3.x, custom stacks, and ports.

Without a screen

btview watch --ascii                # redraw in place, ASCII only
btview echo --json | tee bt.jsonl   # one line per status change
btview snapshot --active            # only what is running or failing

Capture now, debug later

btview record -o run.btv.jsonl --duration 120   # on the robot
btview play run.btv.jsonl --speed 2             # on your laptop, same UI

Get the tree out

btview export --format mermaid -o tree.mmd   # paste into a GitHub issue
btview export --format dot | dot -Tpng > tree.png
btview show my_tree.xml                      # render a file, no server at all

Commands

Command What it is for
btview / btview tui Full-screen live monitor
btview demo Synthetic robot + monitor in one process
btview snapshot Print the tree once and exit — scriptable
btview watch Refresh in place, no alternate screen
btview echo Stream transitions, one line each (--json)
btview show FILE Render a behaviour tree XML file
btview export XML, Graphviz, Mermaid or JSON
btview info Endpoint, tree size, round-trip latency
btview blackboard Dump blackboard entries (v4 publishers)
btview record / btview play Capture a session, replay it anywhere
btview mock Serve a synthetic tree for another btview or Groot2
btview bridge Read one transport, republish on another
btview transports List the transports this build speaks

Every command takes --host, --port, --protocol v4|v3, or a --source URI. Full reference: docs/cli.md.

Transports are pluggable

The wire format and the transport are separate, so a live robot, a recording and (soon) a ROS 2 topic are interchangeable everywhere:

btview --source replay://run.btv.jsonl?speed=4
btview bridge --from btcpp3://robot:1667 --to groot2://0.0.0.0:1667  # Groot2 can watch a v3 robot

Adding a transport is one class and one decorator — docs/transports.md.

Reading the tree

[!] NavigateRecovery [RecoveryNode]                          ▶ RUNNING
├─ [=] NavigateWithReplanning [PipelineSequence]             ▶ RUNNING
│  ├─ -^- RateController                                     ▶ RUNNING
│  │  └─ [!] ComputePathToPose [RecoveryNode]                ✔ SUCCESS
│  │     ├─ --> ComputePathToPose                       · was SUCCESS
│  │     └─ --> ClearGlobalCostmap-Context                      · IDLE
│  └─ [!] FollowPath [RecoveryNode]                          ▶ RUNNING
└─ [o] RecoveryFallback [ReactiveFallback]                      · IDLE

Node-type glyphs follow py_trees convention, so they read the same in both ecosystems:

Glyph Meaning Glyph Meaning
[-] sequence ▶ running
[o] fallback ✔ success
[=] pipeline sequence ✖ failure
[!] recovery ⊘ skipped
-^- decorator · idle
--> action · was X idle, ran earlier
(?) condition

Documentation

Doc Contents
docs/install.md Install, first run, ROS 2 and offline robots
docs/cli.md Every command and flag, with examples
docs/tui.md Layout, keys, panels
docs/nav2.md Connecting to Nav2 and BehaviorTree.CPP
docs/protocol.md Groot2 v4 and BTCPP v3 wire formats
docs/transports.md Source/sink URIs, the bridge, adding a transport
docs/docker.md Container and compose usage
docs/development.md Tests, lint, the Python API

Contributing

Issues and pull requests are welcome — this is a tool for a community that mostly debugs robots without a monitor attached, so field reports are especially useful. Start with docs/development.md; pip install -e ".[dev]" && pytest is the whole setup, and no robot is needed to run the suite.

License

Apache-2.0 — see LICENSE.

Metadata

Release files for btview 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for btview 0.2.0
File Size Uploaded
btview-0.2.0.tar.gz 89.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for btview 0.2.0
File Interpreter ABI Platform
btview-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 161.5 kB

Release files / btview-0.2.0.tar.gz

Download URL btview-0.2.0.tar.gz
Size 89.9 kB
Tags Source
SHA-256 checksum
How to use checksums
06289077101d94c357c6d87623543f6a2c6037676492c943dffa1d6f4be5dcbb
BLAKE2b-256 checksum
How to use checksums
6933316870ee9c3ccc5e2ee6aa23972fe19f5153d36abb6da73f6543113f4be7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.

Transparency log

Release files / btview-0.2.0-py3-none-any.whl

Download URL btview-0.2.0-py3-none-any.whl
Size 71.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f9af245fe761a64759004d6f7ff9bf2a300a7a2718dd0c74a91d0025caccca6
BLAKE2b-256 checksum
How to use checksums
8e92af848eea6b2060b0d8e9256d308226633ab780077140beeb944947714b03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page