python實(shí)現(xiàn)nao機(jī)器人身體軀干和腿部動(dòng)作操作
更新時(shí)間:2019年04月29日 10:42:48 作者:Earl_Martin
這篇文章主要為大家詳細(xì)介紹了python實(shí)現(xiàn)nao機(jī)器人身體軀干和腿部動(dòng)作操作,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
本文實(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)
以上就是本文的全部內(nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
python 爬蟲網(wǎng)頁登陸的簡單實(shí)現(xiàn)
這篇文章主要介紹了python 爬蟲網(wǎng)頁登陸的簡單實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-11-11
利用Rust實(shí)現(xiàn)Python加速的技巧分享
這篇文章主要想來和大家一起探討一下關(guān)于使用Rust對(duì)Python計(jì)算進(jìn)行加速的問題,文中的示例代碼講解詳細(xì),感興趣的小伙伴可以跟隨小編一起學(xué)習(xí)一下2023-09-09
python從ftp下載數(shù)據(jù)保存實(shí)例
這篇文章主要介紹了python從ftp下載數(shù)據(jù)到本地保存的實(shí)例代碼方法,大家參考使用吧2013-11-11

