Skip to content

[Bug Report] Newton FrameTransformer, frame views and PVA return body poses from before a state write in env.step() #8643

Closed

Description

@NeoZng

Describe the bug

On Newton, root and joint state writes only mark forward kinematics (FK) as pending (NewtonManager.invalidate_fk()). Resets inside ManagerBasedRLEnv.step() and DirectRLEnv.step() do not call sim.forward() (it was removed after _reset_idx in #3446), and interval events such as pushes write state right before the observations. So the observations of the step are computed while FK is pending. Asset data and the scene data provider resolve pending FK when they are read, through NewtonManager.forward() (#7523 did this for the ray casters). Three readers use the Newton state directly instead:

  • FrameTransformer._update_buffers_impl samples body_q in its cached graph and never calls forward() (Fix Newton frame-transform freshness #8285: "reset callers retain responsibility for FK through sim.forward()").
  • NewtonSiteFrameView reads body_q for get_world_poses() and also uses it to convert set_world_poses() to the body frame. Cameras get their poses through this view. This includes Camera.get_world_poses(), which the docs describe as returning the current pose "even when update_latest_camera_pose=False".
  • Pva._update_buffers_impl samples body_q and body_qd.

So right after such a write, these readers return the body state from before it. This holds for frames on the root link as well as on child links. Frame views and camera pose reads return the old poses until something else resolves FK: an asset pose read, sim.forward() or the next physics step. A frame transformer or PVA sensor keeps the stale sample until its next update. A set_world_poses() call in that window computes the body-local offset from the stale body pose, and the frame keeps the wrong offset.

After a reset, the PVA sensor reports zeros for the reset env until the next physics step (its timestamp guard), so its stale read shows after writes outside a reset, such as a push.

Code (develop 06f2d42fdf):

  • source/isaaclab_newton/isaaclab_newton/sensors/frame_transformer/frame_transformer.py:311-334
  • source/isaaclab_newton/isaaclab_newton/sim/views/newton_site_frame_view.py:658-675 (_get_world_poses_impl) and :677-702 (_apply_world_pose_write)
  • source/isaaclab_newton/isaaclab_newton/sensors/pva/pva.py:162-198, with the reset guard at pva/kernels.py:42
  • source/isaaclab/isaaclab/envs/manager_based_rl_env.py:252 (_reset_idx) and :275-276 (interval events) to :282 (observations), with no FK in between; direct_rl_env.py:430 to :468 likewise
  • reads that resolve FK: newton_manager.py:375-382 (scene data provider), articulation_data.py:159, rigid_object_data.py:369
  • docs/source/concepts/sensors/camera.rst:129-132

Impact on a registered task: in Isaac-Open-Drawer-Franka on the default newton_mjwarp physics, the rel_ee_drawer_distance policy term in the first observation of an episode differs by 0.090, 0.093 and 0.114 m from the same term recomputed after FK and a sensor refresh. This was measured over 3 time-out resets with 4 envs, random actions and observation noise off. Envs that were not reset show 0.0.

Steps to reproduce

"""Newton: sensor and frame poses read right after a state write are the poses from before the write.

Reset events and interval events (such as pushes) write state, and observations then read the sensors without a
physics step or ``sim.forward()`` in between (``ManagerBasedRLEnv.step`` and ``DirectRLEnv.step`` do not call it).

usage: python repro.py [--device cuda:0|cpu]
"""

import argparse

from isaaclab.app import add_launcher_args, launch_simulation

parser = argparse.ArgumentParser()
add_launcher_args(parser)
args_cli = parser.parse_args()

import torch
from isaaclab_newton.physics import MJWarpSolverCfg, NewtonCfg
from isaaclab_newton.renderers import NewtonWarpRendererCfg

import isaaclab.sim as sim_utils
from isaaclab.assets import RigidObjectCfg
from isaaclab.scene import InteractiveScene, InteractiveSceneCfg
from isaaclab.sensors import CameraCfg, FrameTransformerCfg, OffsetCfg
from isaaclab.sensors.pva import PvaCfg
from isaaclab.utils import configclass

MOUNT = (0.1, 0.0, 0.05)


@configclass
class SceneCfg(InteractiveSceneCfg):
    cube = RigidObjectCfg(
        prim_path="{ENV_REGEX_NS}/Cube",
        spawn=sim_utils.CuboidCfg(
            size=(0.2, 0.2, 0.2),
            rigid_props=sim_utils.UsdPhysicsRigidBodyCfg(),
            mass_props=sim_utils.MassCfg(mass=1.0),
            collision_props=sim_utils.UsdPhysicsCollisionCfg(),
        ),
        init_state=RigidObjectCfg.InitialStateCfg(pos=(0.0, 0.0, 0.1)),
    )
    frames = FrameTransformerCfg(
        prim_path="{ENV_REGEX_NS}/Cube",
        target_frames=[FrameTransformerCfg.FrameCfg(name="mount", prim_path="{ENV_REGEX_NS}/Cube", offset=OffsetCfg(pos=MOUNT))],
    )
    camera = CameraCfg(  # default update_latest_camera_pose=False
        prim_path="{ENV_REGEX_NS}/Cube/Camera",
        offset=CameraCfg.OffsetCfg(pos=MOUNT, convention="world"),
        spawn=sim_utils.PinholeCameraCfg(),
        width=8,
        height=8,
        data_types=["distance_to_image_plane"],
        renderer_cfg=NewtonWarpRendererCfg(),
    )
    pva = PvaCfg(prim_path="{ENV_REGEX_NS}/Cube")


def main():
    sim_cfg = sim_utils.SimulationCfg(dt=0.005, device=args_cli.device, physics=NewtonCfg(solver_cfg=MJWarpSolverCfg()))
    with launch_simulation(sim_cfg, args_cli):
        sim = sim_utils.SimulationContext(sim_cfg)
        scene = InteractiveScene(SceneCfg(num_envs=2, env_spacing=2.0))
        sim.reset()
        for _ in range(10):
            sim.step()
            scene.update(sim.get_physics_dt())
        cube, frames, camera, pva = scene["cube"], scene["frames"], scene["camera"], scene["pva"]
        mount = torch.tensor(MOUNT, device=sim.device)

        # Reset env 0 as a reset event does: write a new root pose (1 m along +x).
        env_ids = torch.tensor([0], device=sim.device, dtype=torch.int32)
        pose = cube.data.root_pose_w.torch[env_ids].clone()
        pose[:, 0] += 1.0
        scene.reset(env_ids)
        cube.write_root_pose_to_sim_index(root_pose=pose, env_ids=env_ids)

        # Observation-like reads right after the reset.
        source = frames.data.source_pos_w.torch[0]
        target = frames.data.target_pos_w.torch[0, 0]
        camera_pos = camera.get_world_poses(env_ids=[0])[0][0]
        print(f"written root position         : {pose[0, :3].tolist()}")
        print(f"FrameTransformer source        : {source.tolist()}  error {torch.linalg.norm(source - pose[0, :3]):.3f} m")
        print(f"FrameTransformer target        : {target.tolist()}  error {torch.linalg.norm(target - pose[0, :3] - mount):.3f} m")
        print(f"Camera.get_world_poses()       : {camera_pos.tolist()}  error {torch.linalg.norm(camera_pos - pose[0, :3] - mount):.3f} m")

        # Push env 1 as an interval event does (no reset): 1 m along +x, upright, moving at 2 m/s along +y.
        push_ids = torch.tensor([1], device=sim.device, dtype=torch.int32)
        push_pose = cube.data.root_pose_w.torch[push_ids].clone()
        push_pose[:, 0] += 1.0
        push_pose[:, 3:] = torch.tensor([0.0, 0.0, 0.0, 1.0], device=sim.device)
        push_vel = torch.zeros(1, 6, device=sim.device)
        push_vel[:, 1] = 2.0
        cube.write_root_pose_to_sim_index(root_pose=push_pose, env_ids=push_ids)
        cube.write_root_velocity_to_sim_index(root_velocity=push_vel, env_ids=push_ids)
        pva_pos, pva_vel = pva.data.pos_w.torch[1], pva.data.lin_vel_b.torch[1]
        print(f"PVA pos_w after a push         : {pva_pos.tolist()}  error {torch.linalg.norm(pva_pos - push_pose[0, :3]):.3f} m")
        print(f"PVA lin_vel_b after a push     : {pva_vel.tolist()}  error {torch.linalg.norm(pva_vel - push_vel[0, :3]):.3f} m/s")

        # Place the body-mounted camera right after another root write, then let FK run.
        _, orientation = camera.get_world_poses(env_ids=[0], convention="world")
        pose[:, 1] += 1.0
        cube.write_root_pose_to_sim_index(root_pose=pose, env_ids=env_ids)
        placed = pose[:, :3] + 2.0 * mount
        camera.set_world_poses(placed, orientation, env_ids=[0], convention="world")
        sim.forward()
        camera_pos = camera.get_world_poses(env_ids=[0])[0][0]
        print(f"Camera after set_world_poses   : {camera_pos.tolist()}  error {torch.linalg.norm(camera_pos - placed[0]):.3f} m")


if __name__ == "__main__":
    main()

uv run python repro.py prints the following. The output is the same with --device cpu:

written root position         : [2.0, 0.0, 0.08651125431060791]
FrameTransformer source        : [1.0, 0.0, 0.08651125431060791]  error 1.000 m
FrameTransformer target        : [1.100000023841858, 0.0, 0.13651125133037567]  error 1.000 m
Camera.get_world_poses()       : [1.100000023841858, 0.0, 0.13651125133037567]  error 1.000 m
PVA pos_w after a push         : [-1.0, 0.0, 0.08651125431060791]  error 1.000 m
PVA lin_vel_b after a push     : [0.0, 0.0, -0.49050000309944153]  error 2.059 m/s
Camera after set_world_poses   : [3.200000047683716, 2.0, 0.18651124835014343]  error 1.414 m

Expected: every error is 0. The frames, the camera and the PVA sensor should report the written root pose (plus the mount offset) and velocity, and the camera should end up where set_world_poses() placed it.

System Info

  • Commit: 06f2d42 (develop). The repro prints the same output on develop 8604273, and on develop 9b6d2d8 in
    an environment synced from its uv.lock (Newton 1.8.0.dev0, MuJoCo / MuJoCo Warp 3.15.0).
  • Isaac Sim Version: 6.1.0-rc.26
  • OS: Ubuntu 24.04.2 LTS
  • GPU: NVIDIA RTX PRO 5000 Blackwell (72 GB)
  • CUDA: 13.0
  • GPU Driver: 580.126.20
  • Newton 5ea82eef (1.7.0.dev0) and MuJoCo / MuJoCo Warp 3.14.0, the pins of 06f2d42 (8604273: Newton 71eeba16, MuJoCo / MuJoCo Warp 3.15.0); Warp 1.17.0

Additional context

Checklist

  • I have checked that there is no similar issue in the repo (required)
  • I have checked that the issue is not in running Isaac Sim itself and is related to the repo

Acceptance Criteria

  • On Newton, FrameTransformer and PVA data read right after a root or joint state write, with no physics step and no sim.forward(), match the written state.
  • NewtonSiteFrameView.get_world_poses() and Camera.get_world_poses() read right after such a write return the new pose, and set_world_poses() called right after such a write places the frame at the requested world pose.
  • Reads do no extra work when no FK is pending, and nothing is recorded into captured graphs.

Activity

  1. RandomOakForest commented on Oct 16, 2026

    @RandomOakForest
    Collaborator

    Thank you for posting this and adding the PR. The team will review it.

  2. added
    bug
    on Oct 16, 2026
  3. added 2 commits that reference this issue on Oct 23, 2026
    1d1a808
    8f5f782
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions