Skip to content

Draw deployments with goby interface, optionally as D2, and check launch files against them - #57

Merged
tsaubergine merged 3 commits into
use-necessityfrom
interface-d2-figures
Nov 12, 2026
Merged

tsaubergine merged 3 commits into
use-necessityfrom
interface-d2-figures

Conversation

@tsaubergine

Copy link
Copy Markdown
Member

Stacked on #56.

Summary

  • D2 figures: new build_interface_figures_d2 option (OFF by default). With export_goby_interfaces=ON, each deployment is also written as share/interfaces/figures/<name>_interfaces.d2. When the d2 program is found it's rendered to .svg; otherwise the .d2 files are written and a status message says they weren't rendered.
  • goby interface visualize: now draws the existing Graphviz PDFs, replacing goby_clang_tool -viz. The PDF names are unchanged. The UDPM and Zenoh examples now get figures too; Zenoh only when it's built.
  • run: deployments: the deployment files list what each platform runs, with the arguments and config files from the matching .launch files, instead of listing interfaces: files.
    • gobyd and goby_mavlink_gateway are found by name in Goby's own interfaces, so the @GOBY_INTERFACES_DIR@ configure step is gone.
    • goby launch hold_deployment.yml -x -I build/share/interfaces starts an example straight from its deployment file.
    • The GPS controller is listed with enabled: false because the README has you start it by hand.
    • Duplicate subscribers, which the launch files start twice to show more than one subscriber, are listed once.
  • goby interface launch_check tests: a goby3_example_launch_<name>_<platform> test compares each hand-written .launch file with its deployment's run: list. The .launch files are unchanged.
  • Validation: goby interface validate --strict now runs on every listed deployment, not only those with test harnesses.
  • Docs: README has a new "Interface files, figures and checks" section, and test/README.md is updated. .gitignore ignores the .<deployment>.launch files that goby launch writes.

Dependencies

These need a goby that has goby interface: visualize/validate from GobySoft/goby3#446 and GobySoft/goby3#448, D2 from GobySoft/goby3#451, launch_check and goby launch <deployment>.yml from GobySoft/goby3#458. With an older goby, export_goby_interfaces=ON builds the interface files but skips the figures and checks, and prints a status message. CI doesn't set export_goby_interfaces, so it's unaffected.

Test plan

  • Built against the goby3 interface-* branches with export_goby_interfaces=ON enable_tests=ON build_interface_figures_d2=ON. All 10 deployments are drawn as PDF and D2. d2 isn't installed here, so SVG rendering wasn't exercised.
  • ctest -R "goby3_example_(interfaces|launch)": 21/21 pass, covering 10 validations and 11 launch-file checks.
  • launch_check fails (exit 1) on a copy of hold.launch with gobyd removed and an extra line added. It reports not-launched gobyd and launched-only goby_logger.
  • The README's goby interface explain and goby launch commands work as written.
  • Configuring with default options is unchanged.

Generated by Claude Code

@tsaubergine
tsaubergine added this pull request to stack #58 November 11, 2026 23:43
…nch files against them

The deployment files list what each platform runs (run:) instead of
naming interface files, with the arguments and configuration of their
launch files, so 'goby launch <deployment>.yml' can start an example.

With export_goby_interfaces, each deployment is drawn with 'goby interface
visualize' into share/interfaces/figures/<name>_interfaces.pdf, now
including the UDPM and Zenoh examples. build_interface_figures_d2 also
writes each as a D2 diagram, rendered to SVG when d2 is found.

With enable_tests, every listed deployment is validated (not just those
with a test harness), and goby3_example_launch_<name>_<platform> runs
'goby interface launch_check' on its hand-written launch files.

All of this needs a goby with 'goby interface'; with an older one the
figures and checks are skipped with a status message.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TCmHEtuYatVV6nSaJPTa6z
…h keys

The deployment files' run: entries carry launch keys (args, config,
hold, enabled) that 'goby interface' reads only from the version that
added 'goby interface launch'. An earlier one rejected them, failing the
build while drawing the figures; the configure step now tries one such
entry and skips the figures and checks with a status message instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TCmHEtuYatVV6nSaJPTa6z
Deleting build/share/interfaces/figures left the drawing step nothing to
write into until CMake was rerun.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TCmHEtuYatVV6nSaJPTa6z
@tsaubergine
tsaubergine merged commit bcdc302 into main Nov 12, 2026
5 checks passed
@tsaubergine
tsaubergine deleted the interface-d2-figures branch November 12, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants