python實(shí)現(xiàn)nao機(jī)器人身體軀干和腿部動(dòng)作操作
本文實(shí)例為大家分享了python實(shí)現(xiàn)nao機(jī)器人身體軀干和腿部動(dòng)作的具體代碼,供大家參考,具體內(nèi)容如下
跟上一篇類似,代碼沒什么難度,可以進(jìn)行擴(kuò)展。
#-*-encoding:UTF-8-*- '''control nao's left foot, cartesian control:torso and foot trajectories ''' import sys import motion from naoqi import ALProxy def StiffnessOn(proxy): pNmaes="Body" pStiffnessLists=1.0 pTimeLists=1.0 proxy.stiffnessInterpolation(pName,pStiffnessLists,pTimeLists) def main(robotIP): '''example of cartesian foot trajectory ''' 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) #send nao to pose init postureProxy.goToPosture("StandInit",0.5) space=motion .FRAME_ROBOT AxisMask=almath.AXIS_MASK_VEL isAbsolute=False path=[0.0,-0.07,-0.03,0.0,0.0,0.0] #lower the torso and move the size effector="Torso" time=2.0 motionProxy.positionInterpolation(effector,space,path,axisMask,time,isAbsolute) #lleg motion effector="LLeg" path=[0.0,0.06,0.00,0.0,0.0,0.0] times=2.0 motionProxy.positionInterpolation(effector,space,axisMask,time,isAbsolute) if __name__=="__main__": robotIP="127.0.0.1" if len(sys.argv)<=1: print "usage python robotIP" else: robotIP=sys.argv[1] main(robotIP)
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
Collatz 序列、逗號(hào)代碼、字符圖網(wǎng)格實(shí)例
下面小編就為大家?guī)硪黄狢ollatz 序列、逗號(hào)代碼、字符圖網(wǎng)格實(shí)例。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-06-06Python中實(shí)現(xiàn)遠(yuǎn)程調(diào)用(RPC、RMI)簡(jiǎn)單例子
說白了,遠(yuǎn)程調(diào)用就是將對(duì)象名、函數(shù)名、參數(shù)等傳遞給遠(yuǎn)程服務(wù)器,服務(wù)器將處理結(jié)果返回給客戶端2014-04-04python如何在pygame中設(shè)置字體并顯示中文詳解
再簡(jiǎn)單的游戲界面中均涉及文字處理,下面這篇文章主要給大家介紹了關(guān)于python如何在pygame中設(shè)置字體并顯示中文的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),需要的朋友可以參考下2023-01-0110 行Python 代碼實(shí)現(xiàn) AI 目標(biāo)檢測(cè)技術(shù)【推薦】
這篇文章主要介紹了10 行Python 代碼,實(shí)現(xiàn) AI 目標(biāo)檢測(cè)技術(shù),看完了代碼,我們?cè)谝黄鹆牧哪繕?biāo)檢測(cè)背后的技術(shù)背景,并解讀這10行Python代碼的由來和實(shí)現(xiàn)原理。感興趣的朋友跟隨小編一起看看吧2019-06-06Python IDE環(huán)境之 新版Pycharm安裝詳細(xì)教程
這篇文章主要介紹了Python IDE環(huán)境之 新版Pycharm安裝教程,本文教程給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-03-03