本文整理汇总了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
示例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()
示例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
示例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
示例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}
示例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) )
示例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}
示例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()
示例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
示例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
示例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]
示例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]
示例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
示例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
示例15: __init__
# 需要导入模块: from Controller import Controller [as 别名]
# 或者: from Controller.Controller import __init__ [as 别名]
def __init__(self):
'''
Constructor, initialize superclass
'''
Controller.__init__(self)