• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python creator.SensorCreator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中morse.builder.creator.SensorCreator的典型用法代码示例。如果您正苦于以下问题:Python SensorCreator类的具体用法?Python SensorCreator怎么用?Python SensorCreator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: __init__

 def __init__(self, name=None):
     SensorCreator.__init__(self, name)
     self.camera = Camera("CameraRobot")
     self.camera.name = "CameraRobot"
     self.append(self.camera)
     self.properties(cam_width = 256, cam_height = 256, cam_focal = 35.0,
                     capturing = True, Vertical_Flip = True)
     # set the frequency to 20 Hz
     self.frequency(20)
     # add toggle capture action (`Space` key)
     bpymorse.add_sensor(type="KEYBOARD")
     obj = bpymorse.get_context_object()
     sensor = obj.game.sensors[-1]
     sensor.key = 'SPACE'
     bpymorse.add_controller(type='LOGIC_AND')
     controller = obj.game.controllers[-1]
     bpymorse.add_actuator(type='PROPERTY')
     actuator = obj.game.actuators[-1]
     actuator.mode = 'TOGGLE'
     actuator.property = 'capturing'
     controller.link(sensor = sensor, actuator = actuator)
     # looking in +X
     SensorCreator.rotate(self, x=math.pi/2, z=math.pi/2)
     # append CameraMesh with its textures
     self.append_meshes(['CameraMesh'], "camera")
     self.rotate(z=math.pi)
开发者ID:DAInamite,项目名称:morse,代码行数:26,代码来源:sensors.py


示例2: __init__

 def __init__(self, name=None):
     SensorCreator.__init__(self, name, "morse/sensors/odometry", \
                            "OdometryClass", "odometry")
     mesh = Cylinder("OdometryCylinder")
     mesh.scale = (.02, .02, .02)
     mesh.color(.5, .5, .5)
     self.append(mesh)
开发者ID:matrixchan,项目名称:morse,代码行数:7,代码来源:sensors.py


示例3: __init__

 def __init__(self, name=None):
     SensorCreator.__init__(self, name, "morse.sensors.battery_state.BatteryStateSensor", "battery")
     mesh = Cylinder("BatteryCylinder")
     mesh.scale = (.01, .01, .04)
     mesh.color(.2, .2, .2)
     self.append(mesh)
     self.properties(DischargingRate = 0.05)        
开发者ID:mudrole1,项目名称:morse,代码行数:7,代码来源:sensors.py


示例4: properties

 def properties(self, **kwargs):
     SensorCreator.properties(self, **kwargs)
     if 'collision_property' in kwargs:
         try:
             sensor = self._bpy_object.game.sensors[-1]
             sensor.property = kwargs['collision_property']
         except KeyError:
             pass
开发者ID:DAInamite,项目名称:morse,代码行数:8,代码来源:sensors.py


示例5: __init__

    def __init__(self, name=None):
        SensorCreator.__init__(self, name,
                               "nuclear_radiation_sensor.sensors.nuclear_radiation.NuclearRadiation")

        mesh = Cube("SensorCube")
        mesh.scale = (0.016, .028, .01)
        mesh.color(0.8, 0.0, 0.0)
        self.append(mesh)
开发者ID:mklostermann,项目名称:morse-radiation_sensor,代码行数:8,代码来源:nuclear_radiation.py


示例6: __init__

 def __init__(self, name="Kinect"):
     SensorCreator.__init__(self, name, "morse.sensors.kinect.Kinect", "kinect")
     mesh = Cube("KinectMesh")
     mesh.scale = (.02, .1, .02)
     mesh.color(.8, .8, .8)
     self.append(mesh)
     self.video_camera = VideoCamera('rgb')
     self.video_camera.properties(cam_width = 128, cam_height=128)
     self.depth_camera = DepthCamera('depth')
     #self.depth_camera.properties(Class='DepthVideoCamera')
     self.depth_camera.properties(cam_width = 128, cam_height=128)
     self.append(self.video_camera)
     self.append(self.depth_camera)
     # TODO find Kinect spec for cameras positions
     self.video_camera.location = (.06, +.08, .04)
     self.depth_camera.location = (.06, -.08, .04)
开发者ID:danyalrehman,项目名称:Aerospace-Simulations,代码行数:16,代码来源:sensors.py


示例7: __init__

 def __init__(self, name="Kinect"):
     # meta sensor composed of 2 cameras (rgb and depth)
     SensorCreator.__init__(self, name, "morse.core.sensor.Sensor", "kinect")
     mesh = Cube("KinectMesh")
     mesh.scale = (.02, .1, .02)
     mesh.color(.8, .8, .8)
     self.append(mesh)
     self.video_camera = VideoCamera('rgb')
     self.video_camera.properties(cam_width = 128, cam_height=128)
     self.depth_camera = DepthCamera('depth')
     self.depth_camera.properties(classpath='morse.sensors.depth_camera.DepthVideoCamera')
     self.depth_camera.properties(cam_width = 128, cam_height=128, Vertical_Flip=True)
     self.append(self.video_camera)
     self.append(self.depth_camera)
     # TODO find Kinect spec for cameras positions
     self.video_camera.location = (.06, +.08, .04)
     self.depth_camera.location = (.06, -.08, .04)
开发者ID:Djeef,项目名称:morse,代码行数:17,代码来源:sensors.py


示例8: __init__

    def __init__(self, name=None):
        """ Sensor to detect objects colliding with the current object.

        Doc: https://www.blender.org/manual/game_engine/logic/sensors/collision.html
        """
        SensorCreator.__init__(self, name)
        obj = bpymorse.get_context_object()
        # Sensor, Collision Sensor, detects static and dynamic objects but
        # not the other collision sensor objects.
        obj.game.physics_type = 'SENSOR'
        # Specify a collision bounds type other than the default
        obj.game.use_collision_bounds = True
        obj.scale = (0.02,0.02,0.02)
        # replace Always sensor by Collision sensor
        sensor = obj.game.sensors[-1]
        sensor.type = 'COLLISION'
        # need to get the new Collision Sensor object
        sensor = obj.game.sensors[-1]
        sensor.use_pulse_true_level = True # FIXME doesnt seems to have any effect
        sensor.use_material = False # we want to filter by property, not by material
        # Component mesh (eye sugar)
        mesh = Cube("CollisionMesh")
        mesh.color(.8, .2, .1)
        self.append(mesh)
开发者ID:amiller27,项目名称:morse,代码行数:24,代码来源:sensors.py


示例9: rotate

 def rotate(self, x=0, y=0, z=0):
     SensorCreator.rotate(self, x=y, y=z, z=x)
开发者ID:DAInamite,项目名称:morse,代码行数:2,代码来源:sensors.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python bpymorse.get_context_object函数代码示例发布时间:2022-05-27
下一篇:
Python creator.ActuatorCreator类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap