Skip to content

Fix Franka Reach OSC velocity limit and normalize OSC pose targets - #7624

Open
maxkra15 wants to merge 2 commits into
isaac-sim:developfrom
maxkra15:fix/franka-reach-osc-limits
Open

Fix Franka Reach OSC velocity limit and normalize OSC pose targets#7624
maxkra15 wants to merge 2 commits into
isaac-sim:developfrom
maxkra15:fix/franka-reach-osc-limits

Conversation

@maxkra15

@maxkra15 maxkra15 commented Sep 7, 2026

Copy link
Copy Markdown

Description

Follow-up to #7033. The state-based benchmark run hit ValueError: The rewards returned by the environment contain NaN values on Isaac-Reach-Franka-OSC (ovphysx, presets=diffik_abs, one seed of three). Investigating the OSC task and controller turned up three defects that together make the task run far outside its intended envelope:

  1. The OSC arm ran without a solver joint velocity limit. The zero-gain effort actuator introduced in Fix Franka Reach OSC effort limiting #7033 copied the deprecated velocity_limit_sim alias from the Menagerie actuator config, but that config sets joint_velocity_limit. The copied value was None, and the Menagerie USD authors no joint velocity limit of its own, so the live limit resolved to FLT_MAX (plain Isaac-Reach-Franka keeps 20 / 25 rad/s). Instrumented training showed the arm reaching ~60 rad/s under saturated 100 N·m efforts with self-collisions enabled, which is the regime where PhysX can blow up into NaN. The actuator now forwards joint_velocity_limit; with the fix the peak joint speed in training clamps at 25 rad/s.
  2. OperationalSpaceController used pose_abs quaternions unnormalized. The policy emits four raw values and the axis-angle error scales with their norm (a norm of 3.6 yields an 11 rad "orientation error"), so the commanded efforts scaled with the raw output too. The controller now normalizes the target and falls back to the current end-effector orientation (or identity) for degenerate quaternions, matching DifferentialIKController.
  3. diffik_abs leaked into the OSC task. The OSC action term replaces the parent's arm-controller presets, so presets=diffik_abs on the OSC task only zeroed the action-magnitude reward weight, which is the only regularizer on the raw pose/quaternion outputs. This explains why only the diffik_abs rows were affected. The OSC task now resolves the default weight. presets=diffik_abs stays accepted as a deprecated no-op alias that emits a FutureWarning at config validation, so existing command lines keep working; the alias will be removed in a future release. Migration: drop presets=diffik_abs from Isaac-Reach-Franka-OSC commands.

The exact NaN event did not reproduce locally (two full seed-43 runs on ovphysx completed cleanly), so the physics blow-up is inferred from the runaway joint velocities rather than caught in the act.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Deprecation of the diffik_abs preset on Isaac-Reach-Franka-OSC (no-op alias with FutureWarning)

Release backport

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

Validation

  • uv run --extra dev python -m pytest source/isaaclab/test/controllers/test_operational_space_features.py — 4 passed (2 new; both fail without the controller fix)
  • uv run --extra dev python -m pytest source/isaaclab_tasks/test/core/test_reach_franka_presets.py — 25 passed (3 new + 3 new preset cases; the new tests fail without the config fix)
  • uv run --extra dev --extra isaacsim python -m pytest source/isaaclab/test/controllers/test_operational_space.py — 18 passed
  • Isaac-Reach-Franka-OSC presets=diffik_abs --max_iterations 1 --num_envs 4 through the hydra CLI: FutureWarning emitted at env creation, training runs
  • 40-iteration Isaac-Reach-Franka-OSC physics=ovphysx training: no NaN, peak arm joint speed 25.1 rad/s (was ~59 rad/s before)
  • uv run python tools/changelog/cli.py check develop and uv run isaaclab -f pass

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 added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump extension.toml — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

The Isaac-Reach-Franka-OSC effort actuator copied the deprecated
velocity_limit_sim alias instead of joint_velocity_limit, dropping the
Menagerie 20/25 rad/s solver clamp. The Menagerie USD authors no joint
velocity limit, so the arm ran unbounded and reached ~60 rad/s under
saturated efforts, which can destabilize the simulation and surface as
NaN rewards.

