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

Python six.print_函数代码示例

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

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



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

示例1: on_connect

    def on_connect(self, myo, timestamp):
		print_("Connected to Myo")
		myo.vibrate('short')
                myo.set_stream_emg(stream_emg.enabled)
		myo.request_rssi()
		global start
		start = time.time()
开发者ID:NEC-COM,项目名称:myomatlab,代码行数:7,代码来源:getOrient.py


示例2: on_pose

 def on_pose(self, myo, timestamp, pose):
     self.nowpose=pose
     print_('on_pose', pose)
     if pose == "fist":
         self.fistcount=self.fistcount+1
         if self.fistcount==1:
             self.state=0
             print("Entering state 0")
开发者ID:FWYT,项目名称:Myo-Data-Collection,代码行数:8,代码来源:Send_16_gestures+-+Copy.py


示例3: on_pose

    def on_pose(self, myo, timestamp, pose):
        print_('on_pose', pose)

        self.data["on_pose"] = { "timestamp" : timestamp, "data" : pose }

        msgs = []
        if pose == pose_t.double_tap:
            msgs += [ HMTLprotocol.get_rgb_msg(self.options.hmtladdress,
                                              1,
                                              255,0,255) ]
        elif pose == pose_t.rest:
            msgs += [
                HMTLprotocol.get_rgb_msg(self.options.hmtladdress,
                                         1,
                                         0,0,0),
                
                HMTLprotocol.get_value_msg(69,
                                           0,
                                           0),

                HMTLprotocol.get_value_msg(69,
                                           1,
                                           0)
            ]

        elif pose == pose_t.wave_in:
            msgs += [ HMTLprotocol.get_rgb_msg(self.options.hmtladdress,
                                               1,
                                               0,255,0) ]
        elif pose == pose_t.wave_out:
            msgs += [ HMTLprotocol.get_rgb_msg(self.options.hmtladdress,
                                               1,
                                               0,0,255) ]
        elif pose == pose_t.fist:
            msgs += [
                HMTLprotocol.get_rgb_msg(self.options.hmtladdress,
                                         1,
                                         255,0,0),
                HMTLprotocol.get_value_msg(69,
                                           1,
                                           255) 
            ]
        elif pose == pose_t.fingers_spread:
            msgs += [ 
                HMTLprotocol.get_rgb_msg(self.options.hmtladdress,
                                         1,
                                         255,255,255),
                HMTLprotocol.get_value_msg(69,
                                           0,
                                           128) 
                ]

        if (len(msgs) != 0):
            for msg in msgs:
                self.client.send_and_ack(msg, False)
            print("Sent and acked to client")
开发者ID:HMTL,项目名称:HMTL,代码行数:56,代码来源:myo_client.py


示例4: main

def main():
    hub = myo.Hub()
    hub.run(1000, Listener())

    # Listen to keyboard interrupts and stop the
    # hub in that case.
    try:
        while hub.running:
            myo.time.sleep(0.2)
    except KeyboardInterrupt:
        print_("Quitting ...")
        hub.stop(True)
开发者ID:brnmsmith,项目名称:myo-python,代码行数:12,代码来源:hello_myo.py


示例5: on_pose

    def on_pose(self, myo, timestamp, pose):
        self.nowpose=pose
        print_('on_pose', pose)
##        if pose == pose_t.double_tap:
##            print_("Enabling EMG")
##            myo.set_stream_emg(stream_emg.enabled)
##        elif pose == pose_t.fingers_spread:
##            myo.set_stream_emg(stream_emg.disabled)
        if pose == "fist":
            self.fistcount=self.fistcount+1
            if self.fistcount==1:
                self.state=0
                print("Entering state 0")
开发者ID:FWYT,项目名称:Myo-Data-Collection,代码行数:13,代码来源:new+data+collect.py


示例6: on_pair

 def on_pair(self, myo, timestamp):
     print_("Paired")
     print_(
         "If you don't see any responses to your movements, try re-running the program or making sure the Myo works with Myo Connect (from Thalmic Labs)."
     )
     print_("Double tap enables EMG.")
     print_("Spreading fingers disables EMG.\n")
开发者ID:hazehazard14,项目名称:myomatlab,代码行数:7,代码来源:getPose.py


示例7: main

def main():
    #address = "192.168.1.110"
    address = "localhost"
    port = 0
    hub = myo.Hub()
    hub.run(10000000, Listener(address, port))
    # Listen to keyboard interrupts and stop the
    # hub in that case.
    try:
        while hub.running:
            myo.time.sleep(0.2)
    except KeyboardInterrupt:
        print_("Quitting ...")
        hub.stop(True)
开发者ID:FWYT,项目名称:Myo-Data-Collection,代码行数:14,代码来源:Send_16_gestures+-+Copy.py


示例8: main

