Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
b2ee303
Require the expected height between stacked cubes
maxkra15 Nov 17, 2026
ef7b124
Add state-based Franka cube stacking with PPO
maxkra15 Nov 17, 2026
e76e2be
Preserve the default stack height tolerance
maxkra15 Nov 17, 2026
2ac85f6
Merge commit 'e76e2bec30e361fcb2b4c5a2923eec6f20f1d2b9' into maximili…
maxkra15 Nov 17, 2026
6b4a6a2
Document the Franka stack progress reward
maxkra15 Nov 17, 2026
611d070
Exercise the configured Franka stack termination
maxkra15 Nov 17, 2026
9ab2bfb
Keep the existing stack tasks on their configured height checks
maxkra15 Nov 17, 2026
6170121
Bring the opt-in height check into the PPO slice
maxkra15 Nov 17, 2026
eef1c81
Scope strict stacking geometry to the new PPO task
maxkra15 Nov 17, 2026
a5e126f
Award stacking success at the episode limit
maxkra15 Nov 17, 2026
0b4e267
Merge commit '1ed6fd166fa5a74f8a740ca1e282bfba87d82121' into maximili…
maxkra15 Nov 17, 2026
e716b60
Merge commit '1ed6fd166' into maximiliank/franka-stack-ppo
maxkra15 Nov 17, 2026
ced1fda
Restore Franka stacking resets and adaptive sampling
maxkra15 Nov 17, 2026
3872fae
Merge commit 'ced1fda5ca0d46a12c1371e49ab552cb9cd128f9' into maximili…
maxkra15 Nov 17, 2026
d957b34
Restore the full Franka state stacking policy
maxkra15 Nov 17, 2026
8e37573
Add camera PPO and distillation for Franka stacking
maxkra15 Nov 17, 2026
68f218d
Reuse shape visibility already provided by the spawner
maxkra15 Nov 17, 2026
c215696
Document Franka cube stacking training and resets
maxkra15 Nov 17, 2026
ef718cd
Include the state task and training documentation
maxkra15 Nov 17, 2026
4b6de16
Reuse manager-resolved parameters for Franka resets
maxkra15 Nov 17, 2026
23c4060
Document the Franka camera training variants
maxkra15 Nov 17, 2026
78b4bb9
Report Franka stack success on the terminating step
maxkra15 Nov 17, 2026
6737a61
Test prior-row credit through the stack reset managers
maxkra15 Nov 17, 2026
74b990a
Restore the Franka base with the selected reset state
maxkra15 Nov 17, 2026
fdcb112
Match Franka teacher labels to configured action clipping
maxkra15 Nov 17, 2026
ae96e4c
Include reviewed Franka reset state ownership
maxkra15 Nov 17, 2026
ffa28b2
Use one event to restore the Franka stack
maxkra15 Nov 17, 2026
00a9682
Include reviewed state task and reset ownership
maxkra15 Nov 17, 2026
360b426
Clarify the teacher checkpoint required for camera distillation
maxkra15 Nov 17, 2026
14363a4
Use the live table sampling probability
maxkra15 Nov 17, 2026
0f15c6d
Include live curriculum sample weighting
maxkra15 Nov 17, 2026
3c9d60f
Verify selected base poses include environment origins
maxkra15 Nov 17, 2026
8778168
Include the complete reset manager regression
maxkra15 Nov 17, 2026
4d58963
Synchronize the complete Franka simulator stack
maxkra15 Nov 17, 2026
c9601b2
Preserve contact-safe Franka grasps during reset noise
maxkra15 Nov 18, 2026
f0bf3a2
Address Franka state stacking review findings
maxkra15 Nov 18, 2026
0c4b4d7
Honor the configured Franka reset workspace
maxkra15 Nov 18, 2026
6590371
Include reviewed Franka state and workspace changes
maxkra15 Nov 18, 2026
a80630e
Include the reviewed Franka reset fixes
maxkra15 Nov 18, 2026
c3f5ce3
Derive Franka camera calibration from the configured pose
maxkra15 Nov 18, 2026
0172666
Synchronize all stacking review follow-ups
maxkra15 Nov 18, 2026
0f5d4c6
chore: Merge main into PR #9072
maxkra15 Nov 18, 2026
5f8f470
chore: Merge main into PR #9073
maxkra15 Nov 18, 2026
37e9b30
chore: Merge main into PR #9075
maxkra15 Nov 18, 2026
1379e9d
chore: Merge main into PR #9075
maxkra15 Nov 19, 2026
6a40b11
chore: Merge main into PR #9073
maxkra15 Nov 19, 2026
3604b92
chore: Merge main into PR #9072
maxkra15 Nov 19, 2026
2d6d8a5
Merge main into PR #9072
maxkra15 Nov 20, 2026
b463933
Merge main into PR #9073
maxkra15 Nov 20, 2026
dfa9fa0
Merge main into PR #9075
maxkra15 Nov 20, 2026
7ab153a
Merge main into Franka stacking PR #9072
maxkra15 Nov 20, 2026
96e19a4
Merge the updated reset curriculum into Franka state PPO
maxkra15 Nov 20, 2026
5fc5d8c
Merge the updated state task into Franka camera training
maxkra15 Nov 20, 2026
42c30cd
Reuse native reset-state APIs for Franka stacking
maxkra15 Nov 20, 2026
b712ad5
Use native Franka resets and keep the strict task-local stack check
maxkra15 Nov 20, 2026
968eee7
Sync native Franka reset changes into PR #9075
maxkra15 Nov 20, 2026
59689ba
Merge main into PR #9075
maxkra15 Nov 23, 2026
8b6b110
Merge main into PR #9075
maxkra15 Nov 24, 2026
3ec8b5e
Merge main into PR #9075
maxkra15 Nov 25, 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
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ Table of Contents
source/isaaclab/ecosystem
source/isaaclab/installation
source/isaaclab/environments
source/isaaclab/contrib_stacking
source/isaaclab/quickstart
source/isaaclab/tutorial
source/isaaclab/demos
Expand Down
3 changes: 3 additions & 0 deletions docs/source/_static/css/environment-browser.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

