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

Rewrite particle modifier demo #779

Merged
merged 8 commits into from
Sep 24, 2024
Prev Previous commit
Next Next commit
Merge branch 'og-develop' of https://github.com/StanfordVL/OmniGibson
…into rewrite-particle-modifier-demo
  • Loading branch information
hang-yin committed Sep 24, 2024
commit 194317eaf7f16b2a24792e3416a56d748c0cf585
20 changes: 10 additions & 10 deletions omnigibson/examples/object_states/particle_applier_remover_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,23 +153,23 @@ def main(random_selection=False, headless=False, short_exec=False):
# Set the modifier object to be in position to modify particles
if modifier_type == "particleRemover" and method_type == "Projection":
tool.set_position_orientation(
position=np.array([0, 0.3, 1.45]),
orientation=np.array([0, 0, 0, 1.0]),
position=[0, 0.3, 1.45],
orientation=[0, 0, 0, 1.0],
)
elif modifier_type == "particleRemover" and method_type == "Adjacency":
tool.set_position_orientation(
position=np.array([0, 0.3, 1.175]),
orientation=np.array([0, 0, 0, 1.0]),
position=[0, 0.3, 1.175],
orientation=[0, 0, 0, 1.0],
)
elif modifier_type == "particleApplier" and particle_type == "water":
tool.set_position_orientation(
position=np.array([0, 0.3, 1.4]),
orientation=np.array([0.3827, 0, 0, 0.9239]),
position=[0, 0.3, 1.4],
orientation=[0.3827, 0, 0, 0.9239],
)
else:
tool.set_position_orientation(
position=np.array([0, 0.3, 1.5]),
orientation=np.array([0.7071, 0, 0.7071, 0]),
position=[0, 0.3, 1.5],
orientation=[0.7071, 0, 0.7071, 0],
)

# Move object in square around table
Expand All @@ -181,8 +181,8 @@ def main(random_selection=False, headless=False, short_exec=False):
]
for t, delta in deltas:
for _ in range(t):
tool.set_position(tool.get_position() + delta)
env.step(np.array([]))
tool.set_position_orientation(position=tool.get_position_orientation()[0] + delta)
env.step(th.empty(0))

# Always shut down environment at the end
og.clear()
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.