Skip to content

Fix Factory nut-thread rotation check for signed Euler angles - #9311

Merged
kellyguo11 merged 1 commit into
isaac-sim:mainfrom
nfukuchi:fix/factory-check-rot-yaw-wrap
Nov 30, 2026
Merged

kellyguo11 merged 1 commit into
isaac-sim:mainfrom
nfukuchi:fix/factory-check-rot-yaw-wrap

Conversation

@nfukuchi

Copy link
Copy Markdown
Contributor

Description

euler_xyz_from_quat returns angles in (-pi, pi] by default since #2365. FactoryEnv._get_curr_successes(check_rot=True), the nut-thread rotation check (wrap_yaw(curr_yaw) < ee_success_yaw), still assumes the former [0, 2*pi) range: factory_utils.wrap_yaw moves yaws above 235 degrees down by 2*pi, so the span [-125, 235] degrees is not interrupted by the yaw joint limit. With signed input this mapping does nothing, and a yaw between 180 and 235 degrees comes out between -180 and -125 degrees, so it counts as "rotated".

#8804 fixed the same assumption in ForgeEnv._apply_action(). This PR requests wrap_to_2pi=True in the rotation check, and the wrap_yaw docstring now states the input range it expects.

Factory NutThread cannot reach the affected interval: it starts near 105 degrees yaw and only rotates toward smaller yaw. FORGE NutThread can. Its yaw action is bounded to [-90, 180] degrees in the world frame, and commanding the 180-degree bound makes the hand overshoot to about 182 degrees. If the nut is also pressed down to the success height, the hand has turned the wrong way, yet the check counts it as success. FORGE uses this flag for its success-prediction reward and for the logged success rate.

Related: #8779, #8804

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Release backport

  • Backport this pull request to the active release branch after it merges into main

