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


Python Robot.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from Robot import Robot [as 别名]
# 或者: from Robot.Robot import __init__ [as 别名]
    def __init__(self,r_name,r_id,x_off,y_off,theta_off, capacity):

        Robot.__init__(self,r_name,r_id,x_off,y_off,theta_off)

        self.carrier_pub = rospy.Publisher("carrier_position",String, queue_size=10)
        self.carrier_sub = rospy.Subscriber("carrier_position", String, self.carrier_callback)
        self.picker_sub = rospy.Subscriber("picker_position", String, self.picker_callback)
        self.kiwi_sub = rospy.Subscriber("picker_kiwi_transfer", String, self.kiwi_callback)
        self.kiwi_pub = rospy.Publisher("carrier_kiwi_transfer",String, queue_size=10)
        self.queue_pub = rospy.Publisher("carrier_allocation_request", String, queue_size=10)
        self.queue_sub = rospy.Subscriber("carrier_allocation_response", String, self.queue_callback)

        self.next_robot_id = None
        self.carrier_robots = ["0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0"]
        self.picker_robots = ["0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0"]

        self.max_load = capacity
        self.previousState = self.CarrierState.WAITINGFORPICKER
        self.is_going_home = False

        #these variables are used to help the laser callback, it will help in dealing with entities/debris on
        # it's path to the picker robot
        #self.StageLaser_sub = rospy.Subscriber(self.robot_node_identifier+"/base_scan",sensor_msgs.msg.LaserScan,self.StageLaser_callback)
        self.ReadLaser = False
        self.FiveCounter = 0
        self._divertingPath_ = False
开发者ID:hsye185,项目名称:SoftEng-306-Project-1,代码行数:28,代码来源:RobotCarrier.py

示例2: __init__

# 需要导入模块: from Robot import Robot [as 别名]
# 或者: from Robot.Robot import __init__ [as 别名]
 def __init__(self,
              parent=None,
              instanceName=None,
              instanceType = Sensation.InstanceType.Real,
              level=0):
     print("We are in Connection, not Robot")
     Robot.__init__(self,
                    parent=parent,
                    instanceName=instanceName,
                    instanceType=instanceType,
                    level=level)
开发者ID:korhore,项目名称:Wall-E,代码行数:13,代码来源:Connection.py

示例3: __init__

# 需要导入模块: from Robot import Robot [as 别名]
# 或者: from Robot.Robot import __init__ [as 别名]
 def __init__(self,
              parent=None,
              instanceName=None,
              instanceType = Sensation.InstanceType.SubInstance,
              level=0):
     Robot.__init__(self,
                    parent=parent,
                    instanceName=instanceName,
                    instanceType=instanceType,
                    level=level)
     print("We are in Hearing, not Robot")
开发者ID:korhore,项目名称:Wall-E,代码行数:13,代码来源:Hearing.py

示例4: __init__

# 需要导入模块: from Robot import Robot [as 别名]
# 或者: from Robot.Robot import __init__ [as 别名]
 def __init__(self,
              parent=None,
              instanceName=None,
              instanceType = Sensation.InstanceType.SubInstance,
              level=0):
     print("We are in TensorFlowClassification, not Robot")
     Robot.__init__(self,
                    parent=parent,
                    instanceName=instanceName,
                    instanceType=instanceType,
                    level=level)
开发者ID:korhore,项目名称:Wall-E,代码行数:13,代码来源:TensorFlowClassification.py

示例5: __init__

# 需要导入模块: from Robot import Robot [as 别名]
# 或者: from Robot.Robot import __init__ [as 别名]
    def __init__(self,r_name,r_id,x_off,y_off,theta_off,capacity):
        Robot.__init__(self,r_name,r_id,x_off,y_off,theta_off)

        self.max_load = capacity

        self.timeLastAdded = time.clock()
        self.disableSideLaser = False

        self.picker_pub = rospy.Publisher("picker_position",String, queue_size=10)
        self.kiwi_sub = rospy.Subscriber("carrier_kiwi_transfer", String, self.kiwi_callback)
        self.kiwi_pub = rospy.Publisher("picker_kiwi_transfer",String, queue_size=10)

        self.picker_sub = rospy.Subscriber("picker_position", String, self.picker_callback)
        self.picker_robots = ["0,0,0","0,0,0","0,0,0","0,0,0","0,0,0","0,0,0"]
开发者ID:hsye185,项目名称:SoftEng-306-Project-1,代码行数:16,代码来源:RobotPicker.py

示例6: __init__

# 需要导入模块: from Robot import Robot [as 别名]
# 或者: from Robot.Robot import __init__ [as 别名]
 def __init__(self, position, id, scale):
     Robot.__init__(self,position,id,scale)
         
     self.type = randint(0,1)
     
     if self.type == 0:
         taskMgr.add( self.randomWalk, 'walk')
         self.destination = Point2()
         self.setRandomPoint( self.destination )
     else:
         taskMgr.add( self.hunt, 'hunt')
         self.target = None
             
     self.time = 0
     self.bulletTime = 0
