Skip to content

[Bug Report] Reshape + shape computation issues with observation manager #1957

Closed

Description

@pculbertson-bdai

Description

The observation manager has a couple issues when providing history_length != None. In particular:

  1. The env.observation_shape is computed incorrectly for these groups when flatten_history_dim=False. (See below for a concrete example).
  2. When flatten_history_dim=True the observation is not returned in a way that is easy to reshape to recover the common history dimension.

While 2 may be a feature request (I thought this was the expected behavior, but realized it is unclear in hindsight), 1 is certainly a bug with how the observations are being handled currently.

Steps to Reproduce

  1. Create an observation group with multiple history-enabled terms. For example:
@configclass
class ObservationManagerCfg:
    @configclass
    class PolicyCfg(ObservationGroupCfg):
        history_length = H
        flatten_history_dim = False
        term1 = ObservationTermCfg(func=f1) # f1 returns shape (D1,)
        term2 = ObservationTermCfg(func=f2) # f2 returns shape (D2,)

    policy = PolicyCfg()

Expected: Upon instantiating the env, env.observation_space["policy"].shape is (num_envs, H, D1 + D2).
Actual: Upon instantiating the env, env.observation_space["policy"].shape is (num_envs, 2H, D1 + D2).

  1. Create an observation group with flatten_history_dim=True (e.g., change this parameter of the last example.

When reading an observation from the observation manager,

policy_obs = observation_manager.compute()["policy"]

Expected: policy_obs.reshape(-1, H, D1 + D2) = torch.concatenate([term1, term2], dim=-1). Note this is poor syntax - but ideally we could reconstruct the observations with a coherent history dim.
Actual: policy_obs = torch.concatenate([term1.reshape(num_envs, -1), term2.reshape(num_envs, -1)], dim=-1). The reshape does not preserve a history dimension.

System Info

Describe the characteristic of your environment:

  • Commit: f1a4975
  • Isaac Sim Version: 4.5.0
  • OS: Ubuntu 22.04
  • GPU: RTX 5000 Ada
  • CUDA: 12.2
  • GPU Driver: 535.183.01

Additional context

Will open a PR with suggested changes to fix these issues.

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

  • Concatenated, unflattened histories have the correct shape in env.observation_space
  • History observations can be reshaped easily to preserve a history dim.

Activity

  1. RandomOakForest commented on Mar 1, 2025

    @RandomOakForest
    Collaborator

    Thanks for posting this. The team will review.

  2. added
    bug
    on Mar 1, 2025
  3. self-assigned this
    on Apr 2, 2025
  4. jtigue-bdai commented on Apr 2, 2025

    @jtigue-bdai
    Collaborator

    This may also be addressing the further concerns of #1208 of flattened history order ABCABC instead of AABBCC

  5. added a commit that references this issue on Sep 27, 2026
    bbeaf46
  6. StafaH commented on Sep 27, 2026

    @StafaH
    Collaborator

    This is now fully fixed by #8079 (the shape bug was fixed in a previous PR)

  7. added a commit that references this issue on Sep 27, 2026
    886e3a5
  8. added a commit that references this issue on Nov 19, 2026
    a6492b2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions