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


Python World.buildLineSegmentTestWorld方法代码示例

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


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

示例1: onRandomObstaclesButton

# 需要导入模块: from world import World [as 别名]
# 或者: from world.World import buildLineSegmentTestWorld [as 别名]
 def onRandomObstaclesButton(self):
     print "random obstacles button pressed"
     self.setInitialStateAtZero()
     self.world = World.buildLineSegmentTestWorld(percentObsDensity=8.0,
                                         circleRadius=self.options['World']['circleRadius'],
                                         nonRandom=False,
                                         scale=self.options['World']['scale'],
                                         randomSeed=self.options['World']['randomSeed'],
                                         obstaclesInnerFraction=self.options['World']['obstaclesInnerFraction'])
     
     self.locator = World.buildCellLocator(self.world.visObj.polyData)
开发者ID:peteflorence,项目名称:DirectSim,代码行数:13,代码来源:CarSimulator.py

示例2: initialize

# 需要导入模块: from world import World [as 别名]
# 或者: from world.World import buildLineSegmentTestWorld [as 别名]
    def initialize(self):

        self.dt = self.options["dt"]
        self.controllerTypeOrder = ["default"]

        self.setDefaultOptions()

        self.Sensor = SensorObj(
            rayLength=self.options["Sensor"]["rayLength"], numRays=self.options["Sensor"]["numRays"]
        )

        self.SensorApproximator = SensorApproximatorObj(
            numRays=self.options["Sensor"]["numRays"], circleRadius=self.options["World"]["circleRadius"]
        )

        self.Controller = ControllerObj(self.Sensor, self.SensorApproximator)

        self.Car = CarPlant(controller=self.Controller, velocity=self.options["Car"]["velocity"])

        self.Controller.initializeVelocity(self.Car.v)

        self.ActionSet = ActionSetObj()

        # create the things needed for simulation
        om.removeFromObjectModel(om.findObjectByName("world"))
        self.world = World.buildLineSegmentTestWorld(
            percentObsDensity=self.options["World"]["percentObsDensity"],
            circleRadius=self.options["World"]["circleRadius"],
            nonRandom=self.options["World"]["nonRandomWorld"],
            scale=self.options["World"]["scale"],
            randomSeed=self.options["World"]["randomSeed"],
            obstaclesInnerFraction=self.options["World"]["obstaclesInnerFraction"],
        )

        om.removeFromObjectModel(om.findObjectByName("robot"))
        self.robot, self.frame = World.buildRobot()

        self.frame = self.robot.getChildFrame()
        self.frame.setProperty("Scale", 3)
        # self.frame.setProperty('Visible', False)
        # self.frame.setProperty('Edit', True)
        self.frame.widget.HandleRotationEnabledOff()
        rep = self.frame.widget.GetRepresentation()
        rep.SetTranslateAxisEnabled(2, False)
        rep.SetRotateAxisEnabled(0, False)
        rep.SetRotateAxisEnabled(1, False)

        self.defaultControllerTime = self.options["runTime"]["defaultControllerTime"]

        self.Car.setFrame(self.frame)
        print "Finished initialization"
开发者ID:peteflorence,项目名称:DirectSim,代码行数:53,代码来源:CarSimulator.py


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