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


Python Controller.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from Controller import Controller [as 别名]
# 或者: from Controller.Controller import __init__ [as 别名]
	def __init__(self, enemy, player, director):
		Controller.__init__(self, enemy, director)
		self.player = player
		self.enemy_speed = 0.10
		self.ttl = 0
		self.lastSpeedX = 0
		self.lastSpeedY = 0
开发者ID:dgalaktionov,项目名称:Aleph,代码行数:9,代码来源:MeleeController.py

示例2: __init__

# 需要导入模块: from Controller import Controller [as 别名]
# 或者: from Controller.Controller import __init__ [as 别名]
 def __init__(self, ser, default = RGBState.STATE_OFF):
   Controller.__init__(self)
   self.ser = ser
   self.default = default
   self.keepalive = False
   self.state = self.default
   self.lock = threading.Lock()
开发者ID:bossjones,项目名称:Jarvis,代码行数:9,代码来源:RGBMultiController.py

示例3: __init__

# 需要导入模块: from Controller import Controller [as 别名]
# 或者: from Controller.Controller import __init__ [as 别名]
 def __init__(self, prefs):
     '''
     Constructor
     '''
     Controller.__init__(self)
     self.shared_prefs = prefs
     
开发者ID:NBor,项目名称:SkyPython,代码行数:8,代码来源:LocationController.py

示例4: __init__

# 需要导入模块: from Controller import Controller [as 别名]
# 或者: from Controller.Controller import __init__ [as 别名]
    def __init__(self, speed, min_altitude, max_altitudeGoal, height_diff, \
    timeout, bbx, bby, pid_x, pid_y, pid_z, pid_theta, bounding_box=True):
        # Initialize the node and rate
        Mode.__init__(self, 'land_mode')
        Controller.__init__(self, pid_x, pid_y, pid_z, pid_theta, bounding_box)

        # Subscribers
        # self.sub_navdata = rospy.Subscriber('/ardrone/navdata', Navdata, self.navdata_cb)
        ##self.sub_state = rospy.Subscriber('/smach/state', String, self.state_cb)
        self.sub_state = rospy.Subscriber('/smach/state',String, self.handle_timer_cb)

        # Publishers
        self.pub_altitude = rospy.Publisher('/cmd_vel', Twist, queue_size=1)
        self.pub_land = rospy.Publisher('/ardrone/land', Empty, queue_size=100) #this turns off the motors

        # NOTE changed to passing transition and state info along
        # /smach/transition and /smach/state topics, respectively
        # self.pub_return_to_state = rospy.Publisher('qc_smach/transitions', String, queue_size=1)
        self.pub_transition = rospy.Publisher('smach/transition', String, queue_size=1)

        # Initialize member variables
        self.transition = String()
        self.state = 'nada'
        self.timer = rospy.Timer(rospy.Duration(timeout), self.goto_reacquisition)

        self.altitude_command = Twist()
        self.altitude_command.linear.z = speed

        self.min_altitude = min_altitude
        self.speed = speed
        self.max_altitudeGoal = max_altitudeGoal
        self.height_diff = height_diff
开发者ID:jay3ss,项目名称:eagle_one_test,代码行数:34,代码来源:Land.py

示例5: __init__

# 需要导入模块: from Controller import Controller [as 别名]
# 或者: from Controller.Controller import __init__ [as 别名]
	def __init__(self, model, view):
		Controller.__init__(self, model, view)
		self.choices = {
			1: self._choice_insert_stop,
			2: self._choice_insert_time,
			3: self._choice_insert_local,
			"sair": self.finish}
开发者ID:jimmyskull,项目名称:BusOntologyBrowser,代码行数:9,代码来源:MenuControllerAdmin.py

示例6: __init__

# 需要导入模块: from Controller import Controller [as 别名]
# 或者: from Controller.Controller import __init__ [as 别名]
 def __init__( self ):
   # ui
   self._tl_label = "tl"
   self._tm_label = "tm"
   self._tr_label = "tr"
   self._bl_label = "bl"
   self._bm_label = "bm"
   self._br_label = "br"
   Controller.__init__( self, view=PrototypeController.PrototypeView(self) )
开发者ID:BreadTech,项目名称:BreadInterface,代码行数:11,代码来源:Prototype.py

示例7: __init__

# 需要导入模块: from Controller import Controller [as 别名]
# 或者: from Controller.Controller import __init__ [as 别名]
	def __init__(self, model, view):
		Controller.__init__(self, model, view)
		self.choices = {
			1: self._choice_list_location_schedule,
			2: self._choice_lines_having_a_spot,
			3: self._choice_list_line_schedule,
			4: self._choice_list_itinerary_lines,
			5: self._choice_list_bus_spot_near_location,
			6: self._choice_list_available_schedules_of_initial_itinerary_bus_stop,
			"sair": self.finish}
开发者ID:jimmyskull,项目名称:BusOntologyBrowser,代码行数:12,代码来源:MenuController.py

示例8: __init__

