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

Can not place an obj with fixed_base on other obj using "OnTop" #1047

Open
dexin-wang opened this issue Dec 6, 2024 · 0 comments
Open

Can not place an obj with fixed_base on other obj using "OnTop" #1047

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

Comments

@dexin-wang
Copy link

dexin-wang commented Dec 6, 2024

Describe the bug
Can not place an obj with fixed_base on other obj using "OnTop".
Reason: During the OnTop operation, obj1 is moved to a position above obj2 with z_offset=5cm. However, the fixed_base property prevents obj1 from falling automatically, causing the subsequent Touching check to fail, ultimately leading to repeated attempts and eventual failure.

To Reproduce

import omnigibson as og
import torch
from omnigibson import object_states

cfg = dict()

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

# Define objects
cfg["objects"] = [
    {
        "type": "DatasetObject",
        "name": "fridge",
        "category": "fridge",
        "model": "dszchb",
        "position": [0, 5, 10],
        # "bounding_box": [1.065, 1.149, 1.528],
        "fixed_base": True
    },
    {
        "type": "DatasetObject",
        "name": "ground",
        "category": "floors",
        "model": "2w2nau",
        "position": [10, 10, 0.1],
        "bounding_box": [5, 5, 0.1],
        "fixed_base": True,
        "visible": True,
        # "visual_only": True
    },
    {
        "type": "LightObject",
        "name": "brilliant_light",
        "light_type": "Sphere",
        "intensity": 50000,
        "radius": 0.1,
        "position": [3.0, 3.0, 4.0],
    },
]

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

fridge = env.scene.object_registry("name", 'fridge')
ground = env.scene.object_registry("name", 'ground')
fridge.states[object_states.OnTop].set_value(ground, True)

for t in range(10000):
    obs, rew, terminated, truncated, info = env.step(torch.empty(0))
    
og.clear()

Expected behavior
Obj1 (fridge) is placed on top of obj2 (ground).

Screenshots
no need.

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]

Additional context
A simple improvement solution:
(1) set z_offset = 0 if obj1 is fixed_base in omnigibson/utils/object_state_utils.py/def sample_kinematics(),
(2) do not check Touching for obj1 with fixed_base in omnigibson/object_states/on_top.py/def _get_value().

@dexin-wang dexin-wang added the bug Something isn't working label Dec 6, 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