Validation

  • Direct check of FactoryEnv._get_curr_successes on Factory and FORGE NutThread (PhysX). The nut is placed at the success pose and the hand yaw is swept from -120 to 235 degrees with roll at pi.
    • Before: success was reported for every yaw from 180 to 230 degrees.
    • After: success is reported only for yaw below ee_success_yaw (0 degrees).
  • Rollouts on FORGE NutThread (256 envs, Fix FORGE Euler angle ranges during action clipping #8804 applied as on main):
    • Pressing the nut down, then commanding the 180-degree yaw bound for the second half of the episode, gave 186 env-steps counted as success before this change and 0 after. The hand yaw reached up to 182 degrees.
    • Random, hold and other constant-yaw actions kept the yaw below 122 degrees, and both versions agreed on every step.
  • Rollouts on Factory NutThread under the same action policies: the yaw stayed between -67 and 120 degrees, and both versions agreed on every step.
  • uv run isaaclab --format passed every hook, including the ruff hooks, the license headers and the changelog fragment check.
  • No new unit test. The changed call lives inside a DirectRLEnv method that needs a simulated scene, so the only way to unit-test it would be to replay the production expression.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run isaaclab --format
  • I have made corresponding changes to the documentation (not applicable: no public API change)
  • My changes generate no new warnings
  • I have validated the changed behavior with focused coverage and applied the test-audit criteria to any test changes
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump package versions — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@nfukuchi
nfukuchi requested a review from a team November 30, 2026 14:01
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Nov 30, 2026

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Isaac Lab Review Bot

Needs attention: Style consistency (1). Other reviewed categories look good.

  • PR description: Title and diff match; qualify Factory reachability by tested policies and remove the unsupported unit-testing limitation; reported scene checks and rollouts support correctness, and no performance claim requires benchmarks.
  • Design and architecture: Architecture looks good.
  • Scope and over-engineering: No over-engineering issues.
  • API: API changes look good.
  • Compatibility and deprecation: No breaking changes identified.
  • Implementation: Implementation looks good.
  • Style consistency: The wrap_yaw docstring incorrectly describes radians as degrees and includes the excluded lower endpoint; document the output as (-125pi/180, 235pi/180] radians.
  • Test quality: Test quality looks good.

Minor fixes needed. Posted 1 inline finding.

Automated review; human maintainers own approval decisions.


def wrap_yaw(angle):
"""Ensure yaw stays within range."""
"""Map yaw from [0, 2*pi) to [-125, 235] degrees so the span is not interrupted by the yaw joint limit."""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Warning · Style Consistency — Correct wrapped yaw units and bounds

wrap_yaw returns radians, not degrees, and excludes the lower bound: its output is equivalent to (-125°, 235°]. State the output range in radians with the correct endpoint.

@greptile-apps

greptile-apps Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Fixes the nut-thread rotation check by requesting unsigned Euler angles before calling wrap_yaw.

  • Nut-thread success checks compare yaw after wrapping it into the expected range.

No actionable issues found. nfukuchi explicitly omitted a new unit test because the method needs a simulated scene and reported focused simulation checks instead. This review checked the code; it did not rerun those simulations.

Reviews (1) · Last reviewed commit: "Fix Factory nut-thread rotation check fo..." · Reviewed by Greptile

@kellyguo11

Copy link
Copy Markdown
Contributor

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Nov 30, 2026
@kellyguo11
kellyguo11 merged commit 56ed7fd into isaac-sim:main Nov 30, 2026
62 checks passed
isaaclab-bot Bot pushed a commit that referenced this pull request Nov 30, 2026
# Description

`euler_xyz_from_quat` returns angles in `(-pi, pi]` by default since
#2365. `FactoryEnv._get_curr_successes(check_rot=True)`, the nut-thread
rotation check (`wrap_yaw(curr_yaw) < ee_success_yaw`), still assumes
the former `[0, 2*pi)` range: `factory_utils.wrap_yaw` moves yaws above
235 degrees down by `2*pi`, so the span `[-125, 235]` degrees is not
interrupted by the yaw joint limit. With signed input this mapping does
nothing, and a yaw between 180 and 235 degrees comes out between -180
and -125 degrees, so it counts as "rotated".

#8804 fixed the same assumption in `ForgeEnv._apply_action()`. This PR
requests `wrap_to_2pi=True` in the rotation check, and the `wrap_yaw`
docstring now states the input range it expects.

Factory NutThread cannot reach the affected interval: it starts near 105
degrees yaw and only rotates toward smaller yaw. FORGE NutThread can.
Its yaw action is bounded to [-90, 180] degrees in the world frame, and
commanding the 180-degree bound makes the hand overshoot to about 182
degrees. If the nut is also pressed down to the success height, the hand
has turned the wrong way, yet the check counts it as success. FORGE uses
this flag for its success-prediction reward and for the logged success
rate.

Related: #8779, #8804

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `main`

## Validation

- Direct check of `FactoryEnv._get_curr_successes` on Factory and FORGE
NutThread (PhysX). The nut is placed at the success pose and the hand
yaw is swept from -120 to 235 degrees with roll at pi.
  - Before: success was reported for every yaw from 180 to 230 degrees.
- After: success is reported only for yaw below `ee_success_yaw` (0
degrees).
- Rollouts on FORGE NutThread (256 envs, #8804 applied as on `main`):
- Pressing the nut down, then commanding the 180-degree yaw bound for
the second half of the episode, gave 186 env-steps counted as success
before this change and 0 after. The hand yaw reached up to 182 degrees.
- Random, hold and other constant-yaw actions kept the yaw below 122
degrees, and both versions agreed on every step.
- Rollouts on Factory NutThread under the same action policies: the yaw
stayed between -67 and 120 degrees, and both versions agreed on every
step.
- `uv run isaaclab --format` passed every hook, including the ruff
hooks, the license headers and the changelog fragment check.
- No new unit test. The changed call lives inside a `DirectRLEnv` method
that needs a simulated scene, so the only way to unit-test it would be
to replay the production expression.

## Checklist

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`uv run isaaclab --format`
- [ ] I have made corresponding changes to the documentation (not
applicable: no public API change)
- [x] My changes generate no new warnings
- [x] I have validated the changed behavior with focused coverage and
applied the [test-audit
criteria](https://github.com/isaac-sim/IsaacLab/blob/HEAD/skills/developer/test-audit/SKILL.md)
to any test changes
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package (do **not** edit
`CHANGELOG.rst` or bump package versions — CI handles that)
- [ ] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

(cherry picked from commit 56ed7fd)
@isaaclab-bot

isaaclab-bot Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Backported to release/3.1.0 as a9d858d.

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

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants