isaaclab_newton.envs.mdp#

Newton-specific MDP components.

Events#

Backend implementations of MDP event terms for Newton.

Classes:

randomize_rigid_body_material

Sample friction and restitution per shape.

randomize_rigid_body_collider_offsets

Newton backend implementation for collider offset randomization.

randomize_physics_scene_gravity

Randomize selected Newton worlds, leaving the global world unchanged.

randomize_visual_shape

Sample one color per selected link and write Newton shape storage on device.

Functions:

zero_final_obs_on_solver_fault(env, env_ids)

Zero complete terminal observation rows for solver-faulted worlds, including history.

class isaaclab_newton.envs.mdp.events.randomize_rigid_body_material[source]#

Sample friction and restitution per shape.

Newton uses one friction coefficient, so dynamic_friction_range, num_buckets, and make_consistent are ignored.

With its own collision detector, Kamino shares materials across environments. It then samples one value per original (mu, restitution) group and applies it to every environment, ignoring env_ids. With Newton’s collision pipeline, Kamino reads each shape’s values per contact, so sampling is per environment and shape as for the other solvers.

Methods:

__init__(cfg, env)

Initialize the asset bindings and sampling state.

__init__(cfg: EventTermCfg, env: ManagerBasedEnv) → None[source]#

Initialize the asset bindings and sampling state.

Parameters:
  • cfg – Event configuration.

  • env – Environment owning this term.

class isaaclab_newton.envs.mdp.events.randomize_rigid_body_collider_offsets[source]#

Newton backend implementation for collider offset randomization.

Maps PhysX concepts to Newton’s geometry properties:

  • rest_offset -> shape_margin (Newton margin)

  • contact_offset -> shape_gap (Newton gap = contact_offset - margin)

See the Newton collision schema for details.

Methods:

__init__(cfg, env)

Initialize the asset bindings and sampling state.

__init__(cfg: EventTermCfg, env: ManagerBasedEnv) → None[source]#

Initialize the asset bindings and sampling state.

Parameters:
  • cfg – Event configuration.

  • env – Environment owning this term.

class isaaclab_newton.envs.mdp.events.randomize_physics_scene_gravity[source]#

Randomize selected Newton worlds, leaving the global world unchanged.

Add and scale operate on current gravity; repeated calls accumulate. Distribution is fixed at construction; distribution parameters [m/s^2] may change at runtime.

Methods:

__init__(cfg, env)

Initialize gravity sampling for the active simulation.

__init__(cfg: EventTermCfg, env: ManagerBasedEnv) → None[source]#

Initialize gravity sampling for the active simulation.

Parameters:
  • cfg – Event configuration.

  • env – Environment owning this term.

class isaaclab_newton.envs.mdp.events.randomize_visual_shape[source]#

Sample one color per selected link and write Newton shape storage on device.

Methods:

__init__(cfg, env)

Initialize the manager term.

__init__(cfg: EventTermCfg, env: ManagerBasedEnv)[source]#

Initialize the manager term.

Parameters:
  • cfg – The configuration object.

  • env – The environment instance.

isaaclab_newton.envs.mdp.events.zero_final_obs_on_solver_fault(env: ManagerBasedRLEnv, env_ids: torch.Tensor | slice) → None[source]#

Zero complete terminal observation rows for solver-faulted worlds, including history.

Configure as the first reset event, before any event rewrites physics state and refreshes the lazy fault query. Acts on all flagged rows in extras["final_obs"] when final observations are enabled. Normal environment reset clears the affected observation histories.

Terminations#

Configure solver_fault as a termination and zero_reward_on_solver_fault as the last nonzero reward term. Both terms query the backend directly. Detection runs lazily once per state timestamp and is refreshed after a physics step or completed FK/reset. The reward term clears complete reward rows before summation and episode accumulation and does not require a named termination term.

from isaaclab.managers import RewardTermCfg, TerminationTermCfg
from isaaclab_newton.envs.mdp import solver_fault, zero_reward_on_solver_fault
from isaaclab.utils import configclass

@configclass
class TerminationsCfg:
    solver_fault = TerminationTermCfg(func=solver_fault)

@configclass
class RewardsCfg:
    # Declare task reward terms above this final term.
    solver_fault_reward = RewardTermCfg(func=zero_reward_on_solver_fault, weight=1.0)