82 changes: 82 additions & 0 deletions docs/source/isaaclab/contrib_stacking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
.. Copyright (c) 2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
.. All rights reserved.
..
.. SPDX-License-Identifier: BSD-3-Clause

Franka cube stacking
====================

``IsaacContrib-Stack-Cube-Franka-RL`` trains an RSL-RL PPO policy to stack three
4 cm cubes with Newton MJWarp. It uses the standard Franka asset's MuJoCo
physics variant and passive mimic finger. The actor observes robot state and
cube state in reset-assigned role order. Success requires a stable tower and
a released gripper.

Reset curriculum
----------------

A reset event builds a bank of validated full-scene states. The bank includes
table starts and intermediate pick, transport, placement, and release states.
Restoring a row writes the robot state, cube poses, zero velocities, and
matching actuator targets. Held cubes follow the reset pose of the hand.
Cube colors are permuted across the physical roles.

The curriculum records each completed outcome against its previous row before
the reset event selects a replacement. Training draws 35% of starts from the
table and uses the remaining starts for intermediate states, weighted toward
50% recent success. Progress used for sampling and final stack success are
tracked separately. Play mode samples randomized table starts.

To test a specific phase, configure the reset event before creating the
environment:

.. code-block:: python

from isaaclab_tasks.contrib.stack import mdp
from isaaclab_tasks.utils import parse_env_cfg

cfg = parse_env_cfg("IsaacContrib-Stack-Cube-Franka-RL", num_envs=4)
cfg.curriculum = None
cfg.events.reset_from_state_buffer.params["fixed_recipe"] = int(mdp.StackResetRecipe.FIRST_PICK)

Training and playback
---------------------

.. code-block:: bash

uv run --extra rsl-rl isaaclab train --rl_library rsl_rl --task IsaacContrib-Stack-Cube-Franka-RL physics=newton_mjwarp
uv run --extra rsl-rl isaaclab play --rl_library rsl_rl --task IsaacContrib-Stack-Cube-Franka-RL \
--checkpoint /path/to/model.pt --num_envs 1 --visualizer newton_gl physics=newton_mjwarp

The state actor uses a fixed 100-input observation order. The flat asset's
MuJoCo physics variant and passive finger change the dynamics relative to
earlier stack runs. Revalidate earlier checkpoints against the current task.

Camera PPO and distillation
---------------------------

``IsaacContrib-Stack-Cube-Franka-RL-Camera`` trains PPO with one fixed
128 × 128 RGB camera and robot proprioception. Its actor uses the camera
and robot signals. The critic also observes the simulator state. Training
varies camera calibration at startup and image appearance between episodes.
The variant uses a fixed role-to-color assignment so the visual student can
identify the intended stacking order.

``IsaacContrib-Stack-Cube-Franka-RL-Camera-Distillation`` trains the same camera
actor using a compatible state PPO checkpoint as its frozen teacher.
Teacher labels use the same action clipping as the student. The teacher
uses the state task's 100-input observation order, so older 109-input
checkpoints require retraining. Add ``--checkpoint`` with the path to the
teacher when starting distillation from the environment browser's base
training command.

.. code-block:: bash

