コード例 #1
0
 def __init__(self):
     WalkerBase.__init__(self, power=0.90)
     MJCFBasedRobot.__init__(self,
                             "half_cheetah.xml",
                             "torso",
                             action_dim=6,
                             obs_dim=26)
コード例 #2
0
 def __init__(self, rand_init=False):
     '''
     Initialize the robot
     :param rand_init: If True, randomly initialize robot position.
     '''
     MJCFBasedRobot.__init__(self, 'reacher.xml', 'body0', action_dim=2, obs_dim=9)
     self.rand_init = rand_init
コード例 #3
0
ファイル: grasp_box.py プロジェクト: hwip/synergy-pybullet
 def __init__(self):
     MJCFBasedRobot.__init__(self, "/root/synergyenvs/synergyenvs/envs/assets/hand/grasp_block.xml", "body0",
                             action_dim=21, obs_dim=102)
     self.action_space = gym.spaces.Box(-np.ones([21]), np.ones([21]), dtype='float32')
     self.observation_space = spaces.Dict(dict(
         desired_goal=spaces.Box(-np.inf, np.inf, shape=(3,), dtype='float32'),
         achieved_goal=spaces.Box(-np.inf, np.inf, shape=(3,), dtype='float32'),
         observation=spaces.Box(-np.inf, np.inf, shape=(96,), dtype='float32'),
     ))
     self.jname = ["robot0:slider",
                   "robot0:WRJ1", "robot0:WRJ0",
                   "robot0:FFJ3", "robot0:FFJ2", "robot0:FFJ1",
                   "robot0:MFJ3", "robot0:MFJ2", "robot0:MFJ1", "robot0:LFJ4",
                   "robot0:RFJ3", "robot0:RFJ2", "robot0:RFJ1",
                   "robot0:LFJ3", "robot0:LFJ2", "robot0:LFJ1",
                   "robot0:THJ4", "robot0:THJ3", "robot0:THJ2", "robot0:THJ1", "robot0:THJ0"]
     self.djname = ["robot0:FFJ0", "robot0:MFJ0", "robot0:RFJ0", "robot0:LFJ0"]
     # ranges of each joint in the hand, described in grasp_block.xml
     self.ctrlrange = np.array([[-0.1, 0.4],
                       [-0.489, 0.14], [-0.698, 0.489],
                       [-0.349, 0.349], [0, 0.1571], [0, 0.1571],
                       [-0.349, 0.349], [0, 0.1571], [0, 0.1571],
                       [-0.349, 0.349], [0, 0.1571], [0, 0.1571], [0, 0.785],
                       [-0.349, 0.349], [0, 0.1571], [0, 0.1571],
                       [-1.047, 1.047], [0, 1.222], [-0.209, 0.209], [-0.524, 0.524], [-1.571, 0]])
     self.forcerange = np.array([[-1.0, 1.0],
                        [-4.784, 4.785], [-2.175, 2.174],
                        [-0.9, 0.9], [-0.9, 0.9], [-0.7245, 0.7245],
                        [-0.9, 0.9], [-0.9, 0.9], [-0.7245, 0.7245],
                        [-0.9, 0.9], [-0.9, 0.9], [-0.7245, 0.7245], [-0.9, 0.9],
                        [-0.9, 0.9], [-0.9, 0.9], [-0.7245, 0.7245],
                        [-2.3722, 2.3722], [-1.45, 1.45], [-0.99, 0.99], [-0.99, 0.99], [-0.81, 0.81]])
コード例 #4
0
 def __init__(self):
     WalkerBase.__init__(self, power=0.75)
     MJCFBasedRobot.__init__(self,
                             "hopper.xml",
                             "torso",
                             action_dim=3,
                             obs_dim=17)
コード例 #5
0
 def __init__(self, rand_init=False):
     MJCFBasedRobot.__init__(self,
                             'reacher.xml',
                             'body0',
                             action_dim=2,
                             obs_dim=9)
     self.rand_init = rand_init
コード例 #6
0
 def __init__(self):
     WalkerBase.__init__(self, power=0.40)
     MJCFBasedRobot.__init__(self,
                             "walker2d.xml",
                             "torso",
                             action_dim=6,
                             obs_dim=22 + 1)
コード例 #7
0
 def __init__(self):
     WalkerBase.__init__(self, power=2.5)
     MJCFBasedRobot.__init__(self,
                             "ant.xml",
                             "torso",
                             action_dim=8,
                             obs_dim=28 + 1)
コード例 #8
0
 def __init__(self):
     WalkerBase.__init__(self, power=2.5)
     MJCFBasedRobot.__init__(self,
                             "ant.xml",
                             "torso",
                             action_dim=8 + 1,
                             obs_dim=28 + 1)
     self.aggressive_cube = None
     self.frame = 0
コード例 #9
0
 def __init__(self):
     WalkerBase.__init__(self, power=0.75)
     MJCFBasedRobot.__init__(self,
                             "hopper.xml",
                             "torso",
                             action_dim=3 + 1,
                             obs_dim=15 + 1)
     self.aggressive_cube = None
     self.frame = 0
コード例 #10
0
 def __init__(self):
     WalkerBase.__init__(self, power=0.40)
     MJCFBasedRobot.__init__(self,
                             "walker2d.xml",
                             "torso",
                             action_dim=6 + 1,
                             obs_dim=22 + 1)
     self.aggressive_cube = None
     self.frame = 0
