Skip to content

Commit

Permalink
Merge pull request #142 from StanfordVL/demo-fix
Browse files Browse the repository at this point in the history
fix bugs in og examples
  • Loading branch information
wensi-ai authored Apr 1, 2023
2 parents 169977d + bfbbdc0 commit 1195a40
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion omnigibson/configs/fetch_behavior.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ objects: []

task:
type: BehaviorTask
activity_name: putting_away_Halloween_decorations
activity_name: assembling_gift_baskets
activity_definition_id: 0
activity_instance_id: 0
predefined_problem: null
Expand Down
6 changes: 4 additions & 2 deletions omnigibson/examples/learning/navigation_policy_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
og.log.error("torch, stable-baselines3, or tensorboard is not installed. "
"See which packages are missing, and then run the following for any missing packages:\n"
"pip install torch\n"
"pip install stable-baselines3\n"
"pip install tensorboard")
"pip install stable-baselines3==1.7.0\n"
"pip install tensorboard\n"
"Also, please update gym to 0.26.1 after installing sb3: pip install gym==0.26.1")
exit(1)

assert gym.__version__ == '0.26.1', "Please install/update gym to version 0.26.1"

# We don't need object states nor transitions rules, so we disable them now, and also enable flatcache for maximum speed
gm.ENABLE_OBJECT_STATES = False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def main(random_selection=False, headless=False, short_exec=False):
type="DatasetObject",
name="banana",
category="banana",
model="09_0",
model="vvyyyv",
scale=[3.0, 5.0, 2.0],
position=[-0.906661, -0.545106, 0.136824],
orientation=[0, 0, 0.76040583, -0.6494482 ],
Expand All @@ -24,7 +24,7 @@ def main(random_selection=False, headless=False, short_exec=False):
type="DatasetObject",
name="door",
category="door",
model="8930",
model="ohagsq",
position=[-2.0, 0, 0.70000001],
orientation=[0, 0, -0.38268343, 0.92387953],
)
Expand Down
2 changes: 1 addition & 1 deletion omnigibson/prims/material_prim.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def shader_force_populate(self, render=True):
occurred externally, no additional rendering step is needed
"""
assert self._shader is not None
asyncio.run(asyncio.wait([self._load_mdl_parameters(render=render)]))
asyncio.run(self._load_mdl_parameters(render=render))

def shader_update_asset_paths_with_root_path(self, root_path):
"""
Expand Down
2 changes: 1 addition & 1 deletion omnigibson/robots/manipulation_robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ def _establish_grasp_rigid(self, arm="default", ag_data=None):
joint_type=joint_type,
body0=self.eef_links[arm].prim_path,
body1=ag_link.prim_path,
enabled=False,
enabled=True,
joint_frame_in_parent_frame_pos=parent_frame_pos / self.scale,
joint_frame_in_parent_frame_quat=parent_frame_orn,
joint_frame_in_child_frame_pos=child_frame_pos / ag_obj.scale,
Expand Down
5 changes: 3 additions & 2 deletions omnigibson/utils/ui_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,11 +715,12 @@ def get_teleop_action(self):
# Only handle the action if the value is specified
if val is not None:
# If there is no index, the user is controlling a joint with "[" and "]"
if idx is None:
if idx is None and len(self.joint_command_idx) != 0:
idx = self.joint_command_idx[self.active_joint_command_idx_idx]

# Set the action
action[idx] = val
if idx is not None:
action[idx] = val

# Possibly set the persistent gripper action
if len(self.binary_grippers) > 0 and self.keypress_mapping[carb.input.KeyboardInput.T]["val"] is not None:
Expand Down

0 comments on commit 1195a40

Please sign in to comment.