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


Python pybullet.removeBody方法代码示例

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


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

示例1: _flag_reposition

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import removeBody [as 别名]
def _flag_reposition(self):
        self.walk_target_x = self.np_random.uniform(low=-self.scene.stadium_halflen,
                                                    high=+self.scene.stadium_halflen)
        self.walk_target_y = self.np_random.uniform(low=-self.scene.stadium_halfwidth,
                                                    high=+self.scene.stadium_halfwidth)

        more_compact = 0.5  # set to 1.0 whole football field
        self.walk_target_x *= more_compact / self.robot.mjcf_scaling
        self.walk_target_y *= more_compact / self.robot.mjcf_scaling

        self.flag = None
        #self.flag = self.scene.cpp_world.debug_sphere(self.walk_target_x, self.walk_target_y, 0.2, 0.2, 0xFF8080)
        self.flag_timeout = 3000 / self.scene.frame_skip
        #print('targetxy', self.flagid, self.walk_target_x, self.walk_target_y, p.getBasePositionAndOrientation(self.flagid))
        #p.resetBasePositionAndOrientation(self.flagid, posObj = [self.walk_target_x, self.walk_target_y, 0.5], ornObj = [0,0,0,0])
        if self.gui:
            if self.lastid:
                p.removeBody(self.lastid)

            self.lastid = p.createMultiBody(baseVisualShapeIndex=self.visualid, baseCollisionShapeIndex=-1, basePosition=[self.walk_target_x, self.walk_target_y, 0.5])

        self.robot.walk_target_x = self.walk_target_x
        self.robot.walk_target_y = self.walk_target_y 
开发者ID:alexsax,项目名称:midlevel-reps,代码行数:25,代码来源:ant_env.py

示例2: setOrientation

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import removeBody [as 别名]
def setOrientation(self, orientation):
        p.removeBody(self.plane)
        self.__init__(self.path, self.position, orientation) 
开发者ID:utra-robosoccer,项目名称:soccer-matlab,代码行数:5,代码来源:environment.py

示例3: setPosition

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import removeBody [as 别名]
def setPosition(self, position):
        p.removeBody(self.plane)
        self.__init__(self.path, position, self.orientation) 
开发者ID:utra-robosoccer,项目名称:soccer-matlab,代码行数:5,代码来源:environment.py

示例4: remove_object

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import removeBody [as 别名]
def remove_object(self, o_id, update=True):
        pb.removeBody(o_id)
        if update:
            self.objects.remove(o_id) 
开发者ID:dougsm,项目名称:mvp_grasp,代码行数:6,代码来源:renderer.py

示例5: reset

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import removeBody [as 别名]
def reset(self):
        '''
        Basic reset needs to reconfigure the world state -- set things back to
        the way they should be.
        '''
        for obj in self.objs:
            pb.removeBody(obj)
        self._setup()
        self._setupRobot(self.robot.handle) 
开发者ID:jhu-lcsr,项目名称:costar_plan,代码行数:11,代码来源:default.py

示例6: _flag_reposition

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import removeBody [as 别名]
def _flag_reposition(self):
        # self.walk_target_x = self.np_random.uniform(low=-self.scene.stadium_halflen,
        #                                            high=+self.scene.stadium_halflen)
        # self.walk_target_y = self.np_random.uniform(low=-self.scene.stadium_halfwidth,
        #                                            high=+self.scene.stadium_halfwidth)
        force_x = self.np_random.uniform(-300, 300)
        force_y = self.np_random.uniform(-300, 300)

        more_compact = 0.5  # set to 1.0 whole football field
        # self.walk_target_x *= more_compact
        # self.walk_target_y *= more_compact

        startx, starty, _ = self.robot.body_xyz

        self.flag = None
        # self.flag = self.scene.cpp_world.debug_sphere(self.walk_target_x, self.walk_target_y, 0.2, 0.2, 0xFF8080)
        self.flag_timeout = 3000 / self.scene.frame_skip
        # print('targetxy', self.flagid, self.walk_target_x, self.walk_target_y, p.getBasePositionAndOrientation(self.flagid))
        # p.resetBasePositionAndOrientation(self.flagid, posObj = [self.walk_target_x, self.walk_target_y, 0.5], ornObj = [0,0,0,0])
        if self.lastid:
            p.removeBody(self.lastid)

        self.lastid = p.createMultiBody(baseMass=1, baseVisualShapeIndex=self.visualid,
                                        baseCollisionShapeIndex=self.colisionid, basePosition=[startx, starty, 0.5])
        p.applyExternalForce(self.lastid, -1, [force_x, force_y, 50], [0, 0, 0], p.LINK_FRAME)

        ball_xyz, _ = p.getBasePositionAndOrientation(self.lastid)

        self.robot.walk_target_x = ball_xyz[0]
        self.robot.walk_target_y = ball_xyz[1] 