uv run --extra rsl-rl isaaclab train --rl_library rsl_rl --task IsaacContrib-Stack-Cube-Franka-RL-Camera \
physics=newton_mjwarp renderer=newton_renderer
uv run --extra rsl-rl isaaclab train --rl_library rsl_rl --task IsaacContrib-Stack-Cube-Franka-RL-Camera-Distillation \
--checkpoint /path/to/teacher.pt physics=newton_mjwarp renderer=newton_renderer

The camera image is channel-first RGB scaled by ``1 / 255``. Checkpoint
observation order, image size, and policy distribution must match the
selected task and its agent configuration.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Added RGB-based Franka cube stacking with asymmetric PPO and distillation from the state-based PPO teacher.
Empty file.
2 changes: 2 additions & 0 deletions source/isaaclab_tasks/changelog.d/franka-stack-ppo.added.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Added Franka state-policy cube stacking on Newton MJWarp with RSL-RL PPO, bounded relative arm control,
and a stable released-stack objective. Preserved the published state policy's observation order.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Added validated phase-specific Franka cube-stacking resets using the shared reset-state APIs,
with a curriculum that retains table starts alongside starts sampled from recent outcomes.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,41 @@
disable_env_checker=True,
)

gym.register(
id="IsaacContrib-Stack-Cube-Franka-RL",
entry_point="isaaclab.envs:ManagerBasedRLEnv",
kwargs={
"env_cfg_entry_point": f"{__name__}.stack_rl_env_cfg:FrankaCubeStackRLEnvCfg",
"rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:FrankaStackPPORunnerCfg",
"default_agent": "rsl_rl",
},
disable_env_checker=True,
)

gym.register(
id="IsaacContrib-Stack-Cube-Franka-RL-Camera",
entry_point="isaaclab.envs:ManagerBasedRLEnv",
kwargs={
"env_cfg_entry_point": f"{__name__}.stack_camera_rl_env_cfg:FrankaCubeStackCameraRLEnvCfg",
"rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_camera_ppo_cfg:FrankaStackCameraPPORunnerCfg",
"default_agent": "rsl_rl",
},
disable_env_checker=True,
)

gym.register(
id="IsaacContrib-Stack-Cube-Franka-RL-Camera-Distillation",
entry_point="isaaclab.envs:ManagerBasedRLEnv",
kwargs={
"env_cfg_entry_point": f"{__name__}.stack_camera_rl_env_cfg:FrankaCubeStackCameraRLEnvCfg",
"rsl_rl_cfg_entry_point": (
f"{agents.__name__}.rsl_rl_distillation_cfg:FrankaStackCameraDistillationRunnerCfg"
),
"default_agent": "rsl_rl",
},
disable_env_checker=True,
)