def main():
    options = handle_args()

    print("%s\nOpening client.  Address=%d\n%s" % ("*"*80, options.hmtladdress, "*"*80))

    client = HMTLClient(options)

    hub = myo.Hub()
    hub.set_locking_policy(myo.locking_policy.none)
    hub.run(1000, Listener(client, options))

    # Listen to keyboard interrupts and stop the
    # hub in that case.
    try:
        while hub.running:
            myo.time.sleep(0.2)
    except KeyboardInterrupt:
        print_("Quitting ...")
        hub.stop(True)
开发者ID:HMTL,项目名称:HMTL,代码行数:19,代码来源:myo_client.py


示例9: opponentChoice

def opponentChoice(userChoice,myo):
    choice=random.randint(1,3)
    if choice==1:
        print_("Opponent chose Scissors!")
        if choice==userChoice:
            write_message("Tie!", GAME.me, GAME.opponent)
            print_c_scissors(display_width-250, 150)
            print_scissors(75, 150)
        elif 2==userChoice:
            GAME.opponent+=1
            write_message("You Lose!", GAME.me, GAME.opponent)
            print_c_scissors(display_width-250, 150)
            print_paper(75, 150)
            myo.vibrate('long')
        else:
            GAME.me+=1
            write_message("You Win!", GAME.me, GAME.opponent)
            print_c_scissors(display_width-250, 150)
            print_rock(75, 150)
    elif choice==2:
        print_("Opponent chose Paper!")
        if choice==userChoice:
            write_message("Tie!", GAME.me, GAME.opponent)
            print_c_paper(display_width-250, 150)
            print_paper(75, 150)
        elif 1==userChoice:
            GAME.me+=1
            write_message("You Win!", GAME.me, GAME.opponent)
            print_c_paper(display_width-250, 150)
            print_scissors(75, 150)
        else:
            GAME.opponent+=1
            write_message("You Lose!", GAME.me, GAME.opponent)
            print_c_paper(display_width-250, 150)
            print_rock(75, 150)
            myo.vibrate('long')
    else:
        print_("Opoonent chose Rock!")
        if choice==userChoice:
            write_message("Tie!", GAME.me, GAME.opponent)
            print_c_rock(display_width-250, 150)
            print_rock(75, 150)
        elif 2==userChoice:
            GAME.me+=1
            write_message("You Win!", GAME.me, GAME.opponent)
            print_c_rock(display_width-250, 150)
            print_paper(75, 150)
        else:
            GAME.opponent+=1
            write_message("You Lose!", GAME.me, GAME.opponent)
            print_c_rock(display_width-250, 150)
            print_scissors(75, 150)
            myo.vibrate('long')
开发者ID:al-duss,项目名称:myoduck,代码行数:53,代码来源:rockPaperScissors.py


示例10: on_pose

 def on_pose(self, myo, timestamp, pose):
     print_('on_pose', pose)
     if pose == pose_t.double_tap:
         print_("=" * 80)
         print_("Reset Orientation")
         or1x[0] = orx[0]
         or1y[0] = ory[0]
         or1z[0] = orz[0]
         or1w[0] = orw[0]
         #myo.set_stream_emg(stream_emg.enabled)
     elif pose == pose_t.fingers_spread:
         egg = 0
开发者ID:rhodesvr,项目名称:myo-march,代码行数:12,代码来源:MYO2.py


示例11: on_pose

 def on_pose(self, myo, timestamp, pose):
     if pose == pose_t.wave_in:
         #print_('on_pose', pose)
         print_("You chose Scissors!")
         opponentChoice(1,myo)
         myo.set_stream_emg(stream_emg.disabled)
     elif pose == pose_t.fingers_spread:
         #print_('on_pose', pose)
         print_("You chose Paper!")
         opponentChoice(2,myo)
         myo.set_stream_emg(stream_emg.disabled)
     elif pose == pose_t.fist:
         #print_('on_pose', pose)
         print_("You chose Rock!")
         opponentChoice(3,myo)
         myo.set_stream_emg(stream_emg.disabled)
开发者ID:al-duss,项目名称:myoduck,代码行数:16,代码来源:rockPaperScissors.py


示例12: on_pair

 def on_pair(self, myo, timestamp):
     print_('on_pair')
开发者ID:FWYT,项目名称:Myo-Data-Collection,代码行数:2,代码来源:Send_16_gestures+-+Copy.py


示例13: on_rssi

 def on_rssi(self, myo, timestamp, rssi):
     print_("RSSI:", rssi)
开发者ID:FWYT,项目名称:Myo-Data-Collection,代码行数:2,代码来源:Send_16_gestures+-+Copy.py