开发者ID:alexsax,项目名称:midlevel-reps,代码行数:32,代码来源:humanoid_env.py

示例7: _flag_reposition

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import removeBody [as 别名]
def _flag_reposition(self):
        #self.walk_target_x = self.np_random.uniform(low=-self.scene.stadium_halflen,
        #                                            high=+self.scene.stadium_halflen)
        #self.walk_target_y = self.np_random.uniform(low=-self.scene.stadium_halfwidth,
        #                                            high=+self.scene.stadium_halfwidth)
        force_x = self.np_random.uniform(-300,300)
        force_y = self.np_random.uniform(-300, 300)

        more_compact = 0.5  # set to 1.0 whole football field
        #self.walk_target_x *= more_compact
        #self.walk_target_y *= more_compact

        startx, starty, _ = self.robot.get_position()


        self.flag = None
        #self.flag = self.scene.cpp_world.debug_sphere(self.walk_target_x, self.walk_target_y, 0.2, 0.2, 0xFF8080)
        self.flag_timeout = 3000 / self.scene.frame_skip
        #print('targetxy', self.flagid, self.walk_target_x, self.walk_target_y, p.getBasePositionAndOrientation(self.flagid))
        #p.resetBasePositionAndOrientation(self.flagid, posObj = [self.walk_target_x, self.walk_target_y, 0.5], ornObj = [0,0,0,0])
        if self.lastid:
            p.removeBody(self.lastid)

        self.lastid = p.createMultiBody(baseMass = 1, baseVisualShapeIndex=self.visualid, baseCollisionShapeIndex=self.colisionid, basePosition=[startx, starty, 0.5])
        p.applyExternalForce(self.lastid, -1, [force_x,force_y,50], [0,0,0], p.LINK_FRAME)

        ball_xyz, _ = p.getBasePositionAndOrientation(self.lastid)

        self.robot.walk_target_x = ball_xyz[0]
        self.robot.walk_target_y = ball_xyz[1] 
开发者ID:alexsax,项目名称:midlevel-reps,代码行数:32,代码来源:husky_env.py

示例8: _removeRobot

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import removeBody [as 别名]
def _removeRobot(self, robot_virtual):
        """
        Removes a Virtual robot (Robot inheriting from RobotVirtual) from a
        simulated instance

        Parameters:
            robot_virtual - The virtual robot to be removed
        """
        for camera in robot_virtual.camera_dict.values():
            if id(camera) in Camera._getCameraHandlesDict():
                camera.unsubscribe()

        pybullet.removeBody(robot_virtual.getRobotModel()) 
开发者ID:softbankrobotics-research,项目名称:qibullet,代码行数:15,代码来源:simulation_manager.py

示例9: delete_simulated_robot

# 需要导入模块: import pybullet [as 别名]
# 或者: from pybullet import removeBody [as 别名]
def delete_simulated_robot(self):
        # Remove the robot from the simulation
        p.removeBody(self.robot_id, physicsClientId=self._physics_client_id) 
开发者ID:robotology-playground,项目名称:pybullet-robot-envs,代码行数:5,代码来源:icub_env.py


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