本文整理汇总了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)
示例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)
示例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
示例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
示例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)