# 需要导入模块: from Controller import Controller [as 别名]
# 或者: from Controller.Controller import __init__ [as 别名]
 def __init__(self, event_handler):
     Controller.__init__(self, event_handler)
     self.modifiers=set(map(str, ['RIGHT SHIFT','LEFT SHIFT','RIGHT CTRL', 'LEFT CTRL','RIGHT ALT', 'LEFT ALT']))
     
     self.keys=set(['F'+str(x) for x in range(12)]) \
         | set(map(chr, range(ord('A'), ord('Z')))) \
         | set(['ESC', 'SPACE', 'ENTER']) \
         | set(map(chr, range(ord('0'), ord('9'))))
     '''TODO: more keys'''
     self.registered_keys=dict()
     self.key_codes=dict()
开发者ID:kakila,项目名称:steeringbehaviors,代码行数:13,代码来源:KeyboardController.py

示例9: __init__

# 需要导入模块: from Controller import Controller [as 别名]
# 或者: from Controller.Controller import __init__ [as 别名]
 def __init__(self):
     '''
     Constructor
     '''
     Controller.__init__(self)
     self.controllers = []
     self.zoom_controller = None
     self.manual_direction_controller = None
     self.sensor_orientation_controller = None
     #self.time_travel_clock = TimeTravelClock();
     #self.transitioning_clock = TransitioningCompositeClock(timeTravelClock, RealClock())
     self.teleporting_controller = None
     self.using_auto_mode = True
     
开发者ID:NBor,项目名称:SkyPython,代码行数:15,代码来源:ControllerGroup.py

示例10: __init__

# 需要导入模块: from Controller import Controller [as 别名]
# 或者: from Controller.Controller import __init__ [as 别名]
    def __init__(self, view, world_model, event_handler):
        '''
        Constructor
        '''
        Controller.__init__(self, event_handler)
        self.view=view
        self.world=world_model
        #registers sprite on model and view. Grabs it to disallow physics modification
        ch_id=world_model.add_entity((0,0), (0,0))
        view.add_entity(ch_id, shape='s')
        world_model.grab_entity(ch_id)

        self.ch_id=ch_id
        
        self.DAMAGE_EVENT=world_model.DAMAGE_EVENT
开发者ID:kakila,项目名称:steeringbehaviors,代码行数:17,代码来源:Crosshair.py

示例11: __init__

# 需要导入模块: from Controller import Controller [as 别名]
# 或者: from Controller.Controller import __init__ [as 别名]
 def __init__(self,event_handler):
     Controller.__init__(self,event_handler)
     
     # Definition of Mouse events
     self.MOUSE_MOVE=event_handler.new_event_type() 
     self.MOUSE_BTN1_DOWN=event_handler.new_event_type() 
     self.MOUSE_BTN2_DOWN=event_handler.new_event_type()
     self.MOUSE_BTN3_DOWN=event_handler.new_event_type()
     self.MOUSE_BTN1_UP=event_handler.new_event_type()
     self.MOUSE_BTN2_UP=event_handler.new_event_type()                          
     self.MOUSE_BTN3_UP=event_handler.new_event_type()                 
     
     self.pygame.init()        
     self.pygame.mouse.set_visible(True)
     self.last_btn=[False, False, False]
开发者ID:kakila,项目名称:steeringbehaviors,代码行数:17,代码来源:MouseController.py

示例12: __init__

# 需要导入模块: from Controller import Controller [as 别名]
# 或者: from Controller.Controller import __init__ [as 别名]
    def __init__(self, bbx, bby, pid_x, pid_y, pid_z, pid_theta, bounding_box=True):
        # Initialize the node which is inherited from the Mode super class
        Mode.__init__(self, "follow_mode")
        # Initialize the controllers correctly
        Controller.__init__(self, pid_x, pid_y, pid_z, pid_theta, bounding_box)

        # Publishers
        self.pub_ctrl = rospy.Publisher("cmd_vel", Twist, queue_size=100)

        ########################
        # Set the bounding box #
        ########################

        self.bbx_min = bbx[0]
        self.bbx_max = bbx[1]
        self.bby_min = bby[0]
        self.bby_max = bby[1]
开发者ID:CSULAQuadcopter,项目名称:eagle_one_test,代码行数:19,代码来源:Follow.py

示例13: __init__

# 需要导入模块: from Controller import Controller [as 别名]
# 或者: from Controller.Controller import __init__ [as 别名]
 def __init__(self, motion_ser):
   Controller.__init__(self)
   self.ser = motion_ser
   self.on = False
开发者ID:bossjones,项目名称:Jarvis,代码行数:6,代码来源:RunnerLightsController.py

示例14: __init__

# 需要导入模块: from Controller import Controller [as 别名]
# 或者: from Controller.Controller import __init__ [as 别名]
	def __init__(self, player, director):
		Controller.__init__(self, player, director)
		self.player_speed = 0.25
开发者ID:dgalaktionov,项目名称:Aleph,代码行数:5,代码来源:PlayerController.py

示例15: __init__

# 需要导入模块: from Controller import Controller [as 别名]
# 或者: from Controller.Controller import __init__ [as 别名]
 def __init__(self):
     '''
     Constructor, initialize superclass
     '''
     Controller.__init__(self)
开发者ID:NBor,项目名称:SkyPython,代码行数:7,代码来源:ManualOrientationController.py


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