Example #1
0
 def __init__(self, render=False, design=None, seed=None, design_mode='24lr'):
     self.robot = Ant(design, design_mode)
     WalkerBaseBulletEnv.__init__(self, self.robot, render)
     self.observation_space = spaces.Box(-np.inf, np.inf, shape=[28], dtype=np.float32)
     self.seed(seed)
     self.action_space.seed(seed)
     self.observation_space.seed(seed)
Example #2
0
    def __init__(self, render=False):
        self.init_body = np.zeros(2)
        self.robot = Ant()
        WalkerBaseBulletEnv.__init__(self, self.robot, render)

        self.param_ranges = np.vstack(
            [self.action_space.low, self.action_space.high]).T
        self.env_info = dict(num_targets=1,
                             num_obstacles=0,
                             wall_geoms=None,
                             ball_geom=None,
                             target_info=[{
                                 'xy': (20, 0)
                             }],
                             striker_ranges=None,
                             ball_ranges=None)

        self.camera_info = {
            'camera': {
                'distance': 12,
                'yaw': -0,
                'pitch': -89
            },
            'lookat': [0, 0, 0]
        }
        self.camera = TopCamera(self)
Example #3
0
 def __init__(self, xml, param, name=None, powercoeffs=[1., 1., 1.], is_eval=False, render=False, max_episode_steps=1e3):
     self.robot = Ant(xml, param, name, env=self, powercoeffs=powercoeffs)
     self.is_eval = is_eval
     self.max_episode_steps = max_episode_steps
     WalkerBaseBulletEnv.__init__(self, self.robot, render)
     self.camera = CameraOnTop(self)
     self.electricity_cost /= 10.
Example #4
0
 def __init__(self,
              xml,
              param,
              powercoeffs=[1., 1., 1.],
              render=False,
              max_episode_steps=1e3):
     self.robot = Walker2D(xml, powercoeffs)
     self.max_episode_steps = max_episode_steps
     WalkerBaseBulletEnv.__init__(self, self.robot, render)
 def __init__(self, xml, param, render=False, max_episode_steps=1000):
     self.forbid_links = {}
     self.forbid_links_name = [
         b"torso", b"thigh", b"thigh_left"
     ]  # all links that not allowed to touch the ground
     self.robot = _Walker2D(xml=xml, param=param)
     self.max_episode_steps = max_episode_steps
     WalkerBaseBulletEnv.__init__(self, self.robot, render)
     self.reset()
     self.init_forbid_links()
Example #6
0
 def __init__(self,
              xml,
              param,
              powercoeffs=[1., 1., 1.],
              is_eval=False,
              render=False,
              max_episode_steps=1e3):
     self.robot = Walker2D(xml, param, env=self, powercoeffs=powercoeffs)
     self.is_eval = is_eval
     self.max_episode_steps = max_episode_steps
     WalkerBaseBulletEnv.__init__(self, self.robot, render)
     self.camera = MyCamera(self)
Example #7
0
    def __init__(self, xml, render=False):
        self.torso_linkId = 0
        self.robot = ModularRobot(xml)
        self.xml = xml
        WalkerBaseBulletEnv.__init__(self, self.robot, render=render)
        utils.EzPickle.__init__(self)

        self.best_record_so_far = 0.
        self.current_step = 0

        self.reset()
        self.adjust_visual()
        self.reset_spaces()
        self.step(self.action_space.sample())
    def __init__(self, render=False):
        self.init_body = 0
        self.robot = HalfCheetah()
        WalkerBaseBulletEnv.__init__(self, self.robot, render)

        self.param_ranges = np.vstack([self.action_space.low,
                                       self.action_space.high]).T
        self.env_info = dict(
            num_targets=1,
            num_obstacles=0,
            wall_geoms=None,
            ball_geom=None,
            target_info=[{'xy': (20, 0)}],
            striker_ranges=None,
            ball_ranges=None)
Example #9
0
 def __init__(self,
              render=False,
              debug=False,
              xml="",
              max_episode_steps=1000,
              is_eval=False,
              param=[]):
     """ param is a ndarray stores the parameters of the body """
     self.robot = Walker2D(xml, param)
     self.debug = debug
     self.step_num = 0
     self.max_episode_steps = max_episode_steps
     self.is_eval = is_eval
     self.param = param
     self.forbid_links = [-1]
     WalkerBaseBulletEnv.__init__(self, self.robot, render)
