Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
a61d6b3
Curriculum anneal + carry-up reward: full pick-and-place from altitud…
CodCodingCode Jun 3, 2026
546129f
Indoor UAV rollout: pick-and-place over a Gaussian-splat room backdrop
CodCodingCode Jun 4, 2026
1cd138f
pick_place_env: parameterize spawn distance + render-camera resolution
CodCodingCode Jun 4, 2026
9151560
SNATCH: integrated sim-only aerial pick-and-place package (4-agent bu…
CodCodingCode Jun 4, 2026
044a660
SNATCH env: curriculum + lift/carry shaping for convergence; train --…
CodCodingCode Jun 4, 2026
97557ca
eval_snatch: --no_cams to evaluate the state-based SNATCH policy (VIO…
CodCodingCode Jun 4, 2026
a5e384b
SNATCH reward fix: dominant held-only placement (stop grab-and-fly-away)
CodCodingCode Jun 4, 2026
6a055f2
SNATCH: train with clean localization (vio/detection noise=0); eval s…
CodCodingCode Jun 4, 2026
91c8d9b
SNATCH: converge at proven spawn distance (diam 0.8/0.5) first; scale…
CodCodingCode Jun 4, 2026
040bf4a
SNATCH obs fix: include the delivery GOAL in the observation (+3 dims)
CodCodingCode Jun 4, 2026
a3bad15
SNATCH: eval metric aliases + --cur_p; converged policy + VIO-gap result
CodCodingCode Jun 4, 2026
be61d30
SNATCH: commit referenced USD sub-layers + A2 cam-smoke script; gitig…
CodCodingCode Jun 4, 2026
802c19d
SNATCH: 3rd-person render camera + render_snatch.py rollout video script
CodCodingCode Jun 4, 2026
3003b0d
SNATCH: gripper flush under body + pick off a raised table (no dangle)
CodCodingCode Jun 5, 2026
bf9d588
SNATCH: stable fixed curriculum (cur_p=0.6) to stop catastrophic forg…
CodCodingCode Jun 5, 2026
27f69b4
train_snatch: --cur_p flag for clean high-straddle demo policy
CodCodingCode Jun 5, 2026
adad8b6
SNATCH table: grounded 1.0m pedestal (rests on floor z=0->0.30, not h…
CodCodingCode Jun 5, 2026
ab9a729
SNATCH fix: anneal the hover reward so the policy must descend->grab-…
CodCodingCode Jun 5, 2026
01cfc2f
SNATCH distance curriculum + GS render caching
CodCodingCode Jun 9, 2026
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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ wandb/

# Local checkpoints are never committed.
*.pt

# GS scene/rollout caches (rebuildable, can be large) — never committed.
skyvla_isaac/gs/cache/
*.npz
.hm3d_key
.openai_key
*.log

.claude/
27 changes: 27 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,33 @@ toolkit; the user explicitly chose **not** to (preferred checkpoint + restart).
Don't propose the reinstall again unless the restart strategy starts failing in
a new way — the reinstall has a real blast radius (Isaac Lab / rsl_rl pinning).

## GS rendering is CACHED — never rebuild the splat room from scratch

The Gaussian-splat backdrop in `scripts/render_rollout_gs.py` is **static
geometry** (no policy/checkpoint dependence), so it is cached and reused — never
re-run the slow ~44-view RGB-D room orbit when a cache exists. Full reference:
[`skyvla_isaac/gs/CACHING.md`](skyvla_isaac/gs/CACHING.md).

Two caches under `skyvla_isaac/gs/cache/` (gitignored), via `gs/cache.py`:
- **scene** (`room_splat.pt`) — the splat + `K` + render W×H. Built once with
Isaac; reused every run. `render_rollout_gs.py` loads it automatically and
skips the orbit. Force a rebuild only with `--rebuild_gs` (changed room/res).
- **rollout** (`rollout_<ckpt>.npz`) — per-frame foreground + follow-cam pose for
one checkpoint. Written by `render_rollout_gs.py --save_rollout`.

**To iterate on the render/camera look, do NOT boot Isaac.** Use the Isaac-free
consumer in the `habitat` env (~1.5 ms/frame):
```bash
conda activate habitat
PYTHONUTF8=1 PYTHONPATH=/home/ubuntu/SkyVLA \
python skyvla_isaac/scripts/render_gs_cache.py \
--rollout skyvla_isaac/gs/cache/rollout_<ckpt>.npz --out videos/replay.mp4
# or orbit the bare room: render_gs_cache.py --out videos/gs_orbit.mp4
```
`PYTHONUTF8=1` is required (gsplat JITs `.cu` kernels via the locale codec). The
rollout cache is per-checkpoint; the scene cache is reused across all of them.
Clean `cache/rollout_*.npz` when done — disk is tight (see below).

## Disk hygiene

`/dev/vda1` is shared with `/tmp` and runs 90%+ full on this machine. PPO
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
128 changes: 128 additions & 0 deletions skyvla_isaac/assets/drone_snatch.urdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<?xml version="1.0"?>
<!--
SNATCH drone — Z-UP free-flying quadrotor with a SINGLE-DOF caging gripper.

Derived from the proven drone_with_gripper.urdf, with two deliberate changes
required by the SNATCH BOM (one jaw servo, no lowering DOF):

* REMOVED the `lower` prismatic joint and the `arm` link entirely. The four
cage fingers now mount DIRECTLY / rigidly under the base via fixed joints;
the drone descends *bodily* to grasp.
* The ONLY movable joints are the 4 jaw-close prismatic joints
(grip_xl/grip_xr/grip_yl/grip_yr). One policy "gripper" action drives all
four symmetrically (single-DOF cage).

Two camera MOUNT frames are added as fixed links:
* cam_top — forward-facing (+X), on the top plate (RealSense, depth fwd)
* cam_bottom — downward-facing (-Z), under the base (Pi-cam, depth down)

Collision is ONLY on base + the 4 fingers. Booms / rotors / cameras are
visual-only so they don't snag the cube or the ground.

Geometry note: in the proven design the fingers sat at world Z = -0.03 (arm
joint) + -0.30 (finger joint) = -0.33 below base center. We keep that exact
fingertip depth by mounting the fingers at z=-0.33 directly off the base, and
keep the open ~8 cm / closed-on-5cm-cube cage that reliably grasps.
-->
<robot name="drone_snatch">

<material name="body"><color rgba="0.13 0.14 0.18 1"/></material>
<material name="boom"><color rgba="0.20 0.20 0.24 1"/></material>
<material name="rotor"><color rgba="0.30 0.55 0.95 0.9"/></material>
<material name="cammat"><color rgba="0.10 0.80 0.30 1"/></material>
<material name="grip"><color rgba="0.95 0.55 0.10 1"/></material>

<!-- central hub (flat box) -->
<link name="base">
<visual><geometry><box size="0.14 0.14 0.05"/></geometry><material name="body"/></visual>
<collision><geometry><box size="0.14 0.14 0.05"/></geometry></collision>
<!-- realistic rotational inertia for a 1.5 kg quad with ~0.42 m booms.
ixx/iyy ~0.012, izz ~0.022 resists the gripper's reaction torque. -->
<inertial><mass value="1.5"/><inertia ixx="1.2e-2" iyy="1.2e-2" izz="2.2e-2" ixy="0" ixz="0" iyz="0"/></inertial>
</link>

<!-- crossed booms in the horizontal X-Y plane (visual only) -->
<link name="boom_x"><visual><geometry><box size="0.42 0.025 0.02"/></geometry><material name="boom"/></visual></link>
<joint name="j_boom_x" type="fixed"><parent link="base"/><child link="boom_x"/><origin xyz="0 0 0.01"/></joint>
<link name="boom_y"><visual><geometry><box size="0.025 0.42 0.02"/></geometry><material name="boom"/></visual></link>
<joint name="j_boom_y" type="fixed"><parent link="base"/><child link="boom_y"/><origin xyz="0 0 0.01"/></joint>

<!-- four rotor disks (flat horizontal disks; visual only) -->
<link name="rotor_xp"><visual><geometry><cylinder radius="0.10" length="0.012"/></geometry><material name="rotor"/></visual></link>
<joint name="j_rxp" type="fixed"><parent link="base"/><child link="rotor_xp"/><origin xyz="0.21 0 0.03"/></joint>
<link name="rotor_xn"><visual><geometry><cylinder radius="0.10" length="0.012"/></geometry><material name="rotor"/></visual></link>
<joint name="j_rxn" type="fixed"><parent link="base"/><child link="rotor_xn"/><origin xyz="-0.21 0 0.03"/></joint>
<link name="rotor_yp"><visual><geometry><cylinder radius="0.10" length="0.012"/></geometry><material name="rotor"/></visual></link>
<joint name="j_ryp" type="fixed"><parent link="base"/><child link="rotor_yp"/><origin xyz="0 0.21 0.03"/></joint>
<link name="rotor_yn"><visual><geometry><cylinder radius="0.10" length="0.012"/></geometry><material name="rotor"/></visual></link>
<joint name="j_ryn" type="fixed"><parent link="base"/><child link="rotor_yn"/><origin xyz="0 -0.21 0.03"/></joint>

<!-- ============ camera MOUNT frames (visual-only, no collision) ============ -->
<!-- top: forward-facing (+X), sits on the top plate. The frame's local +Z is
world +Z here; the camera sensor cfg (Agent A2) applies its own optical
convention relative to this mount. Visual is a small green box marker. -->
<link name="cam_top">
<visual><geometry><box size="0.03 0.05 0.02"/></geometry><material name="cammat"/></visual>
<inertial><mass value="0.005"/><inertia ixx="1e-6" iyy="1e-6" izz="1e-6" ixy="0" ixz="0" iyz="0"/></inertial>
</link>
<joint name="j_cam_top" type="fixed">
<parent link="base"/><child link="cam_top"/><origin xyz="0.07 0 0.04" rpy="0 0 0"/>
</joint>

<!-- bottom: downward-facing (-Z), under the base. Small green box marker. -->
<link name="cam_bottom">
<visual><geometry><box size="0.03 0.03 0.015"/></geometry><material name="cammat"/></visual>
<inertial><mass value="0.005"/><inertia ixx="1e-6" iyy="1e-6" izz="1e-6" ixy="0" ixz="0" iyz="0"/></inertial>
</link>
<joint name="j_cam_bottom" type="fixed">
<parent link="base"/><child link="cam_bottom"/><origin xyz="0 0 -0.03" rpy="0 0 0"/>
</joint>

<!-- ============ 4-JAW CAGE: mounted RIGIDLY under the base (no lower DOF) ============
Walls close on all four sides (X and Y) so a free cube gets boxed in and
cannot squirt out. Open ~8 cm, closed they press the 5 cm cube's four
faces -> caged + force closure. The cage mounts DIRECTLY under the body
(center at z=-0.07, just below the base bottom at -0.025) -- NOT dangled
on a long standoff. The drone descends bodily to ~0.095 m to grasp a
floor cube; grasp point = base - 0.07. -->
<link name="finger_xl">
<visual><geometry><box size="0.012 0.07 0.05"/></geometry><material name="grip"/></visual>
<collision><geometry><box size="0.012 0.07 0.05"/></geometry></collision>
<inertial><mass value="0.02"/><inertia ixx="1e-6" iyy="1e-6" izz="1e-6" ixy="0" ixz="0" iyz="0"/></inertial>
</link>
<joint name="grip_xl" type="prismatic">
<parent link="base"/><child link="finger_xl"/><origin xyz="0.04 0 -0.07"/><axis xyz="-1 0 0"/>
<limit lower="0.0" upper="0.02" effort="40" velocity="1.0"/>
</joint>

<link name="finger_xr">
<visual><geometry><box size="0.012 0.07 0.05"/></geometry><material name="grip"/></visual>
<collision><geometry><box size="0.012 0.07 0.05"/></geometry></collision>
<inertial><mass value="0.02"/><inertia ixx="1e-6" iyy="1e-6" izz="1e-6" ixy="0" ixz="0" iyz="0"/></inertial>
</link>
<joint name="grip_xr" type="prismatic">
<parent link="base"/><child link="finger_xr"/><origin xyz="-0.04 0 -0.07"/><axis xyz="1 0 0"/>
<limit lower="0.0" upper="0.02" effort="40" velocity="1.0"/>
</joint>

<link name="finger_yl">
<visual><geometry><box size="0.07 0.012 0.05"/></geometry><material name="grip"/></visual>
<collision><geometry><box size="0.07 0.012 0.05"/></geometry></collision>
<inertial><mass value="0.02"/><inertia ixx="1e-6" iyy="1e-6" izz="1e-6" ixy="0" ixz="0" iyz="0"/></inertial>
</link>
<joint name="grip_yl" type="prismatic">
<parent link="base"/><child link="finger_yl"/><origin xyz="0 0.04 -0.07"/><axis xyz="0 -1 0"/>
<limit lower="0.0" upper="0.02" effort="40" velocity="1.0"/>
</joint>

<link name="finger_yr">
<visual><geometry><box size="0.07 0.012 0.05"/></geometry><material name="grip"/></visual>
<collision><geometry><box size="0.07 0.012 0.05"/></geometry></collision>
<inertial><mass value="0.02"/><inertia ixx="1e-6" iyy="1e-6" izz="1e-6" ixy="0" ixz="0" iyz="0"/></inertial>
</link>
<joint name="grip_yr" type="prismatic">
<parent link="base"/><child link="finger_yr"/><origin xyz="0 -0.04 -0.07"/><axis xyz="0 1 0"/>
<limit lower="0.0" upper="0.02" effort="40" velocity="1.0"/>
</joint>

</robot>
88 changes: 88 additions & 0 deletions skyvla_isaac/gs/CACHING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# GS rendering cache — render & test the splat scene FAST

**TL;DR — never rebuild the Gaussian-splat room you already built.** The room is
static geometry; cache it once and reuse it. Then re-render videos with **no Isaac
Sim at all**.

This is the canonical reference for how GS-backdrop rendering is cached. The
machinery lives in [`gs/cache.py`](cache.py) (+ `GaussianMap.state_dict` /
`from_state_dict` in [`gs/gaussian_map.py`](gaussian_map.py)).

## Why

`render_rollout_gs.py` used to do this on **every** run:

1. Boot Isaac Sim (~30–60 s).
2. **Rebuild the splat room**: a ~44-view RGB-D orbit (88 `sim.step(render=True)`
calls) + fusion — slow, and *identical every run* because the room doesn't
depend on the policy/checkpoint.
3. Roll out the policy and composite the live drone+cube over the splat.

Steps 2 (always) and even 1+3 (when only the look changes) are wasted work when
you're iterating. Caching kills them.

## The two caches

| Cache | File | Holds | Built by | Skips |
|-------|------|-------|----------|-------|
| **scene** | `cache/room_splat.pt` | the splat (`GaussianMap`) + `K` + render W×H | `render_rollout_gs.py` (once) | the 44-view room orbit |
| **rollout** | `cache/rollout_<ckpt>.npz` | per-frame foreground RGBA + follow-cam pose, for one checkpoint | `render_rollout_gs.py --save_rollout` | **all of Isaac** on re-render |

Both live under `skyvla_isaac/gs/cache/` (gitignored). Writes are atomic
(tmp + `os.replace`) and format-versioned, so a stale/half-written cache is
rejected, not silently mis-rendered. A measured GS render is **~1.5 ms/frame**
at 720×540, so a 450-frame backdrop renders in <1 s once the scene is loaded.

## How to use

### 1. Build it once (Isaac, slow — do this a single time per room)
```bash
conda activate isaac
OMNI_KIT_ACCEPT_EULA=YES PYTHONUTF8=1 PYTHONPATH=/home/ubuntu/SkyVLA \
python skyvla_isaac/scripts/render_rollout_gs.py \
--checkpoint logs/isaac/drone_pick_place/model_5999.pt \
--out videos/isaac_pickplace_gs.mp4 \
--save_rollout # also cache the rollout for Isaac-free replay
```
First run builds **and saves** `cache/room_splat.pt`. Every later run **loads** it
and skips the orbit automatically. Use `--rebuild_gs` to force a fresh orbit (e.g.
you changed the room geometry or the render resolution).

### 2. Re-render FAST, no Isaac (the iteration loop)
```bash
conda activate habitat # any env with torch + gsplat (no Isaac needed)
PYTHONUTF8=1 PYTHONPATH=/home/ubuntu/SkyVLA \
python skyvla_isaac/scripts/render_gs_cache.py \
--rollout skyvla_isaac/gs/cache/rollout_model_5999.npz \
--out videos/replay.mp4
```
Re-composites the cached drone+cube over the cached splat — change `--fps`,
`--fill R G B`, `--cover_thresh` and re-render in seconds.

Orbit the bare room to sanity-check the scene (no rollout needed):
```bash
python skyvla_isaac/scripts/render_gs_cache.py --out videos/gs_orbit.mp4 \
--steps 180 --radius 2.6 --height 1.6 --look_z 1.2
```

## Flags added to `render_rollout_gs.py`
- `--gs_cache PATH` — scene-cache path (default `cache/room_splat.pt`).
- `--rebuild_gs` — force a fresh room orbit even if the cache exists.
- `--save_rollout` — also write the rollout cache for Isaac-free replay.
- `--rollout_cache PATH` — rollout-cache path (default `cache/rollout_<ckpt>.npz`).

## Gotchas
- **Resolution must match.** The scene cache stores the W×H it was captured at.
If you change `cfg.cam_w/cam_h`, rebuild with `--rebuild_gs` (you'll get a WARN
otherwise).
- **Rollout cache is per-checkpoint.** A new policy needs a fresh rollout
(re-run with `--save_rollout`); the *scene* cache is reused across all of them.
- **Disk.** `/dev/vda1` is tight on this host (see top-level `CLAUDE.md`). The
rollout `.npz` compresses well (background is zeroed before saving) but a long
450-frame run is still tens of MB — `rm skyvla_isaac/gs/cache/rollout_*.npz`
when done. The scene cache is small (hundreds of KB).
- **`PYTHONUTF8=1`** — gsplat JIT-compiles its CUDA kernels on first use; torch
reads the `.cu` sources with the locale codec and crashes without UTF-8.
- **Programmatic use:** `from skyvla_isaac.gs import save_scene, load_scene,
save_rollout, load_rollout` (or `GaussianMap.state_dict()` /
`GaussianMap.from_state_dict(sd, device)` for just the splat).
20 changes: 19 additions & 1 deletion skyvla_isaac/gs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,23 @@
`pip install gsplat` — builds against torch 2.12+cu13.)
"""
from .gaussian_map import GaussianMap
from . import cache
from .cache import (
DEFAULT_SCENE,
default_rollout_path,
load_rollout,
load_scene,
save_rollout,
save_scene,
)

__all__ = ["GaussianMap"]
__all__ = [
"GaussianMap",
"cache",
"DEFAULT_SCENE",
"default_rollout_path",
"save_scene",
"load_scene",
"save_rollout",
"load_rollout",
]
Loading
Loading