服务器之家

服务器之家 > 正文

python实现nao机器人身体躯干和腿部动作操作

时间:2021-06-21 00:36     来源/作者:Earl_Martin

本文实例为大家分享了python实现nao机器人身体躯干和腿部动作的具体代码,供大家参考,具体内容如下

上一篇类似,代码没什么难度,可以进行扩展。

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#-*-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)

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持服务器之家。

原文链接:https://blog.csdn.net/u011181878/article/details/21392629

标签:

相关文章

热门资讯

2020微信伤感网名听哭了 让对方看到心疼的伤感网名大全
2020微信伤感网名听哭了 让对方看到心疼的伤感网名大全 2019-12-26
yue是什么意思 网络流行语yue了是什么梗
yue是什么意思 网络流行语yue了是什么梗 2020-10-11
背刺什么意思 网络词语背刺是什么梗
背刺什么意思 网络词语背刺是什么梗 2020-05-22
苹果12mini价格表官网报价 iPhone12mini全版本价格汇总
苹果12mini价格表官网报价 iPhone12mini全版本价格汇总 2020-11-13
2021德云社封箱演出完整版 2021年德云社封箱演出在线看
2021德云社封箱演出完整版 2021年德云社封箱演出在线看 2021-03-15
返回顶部