def make(model_xml,
         robot_name,
         footlist,
         action_dim,
         obs_dim,
         render=False,
         max_episode_steps=1000,
         reward_threshold=2500.0):
    robot = type(
        "Robo", (WalkerBase, ), {
            "foot_list":
            footlist,
            "__init__":
            lambda self: _robo_init(self, model_xml, robot_name, action_dim,
                                    obs_dim),
            "apply_action":
            _robo_apply_action,
            "alive_bonus":
            _alive_bonus,
        })
    env = type(
        "Env", (WalkerBaseBulletEnv, ), {
            "__init__":
            lambda self: WalkerBaseBulletEnv.__init__(self, robot(), render)
        })
    register(id='PyBulletMjcf-v0',
             entry_point=env,
             max_episode_steps=max_episode_steps,
             reward_threshold=reward_threshold)
    return gym.make("PyBulletMjcf-v0")
Example #11
0
    def __init__(self, render=False):
        self.init_body = np.zeros(2)
        self.robot = Humanoid()
        WalkerBaseBulletEnv.__init__(self, self.robot, render)
        self.electricity_cost = 4.25 * WalkerBaseBulletEnv.electricity_cost
        self.stall_torque_cost = 4.25 * WalkerBaseBulletEnv.stall_torque_cost

        self.param_ranges = np.vstack(
            [self.action_space.low, self.action_space.high]).T
        self.env_info = dict(num_targets=1,
                             num_obstacles=0,
                             wall_geoms=None,
                             ball_geom=None,
                             target_info=[{
                                 'xy': (20, 0)
                             }],
                             striker_ranges=None,
                             ball_ranges=None)
    def __init__(self, render=False):
        self.init = True
        self.init_body = np.zeros(2)
        # self.init_ball_pos = [0.5, -0.5, .25]
        self.init_ball_pos = [0, 0, .25]
        self.init_robot_pos = [0, -1.5, .5]

        self.robot = AugmentedQuadruped(scale=100)
        WalkerBaseBulletEnv.__init__(self, self.robot, render)
        self.param_ranges = np.vstack(
            [self.action_space.low, self.action_space.high]).T
        _offset = 0.25 / 2
        self.ball_ranges = np.array([[-6. + _offset, 6. - _offset],
                                     [-3. + _offset, 9 - _offset]])
        self.env_info = dict(num_targets=1,
                             num_obstacles=0,
                             wall_geoms=[0, 1, 2, 3],
                             ball_geom=5,
                             target_info=[{
                                 'xy': (-0.5, 1.),
                                 'radius': 0.25
                             }],
                             striker_ranges=self.param_ranges,
                             ball_ranges=self.ball_ranges)
        # self.camera_info = {'camera': {'distance': 10,
        #                                'yaw': -0,
        #                                'pitch': -69},
        #                     'lookat': [0, 0, 0]}
        self.camera_info = {
            'camera': {
                'distance': 12,
                'yaw': -0,
                'pitch': -89
            },
            'lookat': [0, 3, 0]
        }
        self.camera = TopCamera(self)
        self._render_width = 240
        self._render_height = 240
        self.init = False
Example #13
0
 def __init__(self, render=False):
     self.robot = SwolArm()
     WalkerBaseBulletEnv.__init__(self, self.robot, render)
 def __init__(self, render=False):
     self.robot = Walker2D_1()
     WalkerBaseBulletEnv.__init__(self, self.robot, render)
Example #15
0
 def __init__(self, xml, param, render=False, max_episode_steps=1000):
     self.robot = _Walker2D(xml=xml, param=param)
     self.max_episode_steps = max_episode_steps
     WalkerBaseBulletEnv.__init__(self, self.robot, render)
Example #16
0
 def __init__(self, xml, render=False):
     self.robot = MyAnt(xml=xml)
     self.xml = xml
     WalkerBaseBulletEnv.__init__(self, self.robot, render)
Example #17
0
 def __init__(self, morphology_xml, render=False):
     self.robot = CustomAnt(morphology_xml)
     WalkerBaseBulletEnv.__init__(self, self.robot, render)
Example #18
0
 def __init__(self, render=False):
     self.robot = locomotion_robots.AntSixLegs()
     WalkerBaseBulletEnv.__init__(self, self.robot, render)
Example #19
0
 def __init__(self, render=False):
     self.robot = locomotion_robots.Ant_Crippled_RightBackLeg()
     WalkerBaseBulletEnv.__init__(self, self.robot, render)