Skip to content

Add team player tui#882

Open
ayin21 wants to merge 33 commits into
mainfrom
feature/teamplayer_tui
Open

Add team player tui#882
ayin21 wants to merge 33 commits into
mainfrom
feature/teamplayer_tui

Conversation

@ayin21
Copy link
Copy Markdown
Contributor

@ayin21 ayin21 commented Jun 1, 2026

Adds Teamplayer orchestration tui/CLI.

As this is build in rust I used to chance to do it properly and port/extend the bitbots_cargo that was forgotten on another branch. This allows us to also build the bitbots_rust_nav / now bitbots_global_planner in the normal colcon build process. Also ports the very simple extrinsic calibration node to rust to show the ROS bindings.

Screenshot_20260605_191758_JuiceSSH.jpg

Screenshot_20260605_192101_JuiceSSH.jpg

Screenshot_20260605_191842_JuiceSSH.jpg

Screenshot_20260605_192025_JuiceSSH.jpg

ayin21 and others added 27 commits June 1, 2026 21:07
- Add bitbots_misc/bitbots_bringup/tui to root cargo workspace
- Build teamplayer binary via cmake add_custom_target (cargo build --package)
  so colcon installs it to lib/bitbots_bringup/teamplayer
- Switch pixi teamplayer task from cargo run to ros2 run bitbots_bringup teamplayer
- Update ratatui to 0.30 and pin crossterm to 0.28 (unifies ratatui version
  across workspace, fixes ansi-to-tui type conflict)
- Fix deprecated Frame::size() -> Frame::area() in ui.rs
- Add rust >= 1.88 to ros pixi feature (ratatui 0.30 requires 1.86+)
- Remove bitbots_rust_test demo package
- Remove tui/Cargo.lock (now tracked at workspace root)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces pixi-build-python+maturin with a cmake package that builds the
pyo3 extension via cargo and installs it to
lib/pythonX.Y/site-packages/ in the colcon install prefix.

This makes the extension discoverable via source install/setup.bash on
robots without a pixi environment, matching how all other Python ROS2
packages in this workspace are installed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Unset MAKEFLAGS and MFLAGS before invoking cargo so it does not attempt
to connect to make's jobserver (inherited via cmake but inaccessible as
a subprocess). Applied to bitbots_cargo.cmake.in (r2r_cargo template),
bitbots_bringup, and bitbots_rust_nav.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Renames directory, crate, package, and Python module. Updates the
import in bitbots_path_planning/planner.py accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
These were for the old pixi-build-python+maturin build path.
The package is now built entirely via ament_cmake/colcon.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cargo_pyo3_extension([PACKAGE <crate>])
  Builds a pyo3 cdylib and installs it flat into site-packages so
  `import <pkg>` works after sourcing install/setup.bash.

cargo_binary(<binary> [PACKAGE <crate>])
  Builds a Rust binary (crate defaults to binary name) and installs it
  to lib/${PROJECT_NAME}/ for `ros2 run`.

Refactor bitbots_global_planner and bitbots_bringup to use these
functions, reducing each CMakeLists.txt to a single call.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Each of r2r_cargo(), cargo_pyo3_extension(), and cargo_binary() now
registers a ctest test under BUILD_TESTING that runs `cargo test
--package <pkg>`, making Rust unit tests visible to colcon test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
These were missing from the CMakeLists.txt after the C++ → Rust rewrite,
causing ros2 launch to fail finding the launch files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
debug = true adds debug info to the release build at no runtime cost,
giving readable backtraces and debugger support on deployed binaries.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Child stdout and stderr were both written to teamplayer's stdout,
making it impossible for log aggregators to distinguish errors.

Add HeadlessLine enum and a single shared headless_log queue. Both
pumps push tagged lines into the same queue in arrival order, preserving
stdout/stderr interleaving. The headless drain dispatches Stdout to
println! and Stderr to eprintln!.

TUI mode is unchanged — all_logs still receives the merged [ERR]-prefixed
stream for display in the log panels.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Flova and others added 2 commits June 5, 2026 01:30
motion.launch: add lowlevel arg (default true) with nested group guard.
TUI always passes lowlevel:=false; Lowlevel component manages it.

Config navigation:
- Left/Right navigate the flags row and between grid columns.
- Down/Up are row-aware: Down from any flag jumps to first component;
  Up from top of left column → Zenoh, top of right column → DsdFile.

Runtime sidebar navigation (replaces v toggle):
- Right: show sidebar if hidden; open AllLogs full screen if already shown.
- Left: hide sidebar.

AllLogs screen: full-screen joined log with scrollbar and follow mode.
Log views: scrollbar widget, auto-follow with f/G, yellow hint when scrolled.
Confirm dialogs: Clear popup, 6-row sizing, confirm/cancel hint.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ScrollbarState content_length was set to total lines instead of
total - viewport_height, so the thumb could never reach the bottom.

Add log_viewport_height (Cell<usize>) to App. The draw functions write
the actual viewport height on each frame; scroll_keys reads it to clamp
log_scroll to max_scroll = log_len - viewport_height. This eliminates
the silent dead zone where Down presses had no visual effect.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jaagut jaagut moved this from 🆕 New to 👀 In review in Software Jun 5, 2026
@jaagut
Copy link
Copy Markdown
Member

jaagut commented Jun 5, 2026

feature/teamplayer_tui  pixi run teamplayer
✨ Pixi task (teamplayer in default): ros2 run bitbots_bringup teamplayer: (Launch the main software components)
No executable found

@Flova
Copy link
Copy Markdown
Member

Flova commented Jun 5, 2026

Clean build?

Flova and others added 2 commits June 5, 2026 19:06
Dead code since config_focus_next/prev were rewritten to be row-aware.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ents

pixi.toml: move rust >=1.88 from feature.ros to base dependencies so
cargo is available in all environments (format, robot, etc.).

.pre-commit-config.yaml: remove --diff from ruff-format so it fixes
files in place instead of just reporting differences.

TUI: row-aware config navigation, AllLogs screen, scrollbar fixes,
confirm dialogs, sidebar Left/Right toggle, lowlevel double-launch fix.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Flova
Copy link
Copy Markdown
Member

Flova commented Jun 5, 2026

I also pushed some fixes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

3 participants