To zero faulted terminal observations, configure zero_final_obs_on_solver_fault() as the first reset event, before any reset event rewrites physics state and refreshes the lazy fault query. It clears complete rows, including history, in extras["final_obs"] when compute_final_obs is enabled. Unflagged rows, including unrelated nonfinite values, remain unchanged. Normal reset clears the affected histories and the environment computes fresh observations from the reset state.

from isaaclab.managers import EventTermCfg

@configclass
class EventsCfg:
    solver_fault_observations = EventTermCfg(
        func="isaaclab_newton.envs.mdp:zero_final_obs_on_solver_fault", mode="reset"
    )
    # Declare physics reset events below this term.

Detection includes Newton body, joint and particle state. MuJoCo additionally checks its private persistent buffers. MJWarp checks and resets these buffers per world. CPU MuJoCo uses global solver history, so a fault in that history terminates every environment.

Termination terms that read the Newton physics manager.

Functions:

solver_fault(env)

Terminate worlds with nonfinite Newton state or persistent solver buffers.

isaaclab_newton.envs.mdp.terminations.solver_fault(env: ManagerBasedRLEnv) → torch.Tensor[source]#

Terminate worlds with nonfinite Newton state or persistent solver buffers.

Rewards#

Reward terms for Newton physics faults.

Functions:

zero_reward_on_solver_fault(env)

Zero rewards for faulted worlds before summation and episode accumulation.

isaaclab_newton.envs.mdp.rewards.zero_reward_on_solver_fault(env: ManagerBasedRLEnv) → float[source]#

Zero rewards for faulted worlds before summation and episode accumulation.

Configure this after every other nonzero reward term, with a nonzero weight. The lazy backend query shares its result with other fault consumers without requiring a named termination term.

Classes#

The following classes are part of the public isaaclab_newton.envs.mdp API.

NewtonDifferentialInverseKinematicsAction

Differential inverse-kinematics action term using NewtonDifferentialIKController.

NewtonDifferentialInverseKinematicsActionCfg

Configuration for NewtonDifferentialInverseKinematicsAction.

NewtonInverseKinematicsAction

Newton inverse-kinematics action term.

NewtonInverseKinematicsActionCfg

Configuration for a Newton inverse-kinematics action term.

NewtonOperationalSpaceControllerAction

Operational-space control action term using NewtonOperationalSpaceController.

NewtonOperationalSpaceControllerActionCfg

Configuration for NewtonOperationalSpaceControllerAction.

class isaaclab_newton.envs.mdp.NewtonDifferentialInverseKinematicsAction[source]#

Bases: _NewtonTaskSpaceAction

Differential inverse-kinematics action term using NewtonDifferentialIKController.

The action is a target position, a target pose (x, y, z, qx, qy, qz, qw), or, in relative mode, a delta position or pose (x, y, z, rx, ry, rz) in the robot root frame. It sets joint position targets.

Methods:

__init__(cfg, env)

Initialize the action term.

__new__(*args, **kwargs)

__init__(cfg: NewtonDifferentialInverseKinematicsActionCfg, env: ManagerBasedEnv)[source]#

Initialize the action term.

Parameters:
  • cfg – The configuration object.

  • env – The environment instance.

classmethod __new__(*args, **kwargs)#
class isaaclab_newton.envs.mdp.NewtonDifferentialInverseKinematicsActionCfg[source]#

Bases: ActionTermCfg

Configuration for NewtonDifferentialInverseKinematicsAction.

Commands and the Jacobian are expressed in the robot root frame. The action works with any physics backend.

Methods:

__new__(*args, **kwargs)

__init__([class_type, asset_name, ...])

classmethod __new__(*args, **kwargs)#
__init__(class_type: type[NewtonDifferentialInverseKinematicsAction] | str = <factory>, asset_name: str = <factory>, debug_vis: bool = <factory>, clip: dict[str, tuple] | None = <factory>, joint_names: list[str] = <factory>, body_name: str = <factory>, body_offset: DifferentialInverseKinematicsActionCfg.OffsetCfg | None = <factory>, command_type: Literal['position', 'pose'] = <factory>, use_relative_mode: bool = <factory>, scale: float | tuple[float, ...] = <factory>, null_space_joint_pos_target: Literal['default', 'center'] = <factory>, controller: NewtonDifferentialIKControllerCfg = <factory>) → None#
class isaaclab_newton.envs.mdp.NewtonInverseKinematicsAction[source]#