コード例 #11
0
 def __init__(self):
     WalkerBase.__init__(self, power=0.90)
     MJCFBasedRobot.__init__(self,
                             "half_cheetah.xml",
                             "torso",
                             action_dim=6 + 1,
                             obs_dim=26 + 1)
     self.aggressive_cube = None
     self.frame = 0
コード例 #12
0
ファイル: humanoid.py プロジェクト: Pooja199/pybullet-gym
 def __init__(self, random_yaw=False, random_lean=False):
     WalkerBase.__init__(self, power=0.41)
     MJCFBasedRobot.__init__(self,
                             'humanoid_symmetric.xml',
                             'torso',
                             action_dim=17,
                             obs_dim=44)
     # 17 joints, 4 of them important for walking (hip, knee), others may as well be turned off, 17/4 = 4.25
     self.random_yaw = random_yaw
     self.random_lean = random_lean
コード例 #13
0
ファイル: reacher_colours.py プロジェクト: wx-b/pybullet-gym
 def __init__(self):
     MJCFBasedRobot.__init__(self,
                             'reacher_4goal.xml',
                             'body0',
                             action_dim=2,
                             obs_dim=9)
     self.goal_positions = np.array(
         [[self.TARG_LIMIT, self.TARG_LIMIT],
          [self.TARG_LIMIT, -self.TARG_LIMIT],
          [-self.TARG_LIMIT, -self.TARG_LIMIT],
          [-self.TARG_LIMIT, self.TARG_LIMIT]
          ],  # defined clockwise NE->SE->SW->NW
         dtype=np.float32)
コード例 #14
0
 def __init__(self):
     WalkerBase.__init__(self, power=0.90)
     MJCFBasedRobot.__init__(self,
                             "half_cheetah.xml",
                             "torso",
                             action_dim=6,
                             obs_dim=26)
     self.aggressive_cube = None
     self.frame = 0
     self.reset_count = 0
     self.cube_masses = np.repeat(
         np.linspace(0.1, 2.2, 50),
         20)  # [0.1 (10 times), 0.15 (10 times), ..., 1.05, 1.05]
コード例 #15
0
 def __init__(self):
     MJCFBasedRobot.__init__(self,
                             'reacher3.xml',
                             'body0',
                             action_dim=3,
                             obs_dim=11,
                             parent_collision=False)
     self.goal_positions = np.array(
         [[self.TARG_LIMIT, self.TARG_LIMIT],
          [self.TARG_LIMIT, -self.TARG_LIMIT],
          [-self.TARG_LIMIT, -self.TARG_LIMIT],
          [-self.TARG_LIMIT, self.TARG_LIMIT]
          ],  # defined clockwise NE->SE->SW->NW
         dtype=np.float32)
コード例 #16
0
 def __init__(self, random_yaw=False, random_lean=False):
     WalkerBase.__init__(self, power=0.41)
     MJCFBasedRobot.__init__(self,
                             'humanoid_symmetric.xml',
                             'torso',
                             action_dim=17,
                             obs_dim=44)
     # 17 joints, 4 of them important for walking (hip, knee), others may as well be turned off, 17/4 = 4.25
     self.random_yaw = random_yaw
     self.random_lean = random_lean
     self.aggressive_cube = None
     self.frame = 0
     self.reset_count = 0
     self.cube_masses = np.repeat(
         np.linspace(0.1, 2.2, 50),
         20)  # [0.1 (10 times), 0.15 (10 times), ..., 1.05, 1.05]
コード例 #17
0
 def __init__(self):
     WalkerBase.__init__(self, power=2.5)
     MJCFBasedRobot.__init__(self,
                             "ant.xml",
                             "torso",
                             action_dim=8,
                             obs_dim=28)
     self.aggressive_cube = None
     self.frame = 0
     self.reset_count = 0
     # self.cube_masses = np.repeat(np.arange(0.1,1.1,0.05),10) # [0.1 (10 times), 0.15 (10 times), ..., 1.05, 1.05]
     self.cube_masses = np.repeat(
         np.arange(0.1, 2.2, 1),
         3)  # [0.1 (10 times), 0.15 (10 times), ..., 1.05, 1.05]
     self.cube_masses = np.repeat(
         np.linspace(0.1, 6.2, 50),
         20)  # [0.1 (10 times), 0.15 (10 times), ..., 1.05, 1.05]
コード例 #18
0
 def __init__(self, target):
     MJCFBasedRobot.__init__(self, 'reacher.xml', 'body0', action_dim=2, obs_dim=4)
     self.target_pos = target
コード例 #19
0
 def __init__(self):
     MJCFBasedRobot.__init__(self,
                             'reacher.xml',
                             'body0',
                             action_dim=2,
                             obs_dim=9)
コード例 #20
0
 def __init__(self):
     MJCFBasedRobot.__init__(self,
                             'pusher.xml',
                             'body0',
                             action_dim=7,
                             obs_dim=55)
コード例 #21
0
 def __init__(self):
     MJCFBasedRobot.__init__(self,
                             'inverted_pendulum.xml',
                             'cart',
                             action_dim=1,
                             obs_dim=5)
コード例 #22
0
 def __init__(self):
     MJCFBasedRobot.__init__(self,
                             'thrower.xml',
                             'body0',
                             action_dim=7,
                             obs_dim=48)