[Newton] Migrates Pink IK to Newton branch#4514
[Newton] Migrates Pink IK to Newton branch#4514michaellin6 wants to merge 11 commits intoisaac-sim:dev/newtonfrom
Conversation
Greptile OverviewGreptile SummaryThis 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:
Known Limitations (acknowledged in PR):
Technical Quality:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
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
|
| 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, |
There was a problem hiding this comment.
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!
…s with more accurate actuator parameters. Passing Pink IK test on G1.
…weight back to root link.
78f27ba to
ee57513
Compare
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: michaellin6 <michalin@nvidia.com>
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:
Pending issues:
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?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
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there