91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

python控制nao機器人身體動作實例詳解

發布時間:2020-10-23 09:18:22 來源:腳本之家 閱讀:295 作者:Earl_Martin 欄目:開發技術

本文實例為大家分享了python控制nao機器人身體動作的具體代碼,供大家參考,具體內容如下

今天讀的代碼,順便寫了出來,與文檔的對比,差不多。

import sys
import motion
import almath
import naoqi from ALProxy
 
def StiffnessOn(proxy):
        pName="Body"
        pStiffnessLists
        pTime=1.0
        proxy.stiffnessInterpolation(pName,pStiffnessLists,pTime)
 
def main(robotIP):
        try:
               motionProxy=ALProxy("ALMotion",robotIP,9559)
        except Exception,e:
               print:"could not create a proxy!"
               print:"error is ",e
               
        try:
               postureProxy=ALProxy("ALRobotPosture",robotIP,9559)
        except Exception,e:
               print:"could not create a proxy!"
               print:"error is ",e
 
        StiffnessOn(motionProxy)
        postureProxy.goToPosture("StandInit",0.5)
 
        space=motion.FRAME_ROBOT
        coef=0.5
        times=[coef,2.0*coef,3.0*coef,4.0*coef]
        isAbsolute=False
        dy=+0.06
        dz=-0.03
        dwx==+0.30
 
        effector="Torso"
        path=[
               [0.0,-dy,dz,-dwx,0.0,0.0],
               [0.0,0.0,0.0,0.0,0.0,0.0],
               [0.0,+dy,dz,+dwx,0.0,0.0],
               [0.0,0.0,0.0,0.0,0.0,0.0]
              ]
 
        axisMask=almath.AXIS_MASK_ALL
        motionProxy.post.postionInterpolation(effector,space,path,times,isAbsolute)
 
        #motion of arms with block process
        axisMask=almath.AXIS_MASK_VEL
        times=[1.0*coef,2.0*coef]
        dy=+0.03
        effecor="RArm"
        path=[
               [0.0,dy,0.0,0.0,0.0,0.0],
               [0.0,0.0,0.0,0.0,0.0,0.0]
              ]
        motionProxy.positionInterpolation(effector,space,path,axisMask,times,inAbsolute)
 
if __name__=="__main__":
        robotIP="127.0.0.1"
 
        if len(sys.argv)<=1:
               print"useage default robotIP"
        else:
               robotIP=sys.arv[1]
        main(robotIP)

實例二,控制左右胳膊

#-*-encoding:UTF-8 -*-
 
import sys
import motion
import almath
form naoqi import ALProxy
 
def StiffnessOn(proxy):
        pName="Body"
        pStiffnessLists=1.0
        pTimeLists=1.0
        proxy.stiffnessInterpolation(pName,pStiffnessLists,pTimeLists)
 
def main(robotIP):
 
        #create a proxy to almtion
        try:
               motionProxy=ALProxy("ALMotion",robotIP,9559)
        except Exception,e:
               print "could not create a proxy"
               print "error is ",e
 
        #create a proxy to alrobotposture
        try:
               postureProxy=ALProxy("ALRobotPosture",robotIP,9559)
        except Exception,e:
               print "could not create a proxy"
               print "error is ",e
 
 
        StiffnessOn(motionProxy)
        postureProxy.goToPosture("StandInit",0.5)
        space=motion.FRAME_ROBOT
        isAbsolute=False
 
        effectorList=["LArm","RArm"]
        #motion of arms with block process
        axisMaskList=[almath.AXIS_MASK_VEL,almath.AXIS_MASK_VEL]
        timeLists=[[1.0],[1.0]]
        pathList=[   
                  [
                    [0.0,-0.04,0.0,0.0,0.0,0.0]],
                  [ 
                    [0.0,0.04,0.0,0.0,0.0,0.0]]
                ]
        motionProxy.positionInterpolation(effectorLists,space,pahtLists,axisMaskList,timeLists,isAbsolute)
 
        effectorLists=["LArm","RArm","Torso"]
        axisMaskLists=[
               almath.AXIS_MASK_VEL,
               almath.AXIS_MASK_VEL,
               almath.AXIS_MASK_ALL
               ]
        timeLists=[
               [[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,+dy,0.0,0.0,0.0,0.0],
               [0.0,-dy,0.0,0.0,0.0,0.0],
               [0.0,0.0,0.0,0.0,0.0,0.0]
               ]
        motionProxy.positionInterpolations(effectorList,space,pathList,axisMaskList,timeList,isAbsolute)
 
if __name__=="__main__":
        robotIP="127.0.0.1"
        if(sys.argv<1):
               print"usege default ip"
        else:
               robotIP=sys.arv[1]
        main(robotIP)

感受:

這些小的程序最不好處理的就是path中的數據了。這些數據是怎么獲得的?最大的可能就是在choregraph中3D視圖中測試得到,當然還有一種可能就是將choregraph與實體機連接,將機器人置于practice狀態,這樣操作來獲得數據。后者操作性更強,但由于實際原因,用前者的可能性是最大的。

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持億速云。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

兴安盟| 金堂县| 民乐县| 铁力市| 义乌市| 宁津县| 韩城市| 武功县| 株洲市| 启东市| 类乌齐县| 英山县| 鸡西市| 凤庆县| 太湖县| 商南县| 遵化市| 衡阳县| 铜梁县| 崇信县| 连山| 乌拉特中旗| 房产| 龙井市| 全椒县| 宁阳县| 旌德县| 开化县| 宽城| 长寿区| 射阳县| 新昌县| 玛多县| 楚雄市| 乾安县| 墨竹工卡县| 云浮市| 利辛县| 红原县| 汤原县| 吴川市|