开发者ID:DisposedCheese,项目名称:RobotFightingGame,代码行数:17,代码来源:AI.py

示例7: __init__

# 需要导入模块: from Robot import Robot [as 别名]
# 或者: from Robot.Robot import __init__ [as 别名]
    def __init__(self,
                 socket, 
                 address,
                 parent=None,
                 instance=None,
                 is_virtualInstance=False,
                 is_subInstance=False,
                 level=0):

        Robot.__init__(self,
                       parent=parent,
                       instance=instance,
                       is_virtualInstance=is_virtualInstance,
                       is_subInstance=is_subInstance,
                       level=level)
        
        print("We are in SocketServer, not Robot")
        self.socket=socket
        self.address=address
        self.name = str(address)
开发者ID:korhore,项目名称:Wall-E,代码行数:22,代码来源:SocketServer.py

示例8: __init__

# 需要导入模块: from Robot import Robot [as 别名]
# 或者: from Robot.Robot import __init__ [as 别名]
    def __init__(self,
                 parent=None,
                 instanceName=None,
                 instanceType = Sensation.InstanceType.SubInstance,
                 level=0):
        print("We are in RaspberryPiCamera, not Robot")
        Robot.__init__(self,
                       parent=parent,
                       instanceName=instanceName,
                       instanceType=instanceType,
                       level=level)
        

          
        # from settings
        self.camera = picamera.PiCamera()
        self.camera.rotation = 180
        self.lastImage = None

        self.running=False
        self.debug_time=time.time()
开发者ID:korhore,项目名称:Wall-E,代码行数:23,代码来源:RaspberryPiCamera.py

示例9: __init__

# 需要导入模块: from Robot import Robot [as 别名]
# 或者: from Robot.Robot import __init__ [as 别名]
    def __init__(self, position, id, scale):
        Robot.__init__(self,position,id,scale)

        self.rotationX = 0
        self.rotationY = 0
        self.rotationZ = 0

        self.playerDirection = Vec3()
        self.playerDirection.set(0.0,1.0,0.0)
        self.scale = scale

        #Sets up a Third Person Camera View#
        self.ThirdPerson = True
        self.cameraDirection = Vec3()
        self.cameraDirection.set(0.0,1.0,0.0)
        self.fpvec = Vec3() #Used to set the correct camera location for First Person View
        self.fpvec.set(0,2.0, 0)
        self.CAMERA_HEIGHT = 12*self.scale
        self.CAMERA_LENGTH = 25*self.scale
        self.setCamera()
        ####################################
        
        #Control Schemes##############################
        base.accept("arrow_up", self.up)
        base.accept("arrow_up-repeat", self.up)
        
        base.accept("arrow_down", self.down)
        base.accept("arrow_down-repeat", self.down)
        
        base.accept("arrow_left", self.left)
        base.accept("arrow_left-repeat", self.left)
        
        base.accept("arrow_right", self.right)
        base.accept("arrow_right-repeat", self.right)
        
        base.accept("w", self.up)
        base.accept("w-repeat", self.up)
        
        base.accept("a", self.left)
        base.accept("a-repeat",self.left)
        
        base.accept("s", self.down)
        base.accept("s-repeat", self.down)
        
        base.accept("d", self.right)
        base.accept("d-repeat",self.right)
        
        base.accept("q",self.lookLeft)
        base.accept("q-repeat",self.lookLeft)
        
        base.accept("e",self.lookRight)
        base.accept("e-repeat",self.lookRight)
        
        base.accept("page_up", self.lookUp)
        base.accept("page_up-repeat", self.lookUp)
        
        base.accept("page_down",self.lookDown)
        base.accept("page_down-repeat",self.lookDown)
        
        base.accept("[",self.tiltLeft)
        base.accept("[-repeat",self.tiltLeft)
        
        base.accept("]",self.tiltRight)
        base.accept("]-repeat",self.tiltRight)
        
        base.accept( 'mouse1', self.fire)
        #base.accept( 'mouse1-up', self.setMouseButton)
        base.accept( 'mouse2', self.ResetZoom)
        #base.accept( 'mouse2-up', self.setMouseButton)
        #base.accept( 'mouse3', self.setMouseButton)
        #base.accept( 'mouse3-up', self.setMouseButton)
        base.accept( 'wheel_up', self.ZoomIn)
        base.accept( 'wheel_down', self.ZoomOut)
        
        base.accept("t",self.TogglePerson)#Allows you to toggle between first and third person view
        
        base.accept("space", self.fire);
开发者ID:DisposedCheese,项目名称:RobotFightingGame,代码行数:79,代码来源:Player.py


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