当前位置: 首页>>代码示例>>Python>>正文


Python pybullet.ER_BULLET_HARDWARE_OPENGL属性代码示例

本文整理汇总了Python中pybullet.ER_BULLET_HARDWARE_OPENGL属性的典型用法代码示例。如果您正苦于以下问题:Python pybullet.ER_BULLET_HARDWARE_OPENGL属性的具体用法?Python pybullet.ER_BULLET_HARDWARE_OPENGL怎么用?Python pybullet.ER_BULLET_HARDWARE_OPENGL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在pybullet的用法示例。


在下文中一共展示了pybullet.ER_BULLET_HARDWARE_OPENGL属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _render

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import ER_BULLET_HARDWARE_OPENGL [as 别名]
def _render(self, mode="rgb_array", close=False):
    if mode != "rgb_array":
      return np.array([])
    base_pos = self.minitaur.GetBasePosition()
    view_matrix = self._pybullet_client.computeViewMatrixFromYawPitchRoll(
        cameraTargetPosition=base_pos,
        distance=self._cam_dist,
        yaw=self._cam_yaw,
        pitch=self._cam_pitch,
        roll=0,
        upAxisIndex=2)
    proj_matrix = self._pybullet_client.computeProjectionMatrixFOV(
        fov=60, aspect=float(RENDER_WIDTH)/RENDER_HEIGHT,
        nearVal=0.1, farVal=100.0)
    (_, _, px, _, _) = self._pybullet_client.getCameraImage(
        width=RENDER_WIDTH, height=RENDER_HEIGHT, viewMatrix=view_matrix,
        projectionMatrix=proj_matrix, renderer=pybullet.ER_BULLET_HARDWARE_OPENGL)
    rgb_array = np.array(px)
    rgb_array = rgb_array[:, :, :3]
    return rgb_array 
开发者ID:utra-robosoccer,项目名称:soccer-matlab,代码行数:22,代码来源:minitaur_gym_env.py

示例2: _render

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import ER_BULLET_HARDWARE_OPENGL [as 别名]
def _render(self, mode='human', close=False):
    if mode != "rgb_array":
      return np.array([])
    base_pos,orn = self._p.getBasePositionAndOrientation(self._racecar.racecarUniqueId)
    view_matrix = self._p.computeViewMatrixFromYawPitchRoll(
        cameraTargetPosition=base_pos,
        distance=self._cam_dist,
        yaw=self._cam_yaw,
        pitch=self._cam_pitch,
        roll=0,
        upAxisIndex=2)
    proj_matrix = self._p.computeProjectionMatrixFOV(
        fov=60, aspect=float(RENDER_WIDTH)/RENDER_HEIGHT,
        nearVal=0.1, farVal=100.0)
    (_, _, px, _, _) = self._p.getCameraImage(
        width=RENDER_WIDTH, height=RENDER_HEIGHT, viewMatrix=view_matrix,
        projectionMatrix=proj_matrix, renderer=pybullet.ER_BULLET_HARDWARE_OPENGL)
    rgb_array = np.array(px)
    rgb_array = rgb_array[:, :, :3]
    return rgb_array 
开发者ID:utra-robosoccer,项目名称:soccer-matlab,代码行数:22,代码来源:racecarGymEnv.py

示例3: render

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import ER_BULLET_HARDWARE_OPENGL [as 别名]
def render(self):
        if np.all(self._rendered_pos == self.camera_pos) and np.all(self._rendered_rot == self.camera_rot):
            return self._rendered

        target = self.camera_pos + np.dot(self.camera_rot, [0, 0, 1.0, 1.0])[0:3]
        up = np.dot(self.camera_rot, [0, -1.0, 0, 1.0])[0:3]
        vm = pb.computeViewMatrix(self.camera_pos, target, up)

        i_arr = pb.getCameraImage(self.im_width, self.im_height, vm, self.pm,
                                  shadow=0,
                                  renderer=pb.ER_TINY_RENDERER)
                                  # renderer=pb.ER_BULLET_HARDWARE_OPENGL)

        # Record the position of the camera, and don't re-render if it hasn't moved.
        self._rendered = i_arr
        self._rendered_pos = self.camera_pos.copy()
        self._rendered_rot = self.camera_rot.copy()

        return i_arr 
开发者ID:dougsm,项目名称:mvp_grasp,代码行数:21,代码来源:renderer.py

