Пример #1
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)
Пример #2
0
    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
Пример #3
0
    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)
Пример #4
0
    def robot_specific_reset(self, bullet_client):
        HumanoidFlagrun.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)
        self.on_ground_frame_counter = 0
        self.crawl_start_potential = None
        self.crawl_ignored_potential = 0.0
        self.initial_z = 0.8
Пример #5
0
    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)
Пример #6
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])
         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