Operator TUI

Welcome to the Motion-Stack Operator — a simple, text-based terminal user interface for interactively driving your robot’s legs, joints, wheels, and inverse-kinematics via ROS 2. This guide will walk you through launching, and basic usage of the TUI (textual user interface) and the keyboard inputs.

Quick Start

Launch the operator

From the ~/Motion-Stack/ directory:

bash launch_operator.bash

Enjoy the TUI

You’ll see a simple terminal menu and a floating window.
  • The TUI (terminal) is unable to move any joint by itself, it only selects modes, changes behaviors and displays state.

  • The floating (red) window intercepts keyboard-strokes only when focused by the OS (click on it to focus). These strokes will move joints.

  • PS4 controller inputs will move joints.

TUI Overview

When you launch the operator, the screen is divided into:

  • Header:

  • Mode shows your current menu (main, leg_select, joint_select, etc.).

  • Legs shows which legs are selected (green) vs. unselected (red).

  • Body: the menu or controls for the current mode.

  • Footer (“Logs”): the last few status messages (leg discovery, errors, recover/halt calls, etc.).

Controls & Keybindings

TUI Navigation

| Key / Mouse           | Action                                           |
|-----------------------|--------------------------------------------------|
| **↑ / ↓**             | Move focus up/down through menus or lists        |
| **← / →**             | Move focus left/right between columns in grids   |
| **Enter / Space**     | Activate a button or toggle a checkbox           |
| **Mouse Left-Click**  | Click buttons / toggle checkboxes                |
| **Mouse Right-Click** | Toggle **reverse** for joints in joint and wheel modes|

Drive Mode Keybindings

| Mode           | Keys               | Description                                |
|----------------|--------------------|--------------------------------------------|
| **Leg Select** | ↓ or **l**         | Select **all** legs               |
|                | 1–9                | Select that numbered leg                   |
| **Joint Mode** and **Wheel Mode**   | **w** / **s**      | Positive / negative joint velocity |
|                | **0**              | Send selected joints to zero position      |
|                | **o** / **l**      | Wheels forward / backward                  |
|                | **p**              | Stop all wheels                            |
| **IK Mode**    | Gamepad sticks & triggers | Cartesian end-effector control    |
|                | **x** / **o**      | Toggle IK frame: base-relative / ee-relative |

Recover & Halt Commands

| Key                 | Action                         |
|---------------------|--------------------------------|
| **Enter**           | Recover **selected** legs      |
| **Shift + Enter**   | Recover **all** legs           |
| **Space**           | Halt **selected** legs         |
| **Shift + Space**   | Halt **all** legs              |

Customizing & Extensions

Robot-specific subclasses

Create your own OperatorNode in a separate package to add:
  • New services (Recover/Halt)

  • Other operational modes

  • Additional keybindings

Environment variable

Set the OPERATOR environment variable e.g. export OPERATOR=operator1 to use a namespace and avoid interferences with other operators on the network.

Troubleshooting

No legs discovered?
  • Check your /legN/joint_alive services are running.

Buttons unresponsive
  • Ensure your keyboard (or joystick) topic namespace matches OPERATOR.