示例14: on_orientation_data

    def on_orientation_data(self, myo, timestamp, orientation):
        self.odr=orientation
        if self.state==-1:
            calib_start=input('Press 1 for calibration: ')
            self.state=0
            print("Beginning Calibration!!!")


        if self.counter2<50:
            output=convert_to_rpy(self.odr)
            roll1=output[0]
            pitch1=output[1]
            yaw1=output[2]
            #print_(roll1,pitch1,yaw1)

            self.rcfull[self.counter2] = math.cos(math.radians(roll1))
            self.rsfull[self.counter2] = math.sin(math.radians(roll1))
            self.pcfull[self.counter2] = math.cos(math.radians(pitch1))
            self.psfull[self.counter2] = math.sin(math.radians(pitch1))
            self.ycfull[self.counter2] = math.cos(math.radians(yaw1))
            self.ysfull[self.counter2] = math.sin(math.radians(yaw1))
        self.counter2=self.counter2+1
       
        
        

        if self.counter2 == 50:
            rc = numpy.mean(self.rcfull)
            pc = numpy.mean(self.pcfull)
            yc = numpy.mean(self.ycfull)
            rs = numpy.mean(self.rsfull)
            ps = numpy.mean(self.psfull)
            ys = numpy.mean(self.ysfull)

            if self.state==0:  # calibration

                self.rollb = math.degrees(math.atan2(rs,rc))
                self.pitchb = math.degrees(math.atan2(ps,pc))
                self.yawb = math.degrees(math.atan2(ys,yc))
                baseline=[self.rollb,self.pitchb,self.yawb]
                print(baseline)
                print("Calibration Complete! You have 2 seconds to change your gesture and then record a new one for 2")
                self.counter2=0
                self.state=1
                self.start_time = time.time()

            elif self.state == 1:

                #for i in range(1,1000):
                #    for j in range(1,10000):
                #        a=i
                time.sleep(2)
                self.counter2 = 0
                self.state = 2

            elif self.state == 2:  # data collection, identification and transfer

                self.roll = math.degrees(math.atan2(rs,rc))-self.rollb
                self.pitch = math.degrees(math.atan2(ps,pc))-self.pitchb
                self.yaw = math.degrees(math.atan2(ys,yc))-self.yawb
                a=numpy.matrix([self.roll,self.pitch,self.yaw])
                b=a.transpose()
             
                d=numpy.matlib.repmat(b,1,4) #hardcoded------CHANGE LATER!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
              
                pose_number=assign_pose_number(self.nowpose)
                self.W=numpy.matrix([[-2.38946624937314,172.907592400722,-12.1921835866013,30.7345074055692],[-1.60615657009811, 70.7802307763561,-10.0331866141660,-71.1455632604777],[5.87052357307342,52.4896992580217,-45.3268722289868,-67.7618396439250]])
                diff=self.W-d
              
                squared=numpy.square(diff)
              
                summed=sum(squared)
             
                #rooted=numpy.sqrt(summed)
                #rooted=rooted.tolist()
                rooted=summed.tolist()
                print("rooted", rooted)
               

                P = min(rooted[0])
                #print ("P ", P)
                Q = rooted[0].index(P)
                #print ("Q", Q)
                R = Q + 1
                #print("R" , R)




                #indx=rooted.index(min(rooted))+1#1-front; 2-up; 3-side; 4-down
                indx=R
                print ("indx",indx)
                print ("pose num ", pose_number)

                if indx==1:#front
                    if pose_number==1:
                        gesture_number=1
                        gesture_name='FRONT_finger_spread'
                        print_(gesture_name)
                        self._sock.sendto("Gesture: 1\n", ("<broadcast>", 10000))
#.........这里部分代码省略.........
开发者ID:FWYT,项目名称:Myo-Data-Collection,代码行数:101,代码来源:Send_16_gestures+-+Copy.py


示例15: on_lock

 def on_lock(self, myo, timestamp):
     print_('locked')
开发者ID:raychensg,项目名称:LeapCAD,代码行数:2,代码来源:hello_myo.py


示例16: on_pose

 def on_pose(self, myo, timestamp, pose):
     print_('on_pose', pose)
开发者ID:raychensg,项目名称:LeapCAD,代码行数:2,代码来源:hello_myo.py


示例17: on_unsync

 def on_unsync(self, myo, timestamp):
     print_('unsynced')
开发者ID:raychensg,项目名称:LeapCAD,代码行数:2,代码来源:hello_myo.py


示例18: on_sync

 def on_sync(self, myo, timestamp):
     print_('synced')
开发者ID:NEC-COM,项目名称:myomatlab,代码行数:2,代码来源:getGyro.py


示例19: on_pose

 def on_pose(self, myo, timestamp, pose):
     if pose == pose_t.fist:
     	print_('on_pose', pose)
     	fire()
开发者ID:al-duss,项目名称:myoduck,代码行数:4,代码来源:Space+Invader+with+added+myo.py


示例20: on_pair

 def on_pair(self, myo, timestamp):
     print_('Paired')
     print_("If you don't see any responses to your movements, try re-running the program or making sure the Myo works with Myo Connect (from Thalmic Labs).")
开发者ID:brnmsmith,项目名称:myo-python,代码行数:3,代码来源:hello_myo.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python myparser.parser函数代码示例发布时间:2022-05-27
下一篇:
Python myo.init函数代码示例发布时间: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