How to use the robosuite.models.arenas.Arena function in robosuite

To help you get started, we’ve selected a few robosuite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SudeepDasari / visual_foresight / visual_mpc / envs / mujoco_env / sawyer_env / robosuite_wrappers / BinArena.py View on Github external
import numpy as np
import os
try:
    from robosuite.models.arenas import Arena
    from robosuite.utils.mjcf_utils import xml_path_completion
    from robosuite.utils.mjcf_utils import array_to_string, string_to_array
except:
    print("Robosuite is required to use this module. Please try ' pip install robosuite' ")
    raise ImportError()


class BinArena(Arena):
    """Workspace that contains an empty table."""

    def __init__(
        self, table_full_size=(0.8, 0.8, 0.8), table_friction=(1, 0.005, 0.0001)
    ):
        """
        Args:
            table_full_size: full dimensions of the table
            friction: friction parameters of the table
        """
        assets_root = os.path.dirname(__file__)
        super().__init__(xml_path_completion("{}/bin_arena.xml".format(assets_root)))

        self.table_full_size = np.array(table_full_size)
        self.table_half_size = self.table_full_size / 2
        self.table_friction = table_friction