Bases: ActionTerm

Newton inverse-kinematics action term.

Solves IK as a single list of objectives on the cloner’s single-env Newton prototype model, then maps the actuated joint coordinates back to the live batched articulation. Each pose objective drives one end-effector body (one is single-body IK, several are multi-body); constraint objectives add no action dimensions. The per-step target computation, seed assembly, solve and gather run entirely in Warp – Torch appears only as the policy action at the boundary, viewed zero-copy into Warp. Fixed-base articulations only.

Methods:

__init__(cfg, env)

Initialize the action term.

__new__(*args, **kwargs)

__init__(cfg: NewtonInverseKinematicsActionCfg, env: ManagerBasedEnv)[source]#

Initialize the action term.

Parameters:
  • cfg – The configuration object.

  • env – The environment instance.

classmethod __new__(*args, **kwargs)#
class isaaclab_newton.envs.mdp.NewtonInverseKinematicsActionCfg[source]#

Bases: ActionTermCfg

Configuration for a Newton inverse-kinematics action term.

The action solves IK as a single list of objectives. Pose objectives (NewtonIKPoseObjectiveCfg) are command-driven and contribute action dimensions – one drives a single-body solve, several drive a multi-body solve. Constraint objectives such as NewtonIKJointLimitObjectiveCfg add residuals but no action dimensions. The action vector is the concatenation of every pose objective’s slice, in list order.

The action currently supports fixed-base articulations only. Each pose objective’s body and the configured joints must resolve both in Isaac Lab and in the registered Newton prototype model for the controlled asset.

Methods:

__new__(*args, **kwargs)

__init__([class_type, asset_name, ...])

classmethod __new__(*args, **kwargs)#
__init__(class_type: type[NewtonInverseKinematicsAction] | str = <factory>, asset_name: str = <factory>, debug_vis: bool = <factory>, clip: dict[str, tuple] | None = <factory>, joint_names: list[str] = <factory>, objectives: list[NewtonIKObjectiveCfg] = <factory>, controller: NewtonIKSolverCfg = <factory>) → None#
class isaaclab_newton.envs.mdp.NewtonOperationalSpaceControllerAction[source]#

Bases: _NewtonTaskSpaceAction

Operational-space control action term using NewtonOperationalSpaceController.

See NewtonOperationalSpaceControllerActionCfg for the action layout. It sets joint effort targets.

Methods:

__init__(cfg, env)

Initialize the action term.

__new__(*args, **kwargs)

__init__(cfg: NewtonOperationalSpaceControllerActionCfg, env: ManagerBasedEnv)[source]#

Initialize the action term.

Parameters:
  • cfg – The configuration object.

  • env – The environment instance.

classmethod __new__(*args, **kwargs)#
class isaaclab_newton.envs.mdp.NewtonOperationalSpaceControllerActionCfg[source]#

Bases: ActionTermCfg

Configuration for NewtonOperationalSpaceControllerAction.

The action is the target pose, followed by the target wrench when wrench control is enabled, then the motion stiffness and damping when the controller leaves them live (None). Poses, twists, and the Jacobian are expressed in the robot root frame, and the controller’s operational frame is relative to it. The action works with any physics backend.

Methods:

__new__(*args, **kwargs)

__init__([class_type, asset_name, ...])

classmethod __new__(*args, **kwargs)#
__init__(class_type: type[NewtonOperationalSpaceControllerAction] | str = <factory>, asset_name: str = <factory>, debug_vis: bool = <factory>, clip: dict[str, tuple] | None = <factory>, joint_names: list[str] = <factory>, body_name: str = <factory>, body_offset: DifferentialInverseKinematicsActionCfg.OffsetCfg | None = <factory>, target_type: Literal['pose_abs', 'pose_rel'] = <factory>, position_scale: float = <factory>, orientation_scale: float = <factory>, wrench_scale: float = <factory>, stiffness_scale: float = <factory>, damping_scale: float = <factory>, null_space_joint_pos_target: Literal['default', 'center', 'zero'] = <factory>, controller: NewtonOperationalSpaceControllerCfg = <factory>) → None#