Skip to content
Open
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
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Guidelines for modifications:
* Chenyu Cao
* Chenyu Yang
* Connor Smith
* Curie Park
* CY (Chien-Ying) Chen
* David Cao-Mueller
* David Leon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,41 @@ First, launch the training with a small number of environments and visualization
--num_envs 4 \
--visualizer kit

This will open the Isaac Sim viewer where you can observe the training process in real-time.
.. tab-item:: Flexiv Rizon 4s + Grav (Newton)

.. tab-set::

.. tab-item:: uv (Recommended)

.. code-block:: bash

uv run isaaclab train --rl_library rsl_rl \
--task IsaacContrib-Deploy-GearAssembly-Rizon4s-Grav \
--num_envs 2 \
--visualizer newton \
presets=newton_hydroelastic

.. tab-item:: isaaclab.sh / isaaclab.bat

.. code-block:: bash

./isaaclab.sh train --rl_library rsl_rl \
--task IsaacContrib-Deploy-GearAssembly-Rizon4s-Grav \
--num_envs 2 \
--visualizer newton \
presets=newton_hydroelastic

Use ``presets=newton_sdf`` to compare point-SDF contacts. To train a task-space
policy, use the ``IsaacContrib-Deploy-GearAssembly-Rizon4s-Grav-Newton-IK`` task
with the same Newton preset.

The centered SDF assets can also be tested with PhysX by using
``presets=physx_sdf`` on the ``IsaacContrib-Deploy-GearAssembly-Rizon4s-Grav``
task. The default PhysX preset retains the legacy Factory assets and frame conventions
for existing checkpoints.

This opens the selected viewer (Isaac Sim for PhysX or Newton Viewer for Newton) so you can
observe the training process in real time.

.. figure:: ../../_static/policy_deployment/02_gear_assembly/sim_real_gear_assembly_train.jpg
:align: center
Expand Down Expand Up @@ -820,10 +854,59 @@ Now launch the full training run with more parallel environments in headless mod
--num_envs 256 \
--video --video_length 200 --video_interval 76800

.. tab-item:: Flexiv Rizon 4s + Grav (Newton)

.. tab-set::

.. tab-item:: uv (Recommended)

.. code-block:: bash

uv run isaaclab train --rl_library rsl_rl \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-generated review — Important: this is under “Full-Scale Training with Video Recording,” but the Newton command does not pass --video, --video_length, or --video_interval; the later command breakdown nevertheless describes Newton video length. Add a supported Newton recording command or separate this into a headless-training section and remove the video claims.

--task IsaacContrib-Deploy-GearAssembly-Rizon4s-Grav \
--num_envs 256 \
--visualizer none \
presets=newton_hydroelastic

.. tab-item:: isaaclab.sh / isaaclab.bat

.. code-block:: bash

./isaaclab.sh train --rl_library rsl_rl \
--task IsaacContrib-Deploy-GearAssembly-Rizon4s-Grav \
--num_envs 256 \
--visualizer none \
presets=newton_hydroelastic

The Newton hydroelastic preset uses package-local concave SDF collision assets. Its defaults

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-generated review — Moderate: this paragraph duplicates implementation details already encoded in the config/tests (dt, substeps, decimation, gap, gravity compensation, actuator behavior) and will drift as tuning changes. Keep the user-actionable distinctions—how to choose the preset and what to do on overflow—and remove the internal configuration narrative and exact-value rationale.

separate the expensive collision rate from contact integration: the outer physics and collision
tick is 100 Hz, while 20 solver substeps produce a 2 kHz solver rate. A policy decimation of three
gives a 33.3 Hz control rate. The preset also uses a 5 mm shape gap and a bounded triangle-pair
buffer sized for 256 environments per GPU rank. The arm uses solver-native actuator gravity
compensation so gravity remains enabled for the gears, and the Grav linkage is held by physical
PD actuators; no action term rewrites the selected gear pose.

The default triangle-pair capacity is 4,194,304 per GPU rank. If Newton reports a triangle-pair
buffer overflow, reduce the number of environments per rank or increase the capacity before using
the resulting policy; overflowed candidate contacts are discarded.

For four-GPU training, launch 256 environments per rank (1,024 total):

.. code-block:: bash

uv run python scripts/reinforcement_learning/train_multigpu.py \
--rl_library rsl_rl --num_gpus 4 \
--task IsaacContrib-Deploy-GearAssembly-Rizon4s-Grav \
--num_envs 256 --max_iterations 1000 \
--visualizer none \
presets=newton_hydroelastic

**Command breakdown:**