示例4: _render

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import ER_BULLET_HARDWARE_OPENGL [as 别名]
def _render(self, mode, close):
        base_pos=[0,0,0]
        if (hasattr(self,'robot')):
            if (hasattr(self.robot,'body_xyz')):
                base_pos = self.robot.body_xyz
        
        view_matrix = p.computeViewMatrixFromYawPitchRoll(
            cameraTargetPosition=base_pos,
            distance=self._cam_dist,
            yaw=self._cam_yaw,
            pitch=self._cam_pitch,
            roll=0,
            upAxisIndex=2)
        proj_matrix = p.computeProjectionMatrixFOV(
            fov=60, aspect=float(self._render_width)/self._render_height,
            nearVal=0.1, farVal=100.0)
        (_, _, px, _, _) = p.getCameraImage(
        width=self._render_width, height=self._render_height, viewMatrix=view_matrix,
            projectionMatrix=proj_matrix,
            renderer=p.ER_BULLET_HARDWARE_OPENGL
            )
        rgb_array = np.array(px).reshape((self._render_width, self._render_height, -1))
        if close: return None
        rgb_array = rgb_array[:, :, :3]
        return rgb_array 
开发者ID:gkahn13,项目名称:GtS,代码行数:27,代码来源:env_bases.py

示例5: render_map

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import ER_BULLET_HARDWARE_OPENGL [as 别名]
def render_map(self):
        base_pos=[0, 0, -3]
        if (hasattr(self,'robot')):
            if (hasattr(self.robot,'body_xyz')):
                base_pos[0] = self.robot.body_xyz[0]
                base_pos[1] = self.robot.body_xyz[1]
        
        view_matrix = p.computeViewMatrixFromYawPitchRoll(
            cameraTargetPosition=base_pos,
            distance=35,
            yaw=0,
            pitch=-89,
            roll=0,
            upAxisIndex=2)
        proj_matrix = p.computeProjectionMatrixFOV(
            fov=60, aspect=float(self._render_width)/self._render_height,
            nearVal=0.1, farVal=100.0)
        (_, _, px, _, _) = p.getCameraImage(
        width=self._render_width, height=self._render_height, viewMatrix=view_matrix,
            projectionMatrix=proj_matrix,
            renderer=p.ER_BULLET_HARDWARE_OPENGL
            )
        rgb_array = np.array(px).reshape((self._render_width, self._render_height, -1))
        rgb_array = rgb_array[:, :, :3]
        return rgb_array 
开发者ID:gkahn13,项目名称:GtS,代码行数:27,代码来源:env_bases.py

示例6: _render

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import ER_BULLET_HARDWARE_OPENGL [as 别名]
def _render(self, mode, close):
        base_pos=[0,0,0]
        if (hasattr(self,'robot')):
            if (hasattr(self.robot,'body_xyz')):
                base_pos = self.robot.body_xyz
        
        view_matrix = p.computeViewMatrixFromYawPitchRoll(
            cameraTargetPosition=base_pos,
            distance=self._cam_dist,
            yaw=self._cam_yaw,
            pitch=self._cam_pitch,
            roll=0,
            upAxisIndex=2)
        proj_matrix = p.computeProjectionMatrixFOV(
            fov=60, aspect=float(self._render_width)/self._render_height,
            nearVal=0.1, farVal=100.0)
        (_, _, px, _, _) = p.getCameraImage(
        width=self._render_width, height=self._render_height, viewMatrix=view_matrix,
            projectionMatrix=proj_matrix,
            renderer=p.ER_BULLET_HARDWARE_OPENGL
            )
        rgb_array = np.array(px)
        if close: return None
        rgb_array = rgb_array[:, :, :3]
        return rgb_array 
开发者ID:alexsax,项目名称:midlevel-reps,代码行数:27,代码来源:env_bases.py

示例7: render_map

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import ER_BULLET_HARDWARE_OPENGL [as 别名]
def render_map(self):
        base_pos=[0, 0, -3]
        if (hasattr(self,'robot')):
            if (hasattr(self.robot,'body_xyz')):
                base_pos[0] = self.robot.body_xyz[0]
                base_pos[1] = self.robot.body_xyz[1]
        
        view_matrix = p.computeViewMatrixFromYawPitchRoll(
            cameraTargetPosition=base_pos,
            distance=35,
            yaw=0,
            pitch=-89,
            roll=0,
            upAxisIndex=2)
        proj_matrix = p.computeProjectionMatrixFOV(
            fov=60, aspect=float(self._render_width)/self._render_height,
            nearVal=0.1, farVal=100.0)
        (_, _, px, _, _) = p.getCameraImage(
        width=self._render_width, height=self._render_height, viewMatrix=view_matrix,
            projectionMatrix=proj_matrix,
            renderer=p.ER_BULLET_HARDWARE_OPENGL
            )
        rgb_array = np.array(px)
        rgb_array = rgb_array[:, :, :3]
        return rgb_array 
开发者ID:alexsax,项目名称:midlevel-reps,代码行数:27,代码来源:env_bases.py