The operational space controller also consumed pose_abs quaternions
without normalizing them, so the orientation error scaled with the raw
policy output norm. Targets are now normalized with a fallback to the
current end-effector orientation, matching DifferentialIKController.

The OSC task additionally leaked the diffik_abs preset, which only
zeroed the action-magnitude reward weight. The task now resolves the
default weight and exposes physics presets only.
@maxkra15
maxkra15 requested a review from a team September 7, 2026 20:41
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Sep 7, 2026
@greptile-apps

greptile-apps Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR stabilizes Franka operational-space reach training by preserving solver velocity limits, normalizing absolute-pose quaternion targets, and removing an inapplicable controller preset from the OSC task.

  • Normalizes finite absolute-pose quaternion targets and supplies current-orientation or identity fallbacks for degenerate inputs.
  • Copies the Menagerie actuator’s per-joint solver velocity limits into the zero-gain effort actuator.
  • Resolves the OSC action-magnitude reward to its default and exposes only applicable physics presets.
  • Adds focused controller and task-configuration regression tests plus changelog fragments.

Confidence Score: 5/5

The PR appears safe to merge; the controller, actuator, and preset changes are internally consistent and covered by focused regression tests.

No actionable failures remain: omitted task frames are safely canonicalized, quaternion frame semantics are correct, the actuator retains its intended per-joint limits, and OSC preset resolution produces valid runtime configuration.

Important Files Changed

Filename Overview
source/isaaclab/isaaclab/controllers/operational_space.py Normalizes absolute-pose target quaternions and applies frame-correct fallbacks for degenerate targets.
source/isaaclab/test/controllers/test_operational_space_features.py Adds regression coverage for quaternion scale/sign invariance and degenerate-target fallback behavior.
source/isaaclab_tasks/isaaclab_tasks/core/reach/config/franka/franka_reach_osc_env_cfg.py Preserves the Franka solver velocity limit and removes the irrelevant controller-dependent reward preset from the OSC task.
source/isaaclab_tasks/test/core/test_reach_franka_presets.py Verifies the OSC actuator limit, resolved reward configuration, and physics-only preset surface.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Policy pose_abs command] --> B[Split pose target]
  B --> C{Quaternion normalizable?}
  C -->|Yes| D[Normalize target quaternion]
  C -->|No, current pose available| E[Convert current EE orientation to task frame]
  C -->|No current pose| F[Use identity orientation]
  D --> G[Transform desired pose to root frame]
  E --> G
  F --> G
  G --> H[OSC computes joint efforts]
  H --> I[Effort actuator]
  I --> J[Per-joint solver velocity limits]
Loading

Reviews (1): Last reviewed commit: "Fix Franka Reach OSC velocity limit and ..." | Re-trigger Greptile

@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

The OSC quaternion normalization and Franka actuator velocity-limit forwarding are coherent and covered by focused tests. However, the OSC task now rejects the previously accepted presets=diffik_abs input without prior deprecation, despite repository compatibility policy.

  • Design and architecture: Normalization is correctly located in the pose_abs command path, with fallback orientations transformed into the task frame. Resolving the inherited preset-backed reward value in the OSC configuration removes the irrelevant preset behavior, but the obsolete preset should remain temporarily as a deprecated no-op alias.
  • API: The controller preserves tensor shape, dtype, device, and quaternion layout while documenting normalization and fallback behavior. The OSC preset surface has an actionable compatibility issue: presets=diffik_abs is removed immediately rather than deprecated first, and the release note does not mark the change as breaking.
  • Implementation: The quaternion implementation clones the target, handles zero and non-finite norms, and uses correctly broadcast fallback tensors. Velocity-limit propagation and regression coverage are appropriate. Before merge, retain a warning-producing compatibility alias for the removed OSC preset or classify and document the removal as breaking in accordance with repository policy.

Minor fixes needed. Posted 1 actionable finding inline.

Automated review; human maintainers own approval decisions.

Removing the leaked preset outright would break existing command lines
without a deprecation path. The OSC task now keeps a diffik_abs variant
that resolves to the default action-magnitude weight and emits a
FutureWarning during config validation, and the changelog entry moves
under Deprecated with the migration note.
@maxkra15

maxkra15 commented Sep 8, 2026

Copy link
Copy Markdown
Author

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 Sep 8, 2026
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.

1 participant