當前位置: 首頁>>代碼示例>>Python>>正文


Python pybullet.setAdditionalSearchPath方法代碼示例

本文整理匯總了Python中pybullet.setAdditionalSearchPath方法的典型用法代碼示例。如果您正苦於以下問題:Python pybullet.setAdditionalSearchPath方法的具體用法?Python pybullet.setAdditionalSearchPath怎麽用?Python pybullet.setAdditionalSearchPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pybullet的用法示例。


在下文中一共展示了pybullet.setAdditionalSearchPath方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import pybullet [as 別名]
# 或者: from pybullet import setAdditionalSearchPath [as 別名]
def __init__(self, render=False):
        self._observation = []
        self.action_space = spaces.Discrete(9)
        self.observation_space = spaces.Box(np.array([-math.pi, -math.pi, -5]), 
                                            np.array([math.pi, math.pi, 5])) # pitch, gyro, com.sp.

        if (render):
            self.physicsClient = p.connect(p.GUI)
        else:
            self.physicsClient = p.connect(p.DIRECT)  # non-graphical version

        p.setAdditionalSearchPath(pybullet_data.getDataPath())  # used by loadURDF

        self._seed()
        
        # paramId = p.addUserDebugParameter("My Param", 0, 100, 50) 
開發者ID:yconst,項目名稱:balance-bot,代碼行數:18,代碼來源:balancebot_env.py

示例2: test

# 需要導入模塊: import pybullet [as 別名]
# 或者: from pybullet import setAdditionalSearchPath [as 別名]
def test(args):	
	p.connect(p.GUI)
	p.setAdditionalSearchPath(pybullet_data.getDataPath())
	fileName = os.path.join("mjcf", args.mjcf)
	print("fileName")
	print(fileName)
	p.loadMJCF(fileName)
	while (1):
		p.stepSimulation()
		p.getCameraImage(320,240)
		time.sleep(0.01) 
開發者ID:utra-robosoccer,項目名稱:soccer-matlab,代碼行數:13,代碼來源:testMJCF.py

示例3: __init__

# 需要導入模塊: import pybullet [as 別名]
# 或者: from pybullet import setAdditionalSearchPath [as 別名]
def __init__(self, im_width, im_height, fov, near_plane, far_plane, DEBUG=False):
        self.im_width = im_width
        self.im_height = im_height
        self.fov = fov
        self.near_plane = near_plane
        self.far_plane = far_plane
        aspect = self.im_width/self.im_height
        self.pm = pb.computeProjectionMatrixFOV(fov, aspect, near_plane, far_plane)
        self.camera_pos = np.array([0, 0, 0.5])
        self.camera_rot = self._rotation_matrix([0, np.pi, 0])

        self.objects = []

        if DEBUG:
            self.cid = pb.connect(pb.GUI)
        else:
            self.cid = pb.connect(pb.DIRECT)

        pb.setAdditionalSearchPath(pybullet_data.getDataPath())

        pb.setGravity(0, 0, -10)
        self.draw_camera_pos()

        self._rendered = None
        self._rendered_pos = None
        self._rendered_rot = None 
開發者ID:dougsm,項目名稱:mvp_grasp,代碼行數:28,代碼來源:renderer.py

示例4: main

# 需要導入模塊: import pybullet [as 別名]
# 或者: from pybullet import setAdditionalSearchPath [as 別名]
def main():
    simulation_manager = SimulationManager()
    client = simulation_manager.launchSimulation(gui=True)
    pepper = simulation_manager.spawnPepper(client, spawn_ground_plane=True)

    pybullet.setAdditionalSearchPath(pybullet_data.getDataPath())

    pybullet.loadURDF(
        "duck_vhacd.urdf",
        basePosition=[1, -1, 0.5],
        globalScaling=10.0,
        physicsClientId=client)

    pepper.showLaser(True)
    pepper.subscribeLaser()
    pepper.goToPosture("Stand", 0.6)

    while True:
        laser_list = pepper.getRightLaserValue()
        laser_list.extend(pepper.getFrontLaserValue())
        laser_list.extend(pepper.getLeftLaserValue())

        if all(laser == 5.6 for laser in laser_list):
            print("Nothing detected")
        else:
            print("Detected")
            pass 
開發者ID:softbankrobotics-research,項目名稱:qibullet,代碼行數:29,代碼來源:pepper_lasers.py

示例5: _spawnGroundPlane

# 需要導入模塊: import pybullet [as 別名]
# 或者: from pybullet import setAdditionalSearchPath [as 別名]
def _spawnGroundPlane(self, physics_client):
        """
        INTERNAL METHOD, Loads a ground plane

        Parameters:
            physics_client - The id of the simulated instance in which the
            ground plane is supposed to be spawned
        """
        pybullet.setAdditionalSearchPath(pybullet_data.getDataPath())
        pybullet.loadMJCF(
            "mjcf/ground_plane.xml",
            physicsClientId=physics_client) 
開發者ID:softbankrobotics-research,項目名稱:qibullet,代碼行數:14,代碼來源:simulation_manager.py


注:本文中的pybullet.setAdditionalSearchPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。