def robot_specific_reset(self, bullet_client): WalkerBase.robot_specific_reset(self, bullet_client) self.motor_names = ["abdomen_z", "abdomen_y", "abdomen_x"] self.motor_power = [100, 100, 100] self.motor_names += ["right_hip_x", "right_hip_z", "right_hip_y", "right_knee"] self.motor_power += [100, 100, 300, 200] self.motor_names += ["left_hip_x", "left_hip_z", "left_hip_y", "left_knee"] self.motor_power += [100, 100, 300, 200] self.motor_names += ["right_shoulder1", "right_shoulder2", "right_elbow"] self.motor_power += [75, 75, 75] self.motor_names += ["left_shoulder1", "left_shoulder2", "left_elbow"] self.motor_power += [75, 75, 75] self.motors = [self.jdict[n] for n in self.motor_names] if self.random_yaw: position = [0,0,0] orientation = [0,0,0] yaw = self.np_random.uniform(low=-3.14, high=3.14) if self.random_lean and self.np_random.randint(2) == 0: if self.np_random.randint(2) == 0: pitch = np.pi/2 position = [0, 0, 0.45] else: pitch = np.pi*3/2 position = [0, 0, 0.25] roll = 0 orientation = [roll, pitch, yaw] else: position = [0, 0, 1.4] orientation = [0, 0, yaw] # just face random direction, but stay straight otherwise self.robot_body.reset_position(position) self.robot_body.reset_orientation(p.getQuaternionFromEuler(orientation)) self.initial_z = 0.8
def robot_specific_reset(self, bullet_client): WalkerBase.robot_specific_reset(self, bullet_client) self.jdict["bthigh"].power_coef = 120.0 self.jdict["bshin"].power_coef = 90.0 self.jdict["bfoot"].power_coef = 60.0 self.jdict["fthigh"].power_coef = 140.0 self.jdict["fshin"].power_coef = 60.0 self.jdict["ffoot"].power_coef = 30.0
def robot_specific_reset(self, bullet_client): WalkerBase.robot_specific_reset(self, bullet_client) self.frame = 0 if self.aggressive_cube: self._p.resetBasePositionAndOrientation( self.aggressive_cube.bodies[0], [-1.5, 0, 0.05], [0, 0, 0, 1]) else: self.aggressive_cube = ObjectHelper.get_cube( self._p, -1.5, 0, 0.05)
def robot_specific_reset(self, bullet_client): WalkerBase.robot_specific_reset(self, bullet_client) self.motor_names = ["abdomen_z", "abdomen_y", "abdomen_x"] self.motor_power = [100, 100, 100] self.motor_names += [ "right_hip_x", "right_hip_z", "right_hip_y", "right_knee" ] self.motor_power += [100, 100, 300, 200] self.motor_names += [ "left_hip_x", "left_hip_z", "left_hip_y", "left_knee" ] self.motor_power += [100, 100, 300, 200] self.motor_names += [ "right_shoulder1", "right_shoulder2", "right_elbow" ] self.motor_power += [75, 75, 75] self.motor_names += ["left_shoulder1", "left_shoulder2", "left_elbow"] self.motor_power += [75, 75, 75] self.motors = [self.jdict[n] for n in self.motor_names] if self.random_yaw: position = [0, 0, 0] orientation = [0, 0, 0] yaw = self.np_random.uniform(low=-3.14, high=3.14) if self.random_lean and self.np_random.randint(2) == 0: if self.np_random.randint(2) == 0: pitch = np.pi / 2 position = [0, 0, 0.45] else: pitch = np.pi * 3 / 2 position = [0, 0, 0.25] roll = 0 orientation = [roll, pitch, yaw] else: position = [0, 0, 1.4] orientation = [ 0, 0, yaw ] # just face random direction, but stay straight otherwise self.robot_body.reset_position(position) self.robot_body.reset_orientation( p.getQuaternionFromEuler(orientation)) self.initial_z = 0.8 self.frame = 0 if self.aggressive_cube: self._p.resetBasePositionAndOrientation( self.aggressive_cube.bodies[0], [-1.5, 0, 0.05], [0, 0, 0, 1]) self._p.changeDynamics(self.aggressive_cube.bodies[0], -1, mass=self.cube_masses[self.reset_count]) else: self.aggressive_cube = ObjectHelper.get_cube( self._p, -1.5, 0, 0.05) self._p.changeDynamics(self.aggressive_cube.bodies[0], -1, mass=self.cube_masses[self.reset_count]) self.reset_count += 1
def robot_specific_reset(self, bullet_client): WalkerBase.robot_specific_reset(self, bullet_client) for n in ["foot_joint", "foot_left_joint"]: self.jdict[n].power_coef = 30.0 self.frame = 0 if self.aggressive_cube: self._p.resetBasePositionAndOrientation( self.aggressive_cube.bodies[0], [-1.5, 0, 0.05], [0, 0, 0, 1]) else: self.aggressive_cube = ObjectHelper.get_cube( self._p, -1.5, 0, 0.05)
def robot_specific_reset(self, bullet_client): WalkerBase.robot_specific_reset(self, bullet_client) self.jdict["bthigh"].power_coef = 120.0 self.jdict["bshin"].power_coef = 90.0 self.jdict["bfoot"].power_coef = 60.0 self.jdict["fthigh"].power_coef = 140.0 self.jdict["fshin"].power_coef = 60.0 self.jdict["ffoot"].power_coef = 30.0 self.frame = 0 if self.aggressive_cube: self._p.resetBasePositionAndOrientation( self.aggressive_cube.bodies[0], [-1.5, 0, 0.05], [0, 0, 0, 1]) else: self.aggressive_cube = ObjectHelper.get_cube( self._p, -1.5, 0, 0.05)
def robot_specific_reset(self, bullet_client): WalkerBase.robot_specific_reset(self, bullet_client) self.frame = 0 if self.aggressive_cube: self._p.resetBasePositionAndOrientation( self.aggressive_cube.bodies[0], [-1.5, 0, 0.05], [0, 0, 0, 1]) self._p.changeDynamics(self.aggressive_cube.bodies[0], -1, mass=self.cube_masses[self.reset_count]) else: self.aggressive_cube = ObjectHelper.get_cube( self._p, -1.5, 0, 0.05) self._p.changeDynamics(self.aggressive_cube.bodies[0], -1, mass=self.cube_masses[self.reset_count]) self.reset_count += 1
def robot_specific_reset(self, bullet_client): WalkerBase.robot_specific_reset(self, bullet_client) for n in ["foot_joint", "foot_left_joint"]: self.jdict[n].power_coef = 30.0
def robot_specific_reset(self, bullet_client): WalkerBase.robot_specific_reset(self, bullet_client) self.set_initial_orientation(yaw_center=0, yaw_random_spread=np.pi) self.head = self.parts["head"]