Ejemplo n.º 1
0
    def __init__(self, config, is_discrete=False, mode="RGBD", gpu_count=0):
        self.config = self.parse_config(config)
        self.gui = self.config["mode"] == "gui"
        self.model_id = self.config["model_id"]
        self.timestep = self.config["speed"]["timestep"]
        self.frame_skip = self.config["speed"]["frameskip"]
        self.resolution = self.config["resolution"]
        self.tracking_camera = tracking_camera
        target_orn, target_pos = self.config["target_orn"], self.config[
            "target_pos"]
        initial_orn, initial_pos = self.config["initial_orn"], self.config[
            "initial_pos"]
        self.total_reward = 0
        self.total_frame = 0
        self.flag_timeout = 1

        CameraRobotEnv.__init__(self,
                                config,
                                gpu_count,
                                scene_type="stadium",
                                use_filler=False)
        self.robot_introduce(
            Ant(initial_pos, initial_orn, is_discrete=is_discrete, env=self))
        self.scene_introduce()

        if self.gui:
            self.visualid = p.createVisualShape(
                p.GEOM_MESH,
                fileName=os.path.join(pybullet_data.getDataPath(), 'cube.obj'),
                meshScale=[0.5, 0.5, 0.5],
                rgbaColor=[1, 0, 0, 0.7])
        self.lastid = None

        assert (self.config["envname"] == self.__class__.__name__
                or self.config["envname"] == "TestEnv")
Ejemplo n.º 2
0
    def __init__(self, config, gpu_count=0):
        self.config = self.parse_config(config)
        assert (self.config["envname"] == self.__class__.__name__
                or self.config["envname"] == "TestEnv")

        CameraRobotEnv.__init__(self,
                                self.config,
                                gpu_count,
                                scene_type="building",
                                tracking_camera=tracking_camera)

        self.robot_introduce(Ant(self.config, env=self))
        self.scene_introduce()
        self.gui = self.config["mode"] == "gui"
        self.total_reward = 0
        self.total_frame = 0

        self.flag_timeout = 1
        self.visualid = -1
        self.lastid = None

        if self.gui:
            self.visualid = p.createVisualShape(
                p.GEOM_MESH,
                fileName=os.path.join(pybullet_data.getDataPath(), 'cube.obj'),
                meshScale=[0.2, 0.2, 0.2],
                rgbaColor=[1, 0, 0, 0.7])
        self.colisionid = p.createCollisionShape(
            p.GEOM_MESH,
            fileName=os.path.join(pybullet_data.getDataPath(), 'cube.obj'),
            meshScale=[0.2, 0.5, 0.2])
        assert (self.config["envname"] == self.__class__.__name__
                or self.config["envname"] == "TestEnv")
Ejemplo n.º 3
0
    def __init__(self, config, is_discrete=False, gpu_count=0):

        self.config = self.parse_config(config)
        self.gui = self.config["mode"] == "gui"

        self.model_id = self.config["model_id"]
        self.timestep = self.config["speed"]["timestep"]
        self.frame_skip = self.config["speed"]["frameskip"]
        self.resolution = self.config["resolution"]
        self.tracking_camera = tracking_camera
        target_orn, target_pos = self.config["target_orn"], self.config[
            "target_pos"]
        initial_orn, initial_pos = self.config["initial_orn"], self.config[
            "initial_pos"]
        self.total_reward = 0
        self.total_frame = 0

        CameraRobotEnv.__init__(self,
                                config,
                                gpu_count,
                                scene_type="building",
                                use_filler=self.config["use_filler"])

        self.robot_introduce(
            Ant(initial_pos,
                initial_orn,
                is_discrete=is_discrete,
                target_pos=target_pos,
                resolution=self.resolution,
                env=self))
        self.scene_introduce()
        assert (self.config["envname"] == self.__class__.__name__
                or self.config["envname"] == "TestEnv")
Ejemplo n.º 4
0
    def __init__(self, config, gpu_count=0):

        self.config = self.parse_config(config)
        assert(self.config["envname"] == self.__class__.__name__ or self.config["envname"] == "TestEnv")

        CameraRobotEnv.__init__(self, self.config, gpu_count, 
                                scene_type="building",
                                tracking_camera=tracking_camera)

        self.robot_introduce(Ant(self.config, env=self))
        self.scene_introduce()
        self.gui = self.config["mode"] == "gui"
        self.total_reward = 0
        self.total_frame = 0