diff --git a/robosuite/environments/base.py b/robosuite/environments/base.py index a102225f77..9377363027 100644 --- a/robosuite/environments/base.py +++ b/robosuite/environments/base.py @@ -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): """ diff --git a/robosuite/environments/robot_env.py b/robosuite/environments/robot_env.py index 7132057c1d..5751aa8d3d 100644 --- a/robosuite/environments/robot_env.py +++ b/robosuite/environments/robot_env.py @@ -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): """ diff --git a/robosuite/renderers/igibson/igibson_renderer.py b/robosuite/renderers/igibson/igibson_renderer.py index 5f627be6b8..4b7f1bf603 100644 --- a/robosuite/renderers/igibson/igibson_renderer.py +++ b/robosuite/renderers/igibson/igibson_renderer.py @@ -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 @@ -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: