Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/concepts/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ The shipping configuration is a **two-machine tethered split**. The
same colcon workspace is installed (and built from the same pixi lock
file) on both machines; each launch boots only the subset of nodes
that belongs on its side. Single-machine sim/dev paths
(`bar_bringup_lite/mujoco.launch.py`, `bar_description_lite/view_lite.launch.py`,
(`bar_bringup_lite/mujoco.launch.py`, `bar_bringup_lite/view_lite.launch.py`,
`bar_bringup_lite/calibrate.launch.py`) are unaffected — they
collapse both sides into one process tree.

Expand Down
2 changes: 1 addition & 1 deletion docs/concepts/mit_command_surface.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ projects. Three properties make it the right primitive:

The five command interfaces and three state interfaces are declared
per-joint inside each `<ros2_control>` block. From
`bar_description_lite/urdf/lite.ros2_control.xacro`:
`lite_description/robots/lite_dummy/xacro/lite_dummy.ros2_control.xacro`:

```xml
<joint name="${name}">
Expand Down
5 changes: 2 additions & 3 deletions docs/getting_started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ platforms = ["linux-64", "linux-aarch64"]
# `view` / `viz` launches.
ros-jazzy-ros-base = "*"
# The whole Lite bringup: bar_controllers (ONNX-enabled), bar_msgs,
# bar_description_lite, bar_robstride, bar_socketcan, bar_common, bar_policy.
# lite_description, bar_robstride, bar_socketcan, bar_common, bar_policy.
ros-jazzy-bar-bringup-lite = "*"
# Optional: the `bar` diagnostic CLI (run via `ros2 run bar_cli bar ...`).
ros-jazzy-bar-cli = "*"
Expand Down Expand Up @@ -227,15 +227,14 @@ ros2 control list_hardware_interfaces 2>/dev/null \
|| echo "(no controller_manager running yet — expected)"
```

The 12 `bar_ros2` packages:
The 11 `bar_ros2` packages (Lite's `lite_description` comes separately, via `bar.repos`):

```
bar_bringup_lite
bar_bringup_prime
bar_cli
bar_common
bar_controllers
bar_description_lite
bar_description_prime
bar_robstride
bar_sito
Expand Down
4 changes: 2 additions & 2 deletions docs/getting_started/lite_101.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The simplest possible launch: `robot_state_publisher` + a
the kinematic chain.

```sh
ros2 launch bar_description_lite view_lite.launch.py
ros2 launch bar_bringup_lite view_lite.launch.py
```

What you'll see:
Expand Down Expand Up @@ -225,7 +225,7 @@ Four moving pieces, all worth recognising for the rest of the docs:

| Piece | What it does |
|---|---|
| **URDF** (`bar_description_lite`) | Kinematic + dynamic description. Same file across mock / sim / real — the `<ros2_control>` `<plugin>` is the only difference. |
| **URDF** (`lite_description`) | Kinematic + dynamic description. Same file across mock / sim / real — the `<ros2_control>` `<plugin>` is the only difference. |
| **`controller_manager`** | Hosts the hardware plugin + every controller. The "tick loop" of the system. Update rate 50 Hz here. |
| **Mode-FSM controllers** (`bar_controllers`) | Five plugins, one active at a time. `zero_torque` (safe default), `damping` (compliant fail-safe), `standby` (interpolate to a pose), `rl_policy` (in-process ONNX — the System 0 learned-policy tier), `remote_policy` (System 1/2 external-command ingress for non-real-time `MITCommand` sources). |
| **MuJoCo / Robstride** (the simulation / real backend) | Where the MIT torque actually gets applied. Same five command interfaces in both. |
Expand Down
25 changes: 17 additions & 8 deletions docs/how_to/add_new_joint.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,21 @@ Five files in three packages:

| File | Purpose |
|---|---|
| `bar_description_lite/urdf/lite.urdf.xacro` | Kinematic chain: link, joint axis, limits, mass, mesh |
| `bar_description_lite/urdf/lite.ros2_control.xacro` | `<ros2_control>` block — which CAN bus, model, direction, command/state interfaces |
| `bar_description_lite/mjcf/lite.xml` | MuJoCo model (if you want sim parity) |
| `lite_description/robots/lite_dummy/xacro/lite_dummy.urdf.xacro` | Kinematic chain: link, joint axis, limits, mass, mesh |
| `lite_description/robots/lite_dummy/xacro/lite_dummy.ros2_control.xacro` | `<ros2_control>` block — which CAN bus, model, direction, command/state interfaces |
| `lite_description/robots/lite_dummy/mjcf/lite_dummy.xml` | MuJoCo model (if you want sim parity) |
| `bar_controllers/config/bar_lite_controllers.yaml` | `joints:` list for every controller + per-joint K/D / standby pose entries |
| `bar_bringup_lite/config/calibration.yaml` | `homing_offset` for the new joint (created via [Calibrate the zero pose](./calibrate_zero_pose.md)) |

> **Heads-up — the Lite description is generated.** The three `lite_description`
> files above are build artifacts of the external
> [`Lite-Description`](https://github.com/Berkeley-Humanoids/Lite-Description) repo,
> produced from Onshape CAD. The canonical way to add a joint is to edit
> `robots/lite_dummy/cad/*` there, run `robot-assets-generate lite_dummy`, and bump
> the `lite_description` pin in `bar.repos` — **not** to hand-edit the committed
> `xacro` / `urdf` / `mjcf`. The steps below describe the URDF changes the
> generator ultimately produces.

## Step 1 — Add the link + joint to `lite.urdf.xacro`

```xml
Expand Down Expand Up @@ -53,16 +62,16 @@ separate `can_interface_neck`).
The neck case wants a third block:

```xml
<xacro:macro name="lite_neck_joints" params="use_fake_hardware use_sim">
<xacro:lite_joint name="neck_yaw" can_id="31" model="rs-00" direction="1"
<xacro:macro name="lite_dummy_neck_joints" params="use_fake_hardware use_sim">
<xacro:lite_dummy_joint name="neck_yaw" can_id="31" model="rs-00" direction="1"
lower_limit="-0.785" upper_limit="0.785"
torque_limit="10" current_limit="14"
use_fake_hardware="${use_fake_hardware}" use_sim="${use_sim}"/>
<xacro:lite_joint name="neck_roll" can_id="32" model="rs-00" direction="1"
<xacro:lite_dummy_joint name="neck_roll" can_id="32" model="rs-00" direction="1"
lower_limit="-0.524" upper_limit="0.524"
torque_limit="10" current_limit="14"
use_fake_hardware="${use_fake_hardware}" use_sim="${use_sim}"/>
<xacro:lite_joint name="neck_pitch" can_id="33" model="rs-00" direction="1"
<xacro:lite_dummy_joint name="neck_pitch" can_id="33" model="rs-00" direction="1"
lower_limit="-0.524" upper_limit="0.524"
torque_limit="10" current_limit="14"
use_fake_hardware="${use_fake_hardware}" use_sim="${use_sim}"/>
Expand All @@ -76,7 +85,7 @@ macro inside the existing combined block.
Verify the URDF expands cleanly (inside `pixi shell`):

```bash
xacro $(ros2 pkg prefix bar_description_lite)/share/bar_description_lite/urdf/lite.urdf.xacro \
xacro $(ros2 pkg prefix lite_description)/share/lite_description/robots/lite_dummy/xacro/lite_dummy.urdf.xacro \
use_fake_hardware:=false use_sim:=false calibration_file:='' \
> /tmp/expanded.urdf
```
Expand Down
2 changes: 1 addition & 1 deletion docs/how_to/live_viz.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ per-`/lite/joint_states` callback + a tf update.

| Symptom | Cause |
|---|---|
| Window opens but robot is blank / collapsed | Mesh `package://` URLs not resolving. Make sure `bar_description_lite`'s install is on `AMENT_PREFIX_PATH` (pixi activation does this automatically once you `pixi shell` into `bar_ws/`). |
| Window opens but robot is blank / collapsed | Mesh `package://` URLs not resolving. Make sure `lite_description`'s install is on `AMENT_PREFIX_PATH` (pixi activation does this automatically once you `pixi shell` into `bar_ws/`). |
| `rerun_viz` says `ModuleNotFoundError: No module named 'rerun'` | The pixi env wasn't entered — run `cd bar_ws && pixi shell` first, then `ros2 run bar_bringup_lite rerun_viz`. |
| `viser_viz` complains about a missing `scipy` symbol | Stale env. Re-run `pixi install` to resync against `pixi.lock`. |
| Browser at `:8080` shows "this site can't be reached" | `viser_viz` not running — start it via `ros2 launch bar_bringup_lite viz.launch.py` (default viewer is `viser`), or wrong host in the URL. |
Expand Down
2 changes: 1 addition & 1 deletion docs/how_to/use_pixi_tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ extra arguments after the alias are forwarded unchanged.

| Alias | Equivalent | Side |
|---|---|---|
| `pixi run view` | `ros2 launch bar_description_lite view_lite.launch.py` | dev — URDF inspector |
| `pixi run view` | `ros2 launch bar_bringup_lite view_lite.launch.py` | dev — URDF inspector |
| `pixi run launch-mujoco` | `ros2 launch bar_bringup_lite mujoco.launch.py` | dev — full Lite controller stack in MuJoCo |
| `pixi run launch-real` | `ros2 launch bar_bringup_lite real.launch.py` | robot — real-hardware Lite bringup |
| `pixi run launch-viz` | `ros2 launch bar_bringup_lite viz.launch.py` | host — live URDF + joint-state viewer (`viewer:=viser\|rerun`) |
Expand Down
39 changes: 24 additions & 15 deletions docs/reference/hardware_specs.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,16 @@ policy is trained against this order, it is frozen — see "Frozen schemas" in
`neck_pitch`, all rs-00-class with `K_p ≈ 30`, `K_d ≈ 1`.)

:::tip[Where these numbers come from]
Per-joint static config (CAN id, model, direction, position limits, torque
cap, current cap) is the **single source of truth** in
[`bar_description_lite/urdf/lite.ros2_control.xacro`](https://github.com/T-K-233/bar_ros2/blob/main/bar_description_lite/urdf/lite.ros2_control.xacro).
Each value appears once, as a xacro arg on the `lite_joint` macro call:
Per-joint hardware facts (CAN id, model, direction, torque cap, current cap)
live in the CAD input
[`robots/lite_dummy/cad/ros2_control.json`](https://github.com/Berkeley-Humanoids/Lite-Description/blob/main/robots/lite_dummy/cad/ros2_control.json);
position limits come from the URDF (also from CAD). The generator expands both
into the `<param>`s of the **generated** `lite_dummy.ros2_control.xacro` — each
value appears as a xacro arg on a `lite_dummy_joint` macro call (don't hand-edit
the generated file):

```xml
<xacro:lite_joint name="left_shoulder_pitch" can_id="11" model="rs-02" direction="-1"
<xacro:lite_dummy_joint name="left_shoulder_pitch" can_id="11" model="rs-02" direction="-1"
lower_limit="-3.141592653589793" upper_limit="0.7853981633974483"
torque_limit="17" current_limit="27"
use_fake_hardware="${use_fake_hardware}" use_sim="${use_sim}"/>
Expand All @@ -62,7 +65,7 @@ xacro expands those into `<param>` children on the `<joint>` element, which
the Robstride parameter IDs `0x700B` and `0x7018` — same writes the upstream
`T-K-233/Lite-Lowlevel-Python`'s `humanoid_control/control.py` performs).
Initial values were mirrored from that repo's `configs/bimanual.yaml`; if
upstream retunes, edit them here in lockstep.
upstream retunes, edit `ros2_control.json` and regenerate (see below).

Default stiffness / damping reflects a conservative MIT-mode setting suitable
for first activation; tune per deployment.
Expand All @@ -76,26 +79,32 @@ them, regardless of what a policy publishes. They're an upper bound, not a
target. Lower them when bringing up a new policy on the bench; raise them
once the motion envelope is verified.

**Edit-rebuild loop**:
**Edit-rebuild loop** — the caps live in the CAD input, so the retune happens in
the `lite_description` repo and flows back through `bar.repos`:

1. Open `bar_description_lite/urdf/lite.ros2_control.xacro`.
2. Find the `<xacro:lite_joint name="<joint>" …>` call for the joint you
want to retune (one per arm in `lite_left_arm_joints` /
`lite_right_arm_joints` macros).
3. Edit the `torque_limit="…"` (N·m, float) and / or `current_limit="…"`
(A, float) attributes in place.
4. Rebuild and re-launch:
1. In the `lite_description` repo, edit the joint's `torque_limit` (N·m, float)
and / or `current_limit` (A, float) in `robots/lite_dummy/cad/ros2_control.json`.
2. Regenerate the xacro: `uv run robot-assets-generate lite_dummy --only xacro`.
3. Commit + push; bump the `lite_description` pin in `bar_ros2`'s `bar.repos`
(keep the buildfarm's in sync).
4. Re-import, rebuild, and re-launch:

```sh
cd <workspace>/bar_ws
pixi shell
colcon build --symlink-install --packages-select bar_description_lite
pixi run setup # vcs import — pulls the regenerated lite_description
colcon build --symlink-install --packages-select lite_description
# If a bringup is already running, Ctrl+C it first — the firmware-side
# caps are written on the `on_activate` transition, so an already-
# activated plugin won't pick up the new value until the next bringup.
ros2 launch bar_bringup_lite real.launch.py
```

For a throwaway bench experiment, edit the caps directly in the vcs-imported
`src/lite_description/.../lite_dummy.ros2_control.xacro` and `colcon build` —
but that copy is overwritten on the next `pixi run setup`, so fold any keeper
change back into `ros2_control.json` upstream.

5. Confirm in the bringup log that the new value flowed through:

```
Expand Down
14 changes: 7 additions & 7 deletions docs/reference/launch_args.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ bundled launch enables that path.
Launches live in two repos:

- `bar_ros2` ships the Lite + Prime control-plane bringups (`bar_bringup_lite`,
`bar_bringup_prime`), the URDF inspector (`bar_description_lite`),
`bar_bringup_prime`), the URDF inspector (`bar_bringup_lite`),
and the policy prepare-and-load launches (`bar_policy`).
- `pianist_ros2` ships piano-task-specific launches: scene composition
(`pianist_bringup`), the piano prepare-and-load launch, and the USB-MIDI
driver (both `pianist_policy`).

## `bar_description_lite/launch/view_lite.launch.py`
## `bar_bringup_lite/launch/view_lite.launch.py`

URDF inspector — no controller_manager, no physics.

Expand Down Expand Up @@ -108,14 +108,14 @@ plugin).
|---|---|---|
| `mode` | `arms` | Same as the real bringup. `arms` (14 joints) or `arms_neck` (17 joints). |
| `hardware_config` | `<bundled lite_hardware.yaml>` | Same as the real bringup; the bus mapping is unused in MuJoCo but the joint list is read. |
| `scene` | `lite` | MJCF scene basename under `bar_description_lite/mjcf/`. Default `lite` (robot only). Task packages from sibling repos (e.g. `pianist_ros2`'s `pianist_bringup`) compose their own runtime scene XML and override this arg with their composed-file basename. |
| `scene` | `lite_dummy` | MJCF scene basename under `lite_description/robots/lite_dummy/mjcf/`. Default `lite_dummy` (robot only). Task packages from sibling repos (e.g. `pianist_ros2`'s `pianist_bringup`) compose their own runtime scene XML and override this arg with their composed-file basename. |
| `enable_gamepad` | `true` | Same hard-fail-on-missing-`/dev/input/js*` behaviour as the real bringup. |

Implicit:

- The xacro is invoked with `use_sim:=true`. **`use_sim` wins over
`use_fake_hardware`** in the xacro's `<plugin>` selector — see the
decision tree in [Packages](packages.md#bar_description_lite--bar_description_prime).
decision tree in [Packages](packages.md#lite_description-external--bar_description_prime).
- Every node runs with `use_sim_time:=true`. Time advances at MuJoCo's
pace via `/clock`.
- `bar_bringup_lite/config/sim_overrides.yaml` is layered on top of
Expand Down Expand Up @@ -204,7 +204,7 @@ apart.

MuJoCo bringup for the piano task. Composes the Lite robot and the
piano MJCF into one scene file (`_runtime_lite_piano.xml`) inside
`bar_description_lite`'s MJCF share dir, then delegates to
`lite_description`'s `robots/lite_dummy/mjcf/` share dir, then delegates to
`bar_bringup_lite/mujoco.launch.py` with `scene:=_runtime_lite_piano`.
Also spawns the `piano_state_bridge` sim-side bridge so
`/piano/key_state` exists on the sim path.
Expand All @@ -217,7 +217,7 @@ Also spawns the `piano_state_bridge` sim-side bridge so

`scene:=` is **not** exposed — `pianist_bringup` controls that internally.

## xacro args (`bar_description_lite/urdf/lite.urdf.xacro`)
## xacro args (`lite_description/robots/lite_dummy/xacro/lite_dummy.urdf.xacro`)

The launch args ultimately feed these xacro args. Useful when driving
xacro directly (e.g. in a sim2sim eval harness):
Expand All @@ -241,7 +241,7 @@ robot involved, no tether):

```sh
# Drag joints in RViz, no controllers.
ros2 launch bar_description_lite view_lite.launch.py
ros2 launch bar_bringup_lite view_lite.launch.py

# MuJoCo physics, /clock from sim time.
ros2 launch bar_bringup_lite mujoco.launch.py
Expand Down
27 changes: 16 additions & 11 deletions docs/reference/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,26 @@ wire conventions only** — no participant/transport.
The `lite_sdk2` SDK builds its publisher/subscriber layer on top. See
[Talk to bar_ros2 from Python](../how_to/talk_to_bar_ros2_from_python.md).

### `bar_description_lite` / `bar_description_prime`
### `lite_description` (external) / `bar_description_prime`

URDF / xacro / meshes / `<ros2_control>` blocks.
URDF / xacro / meshes / `<ros2_control>` blocks. **Lite's description is no longer
in `bar_ros2`** — it lives in the external, CAD-generated
[`lite_description`](https://github.com/Berkeley-Humanoids/Lite-Description) repo
(bar deploys the `lite_dummy` variant), pulled in via `bar.repos`. It is
**asset-only**: the RViz inspector (`view_lite.launch.py` + `view_lite.rviz`) now
lives in `bar_bringup_lite`. `bar_description_prime` is still an in-tree stub.

Layout (Lite shown):
Layout (Lite shown, inside the `lite_description` repo):

```
bar_description_lite/
├── urdf/
│ ├── lite.urdf.xacro # top-level kinematics (mode-aware: 14 or 17 joints)
── lite.ros2_control.xacro # 3-way plugin selector + per-joint static config
├── meshes/ *.stl # visual meshes
├── mjcf/ lite.xml # MuJoCo physics model
├── config/ view_lite.rviz # RViz config
└── launch/ view_lite.launch.py # standalone visualization
lite_description/robots/lite_dummy/
├── xacro/
│ ├── lite_dummy.urdf.xacro # top-level assembly: args + includes + instantiation
── lite_dummy.ros2_control.xacro # 3-way plugin selector + per-joint static config
│ └── lite_dummy.description.xacro # kinematics macro (base_link, mesh_root)
├── urdf/ lite_dummy.urdf # flat URDF — the generated kinematic hub
├── mjcf/ lite_dummy.xml # MuJoCo physics model
└── meshes/visual/ *.stl # visual meshes
```

The xacro selects between **three hardware backends** via args:
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/quick_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Grouped by which machine they run on. See
for the split rationale. Launches come from two repos:

- `bar_ros2` ships the Lite + Prime bringups (`bar_bringup_lite`,
`bar_bringup_prime`), the description viewer (`bar_description_lite`),
`bar_bringup_prime`), the description viewer (`bar_bringup_lite`),
and the policy prepare-and-load launch (`bar_policy`).
- `pianist_ros2` ships the piano-task launches (`pianist_bringup`
composes a Lite + piano MuJoCo scene; `pianist_policy` prepares the
Expand All @@ -33,7 +33,7 @@ for the split rationale. Launches come from two repos:

```bash
# Drag joints in RViz — no controllers, no physics
ros2 launch bar_description_lite view_lite.launch.py
ros2 launch bar_bringup_lite view_lite.launch.py

# MuJoCo sim — full controller stack, /clock from sim time
ros2 launch bar_bringup_lite mujoco.launch.py
Expand Down
Loading
Loading