gym.register(
id="IsaacContrib-Stack-Cube-Instance-Randomize-Franka",
entry_point="isaaclab.envs:ManagerBasedRLEnv",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

"""Action clipping for Franka stack distillation."""

from __future__ import annotations

from typing import TYPE_CHECKING, cast

import torch
from rsl_rl.algorithms import Distillation
from tensordict import TensorDict

if TYPE_CHECKING:
from rsl_rl.env import VecEnv

from isaaclab_rl.rsl_rl import RslRlVecEnvWrapper


class ClippedTeacherDistillation(Distillation):
"""Match teacher labels to the stack runner's action bounds."""

_clip_actions: float | None

@staticmethod
def construct_algorithm(obs: TensorDict, env: VecEnv, cfg: dict, device: str) -> ClippedTeacherDistillation:
"""Build the distillation algorithm using the training wrapper's action bound."""
algorithm = cast(ClippedTeacherDistillation, Distillation.construct_algorithm(obs, env, cfg, device))
algorithm._clip_actions = cast("RslRlVecEnvWrapper", env).clip_actions
return algorithm

def act(self, obs: TensorDict) -> torch.Tensor:
"""Collect a student action and clamp its teacher label to the action contract."""
actions = super().act(obs)
if self._clip_actions is not None:
self.transition.privileged_actions = self.transition.privileged_actions.clamp(
-self._clip_actions, self._clip_actions
)
return actions
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

"""RSL-RL PPO configuration for RGB-based Franka stacking."""

from isaaclab.utils import configclass

from isaaclab_rl.rsl_rl import RslRlCNNModelCfg, RslRlMLPModelCfg

from .rsl_rl_ppo_cfg import ALGORITHM_CFG, FrankaStackPPORunnerCfg

CAMERA_POLICY_CFG = RslRlCNNModelCfg(
hidden_dims=[512, 256, 128],
activation="elu",
obs_normalization=True,
distribution_cfg=RslRlMLPModelCfg.GaussianDistributionCfg(
init_std=0.2,
std_range=(0.05, 0.3),
std_type="log",
),
cnn_cfg=RslRlCNNModelCfg.CNNCfg(
output_channels=[16, 32, 32],
kernel_size=[8, 4, 3],
stride=[4, 2, 1],
activation="elu",
),
)


@configclass
class FrankaStackCameraPPORunnerCfg(FrankaStackPPORunnerCfg):
"""Use RGB and proprioception for the actor and state for the critic."""

max_iterations = 15000
save_interval = 50
experiment_name = "franka_stack_camera"
obs_groups = {"actor": ["policy", "base_image"], "critic": ["privileged"]}
actor = CAMERA_POLICY_CFG
# Use a smaller learning rate and more samples per mini-batch for the visual encoder.
algorithm = ALGORITHM_CFG.replace(
entropy_coef=0.005,
num_mini_batches=8,
learning_rate=7.0e-5,
schedule="fixed",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

"""RSL-RL teacher-student distillation for camera-based Franka stacking."""

from isaaclab.utils import configclass

from isaaclab_rl.rsl_rl import RslRlDistillationAlgorithmCfg, RslRlDistillationRunnerCfg, RslRlMLPModelCfg

from .rsl_rl_camera_ppo_cfg import CAMERA_POLICY_CFG
from .rsl_rl_ppo_cfg import STATE_POLICY_CFG


@configclass
class FrankaStackCameraDistillationRunnerCfg(RslRlDistillationRunnerCfg):
"""Distill the state-based PPO actor into an RGB and proprioception policy."""

num_steps_per_env = 8
# Reset-table curricula need a complete first outcome for every row.
init_at_random_ep_len = False
max_iterations = 3000
save_interval = 50
experiment_name = "franka_stack_camera_distillation"
clip_actions = 1.0
obs_groups = {
"student": ["policy", "base_image"],
"teacher": ["privileged"],
}
# A small Gaussian makes RSL-RL collect teacher labels at states visited
# by the student while keeping the architecture identical to camera PPO.
student = CAMERA_POLICY_CFG.replace(
distribution_cfg=RslRlMLPModelCfg.GaussianDistributionCfg(
init_std=0.1,
std_range=(0.05, 0.3),
std_type="log",
),
)
# Keep this architecture identical to the state actor so a PPO checkpoint
# can be loaded as the frozen teacher with strict state-dict validation.
teacher = STATE_POLICY_CFG
algorithm = RslRlDistillationAlgorithmCfg(
class_name="isaaclab_tasks.contrib.stack.config.franka.agents.distillation:ClippedTeacherDistillation",
num_learning_epochs=2,
learning_rate=1.0e-4,
gradient_length=1,
max_grad_norm=1.0,
loss_type="mse",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

"""RSL-RL configurations for state-based Franka stacking."""

from isaaclab.utils import configclass

from isaaclab_rl.rsl_rl import (
RslRlMLPModelCfg,
RslRlOnPolicyRunnerCfg,
RslRlPpoAlgorithmCfg,
)

STATE_EXPLORATION_CFG = RslRlMLPModelCfg.GaussianDistributionCfg(
init_std=0.2,
std_range=(0.05, 0.3),
std_type="scalar",
)

STATE_POLICY_CFG = RslRlMLPModelCfg(
hidden_dims=[512, 256, 128],
activation="elu",
obs_normalization=True,
distribution_cfg=STATE_EXPLORATION_CFG,
)

STATE_CRITIC_CFG = RslRlMLPModelCfg(
hidden_dims=[512, 256, 128],
activation="elu",
obs_normalization=True,
)

ALGORITHM_CFG = RslRlPpoAlgorithmCfg(
value_loss_coef=1.0,
use_clipped_value_loss=True,
clip_param=0.2,
entropy_coef=0.001,
num_learning_epochs=5,
num_mini_batches=16,
learning_rate=1.0e-4,
schedule="fixed",
# At 50 Hz, the full two-pick sequence needs a longer effective horizon
# than the manipulation-task default.
gamma=0.999,
lam=0.95,
desired_kl=0.01,
max_grad_norm=1.0,
)


@configclass
class FrankaStackPPORunnerCfg(RslRlOnPolicyRunnerCfg):
"""PPO configuration for order-invariant three-cube Franka stacking."""

num_steps_per_env = 32
# Reset-table curricula need a complete first outcome for every row.
init_at_random_ep_len = False
max_iterations = 7000
save_interval = 25
experiment_name = "franka_stack"
clip_actions = 1.0
obs_groups = {"actor": ["policy"], "critic": ["policy"]}
actor = STATE_POLICY_CFG
critic = STATE_CRITIC_CFG
algorithm = ALGORITHM_CFG
Loading
Loading