Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

env.reload() reports an error [ValueError: Found zero norm quaternions in quat] #1060

Open
dexin-wang opened this issue Dec 20, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@dexin-wang
Copy link

Describe the bug
A clear and concise description of what the bug is.
env.reload() reports an error [ValueError: Found zero norm quaternions in quat]

To Reproduce

import omnigibson as og
import torch
import omnigibson.lazy as lazy
from omnigibson import object_states
import omnigibson.utils.transform_utils as T

cfg = dict()

# Define scene
cfg["scene"] = {
    "type": "Scene",
    "floor_plane_visible": True,
}

# Define objects
cfg["objects"] = [
    # dataset
    {
        "type": "DatasetObject",
        "name": "cutting_board",
        "category": "cutting_board",
        "model": "jfrbuz",
        "position": [0, 0, 1],
        "fixed_base": True,
    },
    {
        "type": "DatasetObject",
        "name": "carving_knife",
        "category": "carving_knife",
        "model": "alekva",
        "position": [0, 0, 1.5]
    },
]


# Create the environment
env = og.Environment(cfg)

# place table to ground
table = env.scene.object_registry("name", "cutting_board")
table.set_orientation([0, 0, 0, 1.0])
env.step([])
offset = table.get_position_orientation()[0][2] - table.aabb_center[2]
table.set_position_orientation(position=torch.tensor([0, 0, table.aabb_extent[2] / 2+ offset]))
env.step([])

for t in range(100):
    env.step([])

og.sim.stop()

env.reload(cfg)

og.clear()

error

Traceback (most recent call last):
  File "/home/wdx/research/general_manipulation_v1/RoboGen_wdx/test/ontop.py", line 43, in <module>
    env = og.Environment(cfg)
  File "/home/wdx/research/general_manipulation_v1/RoboGen_wdx/omnigibson/utils/python_utils.py", line 93, in wrapper
    func(*values.args, **values.kwargs)
  File "/home/wdx/research/general_manipulation_v1/RoboGen_wdx/omnigibson/envs/env_base.py", line 141, in __init__
    self.load()
  File "/home/wdx/research/general_manipulation_v1/RoboGen_wdx/omnigibson/envs/env_base.py", line 439, in load
    self._load_objects()
  File "/home/wdx/research/general_manipulation_v1/RoboGen_wdx/omnigibson/envs/env_base.py", line 323, in _load_objects
    self.scene.add_object(obj)
  File "/home/wdx/research/general_manipulation_v1/RoboGen_wdx/omnigibson/scenes/scene_base.py", line 630, in add_object
    prim = obj.load(self)
  File "/home/wdx/research/general_manipulation_v1/RoboGen_wdx/omnigibson/objects/object_base.py", line 123, in load
    prim = super().load(scene)
  File "/home/wdx/research/general_manipulation_v1/RoboGen_wdx/omnigibson/prims/prim_base.py", line 116, in load
    self._post_load()
  File "/home/wdx/research/general_manipulation_v1/RoboGen_wdx/omnigibson/objects/dataset_object.py", line 241, in _post_load
    super()._post_load()
  File "/home/wdx/research/general_manipulation_v1/RoboGen_wdx/omnigibson/objects/stateful_object.py", line 144, in _post_load
    super()._post_load()
  File "/home/wdx/research/general_manipulation_v1/RoboGen_wdx/omnigibson/objects/object_base.py", line 161, in _post_load
    super()._post_load()
  File "/home/wdx/research/general_manipulation_v1/RoboGen_wdx/omnigibson/prims/entity_prim.py", line 127, in _post_load
    self.update_links()
  File "/home/wdx/research/general_manipulation_v1/RoboGen_wdx/omnigibson/prims/entity_prim.py", line 259, in update_links
    self._links[link_name].load(self.scene)
  File "/home/wdx/research/general_manipulation_v1/RoboGen_wdx/omnigibson/prims/prim_base.py", line 116, in load
    self._post_load()
  File "/home/wdx/research/general_manipulation_v1/RoboGen_wdx/omnigibson/prims/rigid_prim.py", line 93, in _post_load
    self._rigid_prim_view_direct = RigidPrimView(self.prim_path)
  File "/home/wdx/.local/share/ov/pkg/isaac-sim-4.1.0/exts/omni.isaac.core/omni/isaac/core/prims/rigid_prim_view.py", line 145, in __init__
    XFormPrimView.__init__(
  File "/home/wdx/.local/share/ov/pkg/isaac-sim-4.1.0/exts/omni.isaac.core/omni/isaac/core/prims/xform_prim_view.py", line 175, in __init__
    self._set_xform_properties()
  File "/home/wdx/.local/share/ov/pkg/isaac-sim-4.1.0/exts/omni.isaac.core/omni/isaac/core/prims/xform_prim_view.py", line 322, in _set_xform_properties
    self.set_world_poses(positions=current_positions, orientations=current_orientations)
  File "/home/wdx/.local/share/ov/pkg/isaac-sim-4.1.0/exts/omni.isaac.core/omni/isaac/core/prims/rigid_prim_view.py", line 367, in set_world_poses
    XFormPrimView.set_world_poses(
  File "/home/wdx/.local/share/ov/pkg/isaac-sim-4.1.0/exts/omni.isaac.core/omni/isaac/core/prims/xform_prim_view.py", line 940, in set_world_poses
    calculated_translations, calculated_orientations = self._backend_utils.get_local_from_world(
  File "/home/wdx/.local/share/ov/pkg/isaac-sim-4.1.0/exts/omni.isaac.core/omni/isaac/core/utils/torch/transformations.py", line 44, in get_local_from_world
    my_world_transforms = tf_matrices_from_poses(translations=positions, orientations=orientations, device=device)
  File "/home/wdx/.local/share/ov/pkg/isaac-sim-4.1.0/exts/omni.isaac.core/omni/isaac/core/utils/torch/transformations.py", line 34, in tf_matrices_from_poses
    r = Rotation.from_quat(orientations[:, [1, 2, 3, 0]].detach().cpu().numpy())
  File "_rotation.pyx", line 637, in scipy.spatial.transform._rotation.Rotation.from_quat
  File "_rotation.pyx", line 532, in scipy.spatial.transform._rotation.Rotation.__init__
ValueError: Found zero norm quaternions in `quat`.

Desktop (please complete the following information):

  • OS: [e.g. Ubuntu 20.04]
  • Isaac Sim Version [e.g. 4.1.0]
  • OmniGibson Version [e.g. 1.1.0]
@dexin-wang dexin-wang added the bug Something isn't working label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants