Skip to content

Commit

Permalink
v1.3 updates (#265)
Browse files Browse the repository at this point in the history
Address remaining issues in #260

* remove unnecessary code and HAS_TORCH flag
* add set_camera_pos_quat function for iG
  • Loading branch information
yukezhu authored Nov 3, 2021
1 parent b95d00b commit a08b5a9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions robosuite/environments/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,10 @@ def visualize(self, vis_settings):
obj.set_sites_visibility(sim=self.sim, visible=vis_settings["env"])

def set_camera_pos_quat(self, camera_pos, camera_quat):
if self.renderer == "nvisii":
if self.renderer in ["nvisii", "igibson"]:
self.viewer.set_camera_pos_quat(camera_pos, camera_quat)
else:
print('Setting camera position and quat requires NVISII renderer.')
raise AttributeError('setting camera position and quat requires renderer to be either NVISII or iGibson.')

def reset_from_xml_string(self, xml_string):
"""
Expand Down
5 changes: 0 additions & 5 deletions robosuite/environments/robot_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
from robosuite.robots import ROBOT_CLASS_MAPPING
from robosuite.controllers import reset_controllers

try:
import torch
HAS_TORCH = True
except ImportError:
HAS_TORCH = False

class RobotEnv(MujocoEnv):
"""
Expand Down
3 changes: 1 addition & 2 deletions robosuite/renderers/igibson/igibson_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ def camera_normal(obs_cache):

return sensors, names


def _switch_camera(self, camera_name):
"""
Change renderer camera to one of the available cameras of the environment
Expand Down Expand Up @@ -406,7 +405,7 @@ def _get_camera_pose(self, camera_name):

raise Exception(f"Camera {self.env.render_camera} not present")

def _set_camera_pos_quat(self, pos, quat):
def set_camera_pos_quat(self, pos, quat):
"""Set renderer position and quaternion.
Args:
Expand Down

0 comments on commit a08b5a9

Please sign in to comment.