示例8: _render

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import ER_BULLET_HARDWARE_OPENGL [as 别名]
def _render(self, mode, close=False):
		if (mode=="human"):
			self.isRender = True
		if mode != "rgb_array":
			return np.array([])

		base_pos=[0,0,0]
		if (hasattr(self,'robot')):
			if (hasattr(self.robot,'body_xyz')):
				base_pos = self.robot.body_xyz

		view_matrix = self._p.computeViewMatrixFromYawPitchRoll(
			cameraTargetPosition=base_pos,
			distance=self._cam_dist,
			yaw=self._cam_yaw,
			pitch=self._cam_pitch,
			roll=0,
			upAxisIndex=2)
		proj_matrix = self._p.computeProjectionMatrixFOV(
			fov=60, aspect=float(self._render_width)/self._render_height,
			nearVal=0.1, farVal=100.0)
		(_, _, px, _, _) = self._p.getCameraImage(
		width=self._render_width, height=self._render_height, viewMatrix=view_matrix,
			projectionMatrix=proj_matrix,
			renderer=pybullet.ER_BULLET_HARDWARE_OPENGL
			)
		rgb_array = np.array(px)
		rgb_array = rgb_array[:, :, :3]
		return rgb_array 
开发者ID:utra-robosoccer,项目名称:soccer-matlab,代码行数:31,代码来源:env_bases.py

示例9: render

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import ER_BULLET_HARDWARE_OPENGL [as 别名]
def render(self, bullet_client=None):

        if bullet_client is None:
            bullet_client = self._p

        view_matrix = bullet_client.computeViewMatrixFromYawPitchRoll(
                cameraTargetPosition=self.pos,
                distance=self.dist,
                yaw=self.yaw,
                pitch=self.pitch,
                roll=self.roll,
                upAxisIndex=2)

        proj_matrix = bullet_client.computeProjectionMatrixFOV(
                fov=self.fov,
                aspect=float(self.render_width)/self.render_height,
                nearVal=0.1, farVal=100.0)

        (_, _, px, _, _) = bullet_client.getCameraImage(
                width=self.render_width, height=self.render_height,
                viewMatrix=view_matrix,
                projectionMatrix=proj_matrix,
                renderer=pybullet.ER_BULLET_HARDWARE_OPENGL
                )

        rgb_array = np.array(px).reshape(self.render_height,
                                         self.render_width, 4)
        rgb_array = rgb_array[:, :, :3]

        return rgb_array 
开发者ID:AIcrowd,项目名称:real_robots,代码行数:32,代码来源:env.py

示例10: renderTarget

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import ER_BULLET_HARDWARE_OPENGL [as 别名]
def renderTarget(self, targetPosition, bullet_client=None):

        if bullet_client is None:
            bullet_client = self._p

        self.targetPosition = targetPosition

        view_matrix = bullet_client.computeViewMatrix(
                cameraEyePosition=self.eyePosition,
                cameraTargetPosition=self.targetPosition,
                cameraUpVector=self.upVector)

        proj_matrix = bullet_client.computeProjectionMatrixFOV(
                fov=self.fov,
                aspect=float(self.render_width)/self.render_height,
                nearVal=0.1, farVal=100.0)

        (_, _, px, _, _) = bullet_client.getCameraImage(
                width=self.render_width, height=self.render_height,
                viewMatrix=view_matrix,
                projectionMatrix=proj_matrix,
                renderer=pybullet.ER_BULLET_HARDWARE_OPENGL
                )

        rgb_array = np.array(px).reshape(self.render_height,
                                         self.render_width, 4)
        rgb_array = rgb_array[:, :, :3]

        return rgb_array 
开发者ID:AIcrowd,项目名称:real_robots,代码行数:31,代码来源:env.py

示例11: renderPitchRoll

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import ER_BULLET_HARDWARE_OPENGL [as 别名]
def renderPitchRoll(self, distance, roll, pitch, yaw, bullet_client=None):

        if bullet_client is None:
            bullet_client = self._p

        # self.targetPosition = targetPosition

        view_matrix = bullet_client.computeViewMatrixFromYawPitchRoll(
                cameraTargetPosition=self.pos,
                distance=distance,
                yaw=yaw,
                pitch=pitch,
                roll=roll,
                upAxisIndex=2)

        proj_matrix = bullet_client.computeProjectionMatrixFOV(
                fov=self.fov,
                aspect=float(self.render_width)/self.render_height,
                nearVal=0.1, farVal=100.0)

        (_, _, px, _, _) = bullet_client.getCameraImage(
                width=self.render_width, height=self.render_height,
                viewMatrix=view_matrix,
                projectionMatrix=proj_matrix,
                renderer=pybullet.ER_BULLET_HARDWARE_OPENGL
                )

        rgb_array = np.array(px).reshape(self.render_height,
                                         self.render_width, 4)
        rgb_array = rgb_array[:, :, :3]

        return rgb_array 