- ``--num_envs 256``: Runs 256 parallel environments for efficient training
- ``--video_length 200``: Each video captures approximately one full episode (``episode_length_s / (sim.dt * decimation)`` = ``6.66 / (1/1000 * 33)`` ≈ 200 steps)
- ``--num_envs 256``: Runs 256 parallel environments per trainer process
- ``--video_length 200``: Captures approximately one PhysX episode
(``6.66 / (1/120 * 4)`` ≈ 200 policy steps); a Newton episode is approximately
222 policy steps (``6.66 / (0.01 * 3)``)
- ``--video_interval 76800``: Records a video every 76,800 environment steps (~every 150 iterations), producing ~10 videos over full training

Training typically takes ~12-24 hours for a robust insertion policy. The videos will be saved in the ``logs`` directory and can be reviewed to assess policy performance during training.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Added
^^^^^

* Added Newton point-SDF and hydroelastic-SDF physics presets and collision
assets to the Flexiv Rizon 4s gear assembly task.
* Added a PhysX SDF preset that uses the same centered collision assets for
cross-backend validation while preserving legacy PhysX defaults.
* Added a Newton inverse-kinematics task variant for task-space policies.

Fixed
^^^^^

* Fixed Newton gear reset, reward, and termination frames so selected gears
target their shafts and physical grasps are measured at the fingertip
midpoint without changing the PhysX defaults.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DOes this USDA need to live within IsaacLab? Could it be on Nucleus?

Git LFS file not shown

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this USDA need to live within IsaacLab? Could it be on Nucleus?

Git LFS file not shown

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this USDA need to live within IsaacLab? Could it be on Nucleus?

Git LFS file not shown

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this USDA need to live within IsaacLab? Could it be on Nucleus?

Git LFS file not shown
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@
},
)

# Flexiv Rizon 4s with Newton inverse-kinematics actions
gym.register(
id="IsaacContrib-Deploy-GearAssembly-Rizon4s-Grav-Newton-IK",
entry_point="isaaclab.envs:ManagerBasedRLEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": f"{__name__}.ik_newton_env_cfg:Rizon4sGearAssemblyIKNewtonEnvCfg",
"rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:Rizon4sGearAssemblyRNNPPORunnerCfg",
},
)

# Flexiv Rizon 4s - ROS Inference
gym.register(
id="IsaacContrib-Deploy-GearAssembly-Rizon4s-Grav-ROS-Inference",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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

from isaaclab_newton.envs.mdp.actions.newton_ik_actions_cfg import NewtonInverseKinematicsActionCfg
from isaaclab_newton.ik.newton_ik_objectives_cfg import NewtonIKJointLimitObjectiveCfg, NewtonIKPoseObjectiveCfg
from isaaclab_newton.ik.newton_ik_solver_cfg import NewtonIKSolverCfg

from isaaclab.utils.configclass import configclass

from . import joint_pos_env_cfg


@configclass
class Rizon4sGearAssemblyIKNewtonEnvCfg(joint_pos_env_cfg.Rizon4sGearAssemblyEnvCfg):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-generated review — Important: this class inherits the PhysX default. I confirmed that resolving the registered Newton-IK task with default produces PhysxCfg + NewtonInverseKinematicsActionCfg, and cfg.validate() still passes, despite the docstring saying the combination is unsupported. Make the task select Newton by default or add a validate_config() backend/action compatibility check, and add a negative regression test for the unsupported combination.

"""Gear-assembly with a Newton inverse-kinematics (task-space) action for the Rizon 4s arm.

Replaces the joint-space :class:`~isaaclab.envs.mdp.RelativeJointPositionActionCfg` with a
Newton-solved relative end-effector pose action, so the policy commands end-effector motion
directly. This provides a six-dimensional task-space alternative to the seven-dimensional
joint-space action. The gripper remains a fixed mimic mechanism (not commanded by the policy).

Note:
Newton IK consumes the replicated robot prototype, so this variant requires a Newton preset
(``presets=newton_mjwarp``, ``presets=newton_sdf``, or
``presets=newton_hydroelastic``); it is not compatible with ``presets=physx``.
"""

def __post_init__(self):
super().__post_init__()

# Command the physical flange frame used by the real Flexiv Cartesian controller.
self.actions.arm_action = NewtonInverseKinematicsActionCfg(
asset_name="robot",
joint_names=["joint1", "joint2", "joint3", "joint4", "joint5", "joint6", "joint7"],
controller=NewtonIKSolverCfg(optimizer="lm", jacobian_mode="analytic", iterations=24),
clip={".*": (-0.5, 0.5)},
objectives=[
NewtonIKPoseObjectiveCfg(
body_name="flange",
command_type="pose",
use_relative_mode=True,
scale=0.025,
),
NewtonIKJointLimitObjectiveCfg(weight=0.1),
],
)
Loading