예제 #1
0
 def __init__(self, robot, render=False):
     # print("WalkerBase::__init__ start")
     self.camera_x = 0
     self.walk_target_x = 1e3  # kilometer away
     self.walk_target_y = 0
     self.stateId = -1
     MJCFBaseBulletEnv.__init__(self, robot, render)
예제 #2
0
    def __init__(self, render=False):

        self.robot = Kuka()
        MJCFBaseBulletEnv.__init__(self, self.robot, render)

        self._cam_dist = 1.2
        self._cam_yaw = 90  #30
        self._cam_roll = 0
        self._cam_pitch = -70  #-30

        if config.wtcheat:
            self._render_width = 1
            self._render_height = 1
        else:
            self._render_width = 320
            self._render_height = 240

        self._cam_pos = [0, 0, 0.3]  #[0, 0, 0.4]
        self.setCamera()
        self.eyes = {}

        self.reward_func = DefaultRewardFunc

        self.robot.used_objects = ["table", "tomato", "mustard", "orange"]
        self.set_eye("eye")

        self.goal = Goal(retina=self.observation_space.spaces[
            self.robot.ObsSpaces.GOAL].sample() * 0)
        self.goals = None
        self.goal_idx = -1
예제 #3
0
 def __init__(self, robot, render=False, max_num_steps=1000):
     # print("WalkerBase::__init__ start")
     self.max_num_steps = max_num_steps
     self._step_counter = 0
     self.camera_x = 0
     self.walk_target_x = 1e3  # kilometer away
     self.walk_target_y = 0
     self.stateId = -1
     MJCFBaseBulletEnv.__init__(self, robot, render)
예제 #4
0
    def __init__(self, robot, render=False):
        # print("WalkerBase::__init__ start")
        MJCFBaseBulletEnv.__init__(self, robot, render)

        self.camera_x = 0
        self.walk_target_x = 1e3  # kilometer away
        self.walk_target_y = 0
        self.stateId = -1
        self._projectM = None
        self._param_init_camera_width = 320
        self._param_init_camera_height = 200
        self._param_camera_distance = 2.0
예제 #5
0
    def __init__(self, render=False):

        self.robot = Hand()
        MJCFBaseBulletEnv.__init__(self, self.robot, render)

        self._cam_dist = 1.2
        self._cam_yaw = 30
        self._cam_roll = 0
        self._cam_pitch = -30
        self._render_width = 320
        self._render_height = 240
        self._cam_pos = [0, 0, .4]
        self.setCamera()
        self.eyes = {}

        self.reward_func = DefaultRewardFunc

        self.robot.used_objects = []
예제 #6
0
    def __init__(self, render=False):

        self.robot = Kuka()
        MJCFBaseBulletEnv.__init__(self, self.robot, render)
        
        self._cam_dist = 1.2
        self._cam_yaw = 30
        self._cam_roll = 0
        self._cam_pitch = -30
        self._render_width = 320
        self._render_height = 240
        self._cam_pos = [0,0,.4]
        self.setCamera()
        self.eyes = {}

        self.reward_func = DefaultRewardFunc
        
        self.robot.used_objects = ["table", "tomato", "mustard", "cube"]
        self.set_eye("eye")

        self.goal = Goal(retina=self.observation_space.spaces[
            self.robot.ObsSpaces.GOAL].sample()*0)
        
        # Set default goals dataset path
        # 
        # The goals dataset is basically a list of real_robots.envs.env.Goal
        # objects which are stored using : 
        # 
        # np.savez_compressed(
        #               "path.npy.npz",
        #                list_of_goals)
        #
        self.goals_dataset_path = os.path.join( 
                                    real_robots.getPackageDataPath(),
                                    "goals_dataset.npy.npz")
        self.goals = None
        self.goal_idx = -1
예제 #7
0
 def __init__(self):
     self.robot = InvertedPendulumModified()
     MJCFBaseBulletEnv.__init__(self, self.robot)
     self.stateId = -1
예제 #8
0
 def __init__(self, render=False):
     self.robot = FixedReacher()
     MJCFBaseBulletEnv.__init__(self, self.robot, render)
예제 #9
0
 def __init__(self):
     self.robot = PendulumSwingup()
     MJCFBaseBulletEnv.__init__(self, self.robot)
     self.stateId = -1
예제 #10
0
    def __init__(self, render=False, objects=3, action_type='joints',
                 additional_obs=True):

        self.robot = Kuka(additional_obs, objects)
        MJCFBaseBulletEnv.__init__(self, self.robot, render)

        self.joints_space = self.robot.action_space

        self.cartesian_space = spaces.Box(
                           low=np.array([-0.25, -0.5, 0.40, -1, -1, -1, -1]),
                           high=np.array([0.25, 0.5, 0.60,  1,  1,  1,  1]),
                           dtype=float)

        self.macro_space = spaces.Box(
                                  low=np.array([[-0.25, -0.5], [-0.25, -0.5]]),
                                  high=np.array([[0.05, 0.5], [0.05, 0.5]]),
                                  dtype=float)

        self.gripper_space = spaces.Box(low=0,
                                        high=np.pi/2, shape=(2,), dtype=float)

        if action_type == 'joints':
            self.action_space = spaces.Dict({
                                "joint_command": self.joints_space,
                                "render": spaces.MultiBinary(1)})
            self.step = self.step_joints

        elif action_type == 'cartesian':
            self.action_space = spaces.Dict({
                                "cartesian_command": self.cartesian_space,
                                "gripper_command": self.gripper_space,
                                "render": spaces.MultiBinary(1)})
            self.step = self.step_cartesian
            self.requested_coords = None
            self.requested_orient = None
            self.last_ik = None

        elif action_type == 'macro_action':
            self.action_space = spaces.Dict({
                                "macro_action": self.macro_space,
                                "render": spaces.MultiBinary(1)})
            self.step = self.step_macro
            self.requested_action = None
        else:
            raise ValueError("action_type must be one 'joints', 'cartesian' "
                             "or 'macro_action'")

        self._cam_dist = 1.2
        self._cam_yaw = 30
        self._cam_roll = 0
        self._cam_pitch = -30
        self._render_width = 320
        self._render_height = 240
        self._cam_pos = [0, 0, .4]
        self.setCamera()
        self.eyes = {}

        self.reward_func = DefaultRewardFunc

        self.set_eye("eye")

        self.goal = Goal(retina=self.observation_space.spaces[
                                self.robot.ObsSpaces.GOAL].sample()*0)

        # Set default goals dataset path
        #
        # The goals dataset is basically a list of real_robots.envs.env.Goal
        # objects which are stored using :
        #
        # np.savez_compressed(
        #               "path.npy.npz",
        #                list_of_goals)
        #
        self.goals_dataset_path = os.path.join(
                                    real_robots.getPackageDataPath(),
                                    "goals_dataset.npy.npz")
        self.goals = None
        self.goal_idx = -1
        self.no_retina = self.observation_space.spaces[
                         self.robot.ObsSpaces.RETINA].sample()*0
        self.no_depth = self.observation_space.spaces[
                         self.robot.ObsSpaces.DEPTH].sample()*0

        if additional_obs:
            self.get_observation = self.get_observation_extended
            self.no_mask = self.observation_space.spaces[
                                self.robot.ObsSpaces.MASK].sample()*0
예제 #11
0
	def __init__(self):
		self.robot = BeakerBot()
		MJCFBaseBulletEnv.__init__(self, self.robot)
		self.stateId=-1