开发者ID:AIcrowd,项目名称:real_robots,代码行数:34,代码来源:env.py

示例12: render

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import ER_BULLET_HARDWARE_OPENGL [as 别名]
def render(self, bullet_client = None):
        
        if bullet_client is None:
            bullet_client = self._p

        view_matrix = bullet_client.computeViewMatrixFromYawPitchRoll(
                cameraTargetPosition = self.pos,
                distance=self.dist,
                yaw=self.yaw,
                pitch=self.pitch,
                roll=self.roll,
                upAxisIndex=2)

        proj_matrix = bullet_client.computeProjectionMatrixFOV(
                fov=self.fov, aspect=float(self.render_width)/self.render_height,
                nearVal=0.1, farVal=100.0)

        (_, _, px, _, _) = bullet_client.getCameraImage(
                width=self.render_width, height=self.render_height,
                viewMatrix=view_matrix,
                projectionMatrix=proj_matrix,
                renderer=pybullet.ER_BULLET_HARDWARE_OPENGL
                )

        rgb_array = np.array(px).reshape(self.render_height, self.render_width, 4)
        rgb_array = rgb_array[:, :, :3]

        return rgb_array 
开发者ID:GOAL-Robots,项目名称:REALCompetitionStartingKit,代码行数:30,代码来源:realcomp_env.py

示例13: renderTarget

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import ER_BULLET_HARDWARE_OPENGL [as 别名]
def renderTarget(self, targetPosition, bullet_client = None):
        
        if bullet_client is None:
            bullet_client = self._p

        self.targetPosition = targetPosition

        view_matrix = bullet_client.computeViewMatrix(
                cameraEyePosition = self.eyePosition,
                cameraTargetPosition = self.targetPosition,
                cameraUpVector=self.upVector)

        proj_matrix = bullet_client.computeProjectionMatrixFOV(
                fov=self.fov, aspect=float(self.render_width)/self.render_height,
                nearVal=0.1, farVal=100.0)

        (_, _, px, _, _) = bullet_client.getCameraImage(
                width=self.render_width, height=self.render_height,
                viewMatrix=view_matrix,
                projectionMatrix=proj_matrix,
                renderer=pybullet.ER_BULLET_HARDWARE_OPENGL
                )

        rgb_array = np.array(px).reshape(self.render_height, self.render_width, 4)
        rgb_array = rgb_array[:, :, :3]

        return rgb_array 
开发者ID:GOAL-Robots,项目名称:REALCompetitionStartingKit,代码行数:29,代码来源:realcomp_env.py

示例14: renderPitchRoll

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import ER_BULLET_HARDWARE_OPENGL [as 别名]
def renderPitchRoll(self, distance, roll, pitch, yaw, bullet_client = None):
        
        if bullet_client is None:
            bullet_client = self._p

        self.targetPosition = targetPosition

        view_matrix = bullet_client.computeViewMatrixFromYawPitchRoll(
                cameraTargetPosition = self.pos,
                distance=distance,
                yaw=yaw,
                pitch=pitch,
                roll=roll,
                upAxisIndex=2)

        proj_matrix = bullet_client.computeProjectionMatrixFOV(
                fov=self.fov, aspect=float(self.render_width)/self.render_height,
                nearVal=0.1, farVal=100.0)

        (_, _, px, _, _) = bullet_client.getCameraImage(
                width=self.render_width, height=self.render_height,
                viewMatrix=view_matrix,
                projectionMatrix=proj_matrix,
                renderer=pybullet.ER_BULLET_HARDWARE_OPENGL
                )

        rgb_array = np.array(px).reshape(self.render_height, self.render_width, 4)
        rgb_array = rgb_array[:, :, :3]

        return rgb_array 
开发者ID:GOAL-Robots,项目名称:REALCompetitionStartingKit,代码行数:32,代码来源:realcomp_env.py

示例15: record_video_frame

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import ER_BULLET_HARDWARE_OPENGL [as 别名]
def record_video_frame(self):
        if self.record_video and self.gui:
            frame = np.reshape(p.getCameraImage(width=self.width, height=self.height, renderer=p.ER_BULLET_HARDWARE_OPENGL, physicsClientId=self.id)[2], (self.height, self.width, 4))[:, :, :3]
            # frame = cv2.cvtColor(frame, cv2.COLOR_RGB2BGR)
            # self.video_writer.write(frame) 
开发者ID:Healthcare-Robotics,项目名称:assistive-gym,代码行数:7,代码来源:env.py


注:本文中的pybullet.ER_BULLET_HARDWARE_OPENGL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。