Skip to content

Conversation

@michaellin6
Copy link
Contributor

Description

Adding Pink IK controller and a subset of Mimic environments. Pink IK unit tests and controller tests on G1 env are passing.

Features added:

  1. Articulation: Gravity compensation (WIP). The current implementation is not ideal as it uses anti-gravity force on bodies to be compensated, and adds the weight of those bodies to the root link. Instead, gravity compensation should be done by applying the correct torques on each joint. This feature will be requested for Newton.
  2. Articulation: Option to fix base link during env instantiation.

Pending issues:

  1. Unable to load some Mimic assets from Nucleus.
  • Packing table throws error:
    RuntimeError: Unable to copy file: 'https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/5.1/Isaac/Props/PackingTable/materials/textures/t_corrugatedboxes_b01_trim_Albedo.png'. Is the Nucleus Server running?
  • GR1T2 throws:
    RuntimeError: Unable to copy file: 'https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/5.1/Isaac/Robots/FourierIntelligence/GR-1/GR1T2_fourier_hand_6dof/textures/texture/GR1T2FourierIntelligence_GR1T2_roughness.<UDIM>.png'. Is the Nucleus Server running?

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 2, 2026

Greptile Overview

Greptile Summary

This PR successfully integrates the Pink IK controller into IsaacLab's Newton branch, enabling inverse kinematics control for humanoid robots (G1 and GR1T2). The implementation includes comprehensive test coverage and introduces two important infrastructure features.

Major Changes:

  • Adds Pink IK controller with support for frame tasks, null space posture control, and local frame tasks
  • Implements gravity compensation (WIP workaround using force-based approach; proper joint torque-based solution pending Newton feature request)
  • Adds fixed base articulation support via USD FixedJoint creation
  • Includes comprehensive test suite with passing unit tests on G1 environments
  • Adds locomanipulation and manipulation environment configurations for G1 and GR1T2 robots
  • Updates robot configurations (G1, GR1T2) with improved actuator parameters and gravity compensation settings

Known Limitations (acknowledged in PR):

  • Gravity compensation uses temporary force-based workaround instead of proper joint torques
  • Some Mimic assets fail to load from Nucleus (PackingTable, GR1T2 textures)

Technical Quality:

  • Well-structured controller implementation with proper validation and error handling
  • Atomic operations used correctly in Warp kernels to prevent race conditions
  • Comprehensive documentation and docstrings throughout
  • Minor docstring inconsistency found in local_frame_task.py

Confidence Score: 4/5

  • Safe to merge with documented limitations; gravity compensation is a temporary workaround pending Newton feature
  • The PR is well-implemented with comprehensive tests that are passing. The gravity compensation approach is acknowledged as temporary in the PR description. One minor docstring issue was found. The code quality is high with proper error handling and validation.
  • source/isaaclab/isaaclab/controllers/pink_ik/local_frame_task.py needs docstring fix

Important Files Changed

Filename Overview
source/isaaclab/isaaclab/controllers/pink_ik/pink_ik.py Implements Pink IK controller integration with comprehensive error handling and joint ordering validation
source/isaaclab_newton/isaaclab_newton/assets/articulation/articulation.py Adds gravity compensation using force-based approach with atomic operations; workaround solution acknowledged in PR
source/isaaclab_newton/isaaclab_newton/kernels/other_kernels.py Implements Warp kernels for gravity compensation with proper atomic operations to avoid race conditions
source/isaaclab/isaaclab/sim/schemas/schemas.py Implements fixed base articulation support by creating USD FixedJoint to world frame
source/isaaclab/isaaclab/envs/mdp/actions/pink_task_space_actions.py Integrates Pink IK controller into manager-based environment action system

Sequence Diagram

sequenceDiagram
    participant User
    participant Env as ManagerBasedEnv
    participant Action as PinkInverseKinematicsAction
    participant IK as PinkIKController
    participant Pink as Pink Solver
    participant Art as Articulation
    participant Sim as Newton Simulator
    
    User->>Env: step(action)
    Env->>Action: process_actions(action)
    Action->>Action: Parse action into task targets
    
    loop For each environment
        Action->>IK: Set task targets (poses/joints)
        Action->>Art: Get current joint positions
        Art-->>Action: Joint positions
        Action->>IK: compute(curr_joint_pos, dt)
        IK->>IK: Update Pink configuration
        IK->>Pink: solve_ik(tasks, dt)
        Pink-->>IK: Joint velocities
        IK->>IK: Convert velocities to positions
        IK-->>Action: Target joint positions
    end
    
    Action->>Art: set_joint_position_target()
    Env->>Art: write_data_to_sim()
    Art->>Art: Apply gravity compensation
    Art->>Art: Apply actuator models
    Art->>Sim: Write joint commands
    
    Env->>Sim: step()
    Sim-->>Sim: Physics simulation
    
    Env->>Art: update(dt)
    Art->>Sim: Read state data
    Sim-->>Art: Updated positions/velocities
    Art-->>Env: Updated state
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

5 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +54 to +60
def set_target(self, transform_target_to_base: pin.SE3) -> None:
"""Set task target pose in the world frame.

Args:
transform_target_to_world: Transform from the task target frame to
the world frame.
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Docstring parameter name doesn't match function parameter

Suggested change
def set_target(self, transform_target_to_base: pin.SE3) -> None:
"""Set task target pose in the world frame.
Args:
transform_target_to_world: Transform from the task target frame to
the world frame.
"""
def set_target(self, transform_target_to_base: pin.SE3) -> None:
"""Set task target pose in the base frame.
Args:
transform_target_to_base: Transform from the task target frame to
the base link frame.
"""

Comment on lines +2096 to +2134
def _apply_gravity_compensation(self):
"""Apply gravity compensation to the articulation.

This method uses a two-kernel approach to avoid race conditions:
1. First kernel accumulates compensation forces per-body and atomically accumulates
the negative compensation to the root link accumulator.
2. Second kernel applies the accumulated force to the root link.
"""
if self._has_gravity_compensation:
gravity = NewtonManager._gravity_vector # Already a tuple (x, y, z)

# Zero the accumulator before use
self._root_comp_force.zero_()

# First kernel: apply per-body compensation and atomically accumulate root link force
wp.launch(
apply_gravity_compensation_force,
dim=(self.num_instances, self.num_bodies),
inputs=[
self._data.body_mass,
self._gravity_compensation_factor,
wp.vec3f(gravity[0], gravity[1], gravity[2]),
self._data._sim_bind_body_external_wrench,
self._root_link_index,
self._root_comp_force,
],
device=self.device,
)

# Second kernel: apply the accumulated compensation force to the root link
wp.launch(
apply_accumulated_root_force,
dim=self.num_instances,
inputs=[
self._root_comp_force,
self._data._sim_bind_body_external_wrench,
self._root_link_index,
],
device=self.device,
Copy link
Contributor

Choose a reason for hiding this comment

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

The PR description acknowledges that the current gravity compensation approach is not ideal. It applies anti-gravity forces to compensated bodies and adds their weight to the root link. The proper approach would be to apply joint torques. Consider requesting this feature from the Newton team as noted in the PR description.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant