本文整理汇总了Python中naoqi.ALProxy.getBodyNames方法的典型用法代码示例。如果您正苦于以下问题:Python ALProxy.getBodyNames方法的具体用法?Python ALProxy.getBodyNames怎么用?Python ALProxy.getBodyNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类naoqi.ALProxy
的用法示例。
在下文中一共展示了ALProxy.getBodyNames方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from naoqi import ALProxy [as 别名]
# 或者: from naoqi.ALProxy import getBodyNames [as 别名]
def main(robotIP, PORT=9559):
motionProxy = ALProxy("ALMotion", robotIP, PORT)
# Example showing how to get the names of all the joints in the body.
bodyNames = motionProxy.getBodyNames("Body")
print "Body:"
print str(bodyNames)
print ""
# Example showing how to get the names of all the joints in the left leg.
leftLegJointNames = motionProxy.getBodyNames("LLeg")
print "LLeg:"
print str(leftLegJointNames)
示例2: main
# 需要导入模块: from naoqi import ALProxy [as 别名]
# 或者: from naoqi.ALProxy import getBodyNames [as 别名]
def main(robotIP, PORT = 9559):
motion = ALProxy("ALMotion", robotIP, PORT)
motion.setStiffnesses("LShoulder", 1.0)
print motion.getBodyNames("Body")
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
avgYaw=MovingAverage(AVG_WINDOW_SIZE)
avgPitch=MovingAverage(AVG_WINDOW_SIZE)
with closing(sock):
sock.bind(("", PORT_CONST_HEAD_Action))
while True:
msg = sock.recv(bufsize)
#print("************************* Head:"+msg)
a=-math.radians(float(msg.split(",")[1]))
b=math.radians(float(msg.split(",")[0]))
a=clamp(a,-math.pi,math.pi)
b=clamp(b,-math.pi,math.pi)
# yaw=avgYaw.add(yaw)
# pitch=avgPitch.add(pitch)
# print(str(pitch) + " .. " + str(yaw))
motion.setAngles(["LShoulderRoll", "LShoulderPitch"], [a,b], 0.3)
示例3: ALProxy
# 需要导入模块: from naoqi import ALProxy [as 别名]
# 或者: from naoqi.ALProxy import getBodyNames [as 别名]
#-*- coding: utf-8 -*-
from naoqi import ALProxy
# ----------> Connect to robot <----------
robot_ip = "192.168.1.100"
robot_port = 9559 # default port : 9559
motionProxy = ALProxy("ALMotion", robot_ip, robot_port)
# Example showing how to get the limits for the whole body
name = "Body"
limits = motionProxy.getLimits(name)
jointNames = motionProxy.getBodyNames(name)
for i in range(0,len(limits)):
print jointNames[i] + ":"
print "minAngle", limits[i][0], "maxAngle", limits[i][1]
print "maxVelocity", limits[i][2], "maxTorque", limits[i][3]
示例4: ALProxy
# 需要导入模块: from naoqi import ALProxy [as 别名]
# 或者: from naoqi.ALProxy import getBodyNames [as 别名]
angles = []
port = 9559
for ip in IP:
motion_proxy = ALProxy('ALMotion',ip,port)
motion_proxy.setCollisionProtectionEnabled('Arms', True)
part = 'Body'
#time.sleep(1.0)
body_names = motion_proxy.getBodyNames(part)
body_limits = [motion_proxy.getLimits(l)[0] for l in body_names]
body_limits_angles = [ [l[0],l[1]] for l in body_limits]
motion_proxy.setStiffnesses(part,1.0)
for i in range(100):
target_angles = [ (angles[1]-angles[0])*random.random()+angles[0] for angles in body_limits_angles]
angles.append(target_angles)
fractionMaxSpeed = 0.8
motion_proxy.setAngles(body_names,target_angles,fractionMaxSpeed)
示例5: ALProxy
# 需要导入模块: from naoqi import ALProxy [as 别名]
# 或者: from naoqi.ALProxy import getBodyNames [as 别名]
port = 9559
count = 0
for ip in IP:
motion_proxy = ALProxy('ALMotion',ip,port)
motion_proxy.setCollisionProtectionEnabled('Arms', True)
part = 'Body'
crop = ['HipPitch','HipRoll','KneePitch']
time.sleep(1.0)
body_names = [p for p in motion_proxy.getBodyNames(part) if p not in crop]
body_limits = [motion_proxy.getLimits(l)[0] for l in body_names]
body_limits_angles = [ [l[0],l[1]] for l in body_limits]
motion_proxy.setStiffnesses(part,1.0)
for i in range(1):
#if count == 0:
target_angles = [ (angles[1]-angles[0])*random.choice([0,1])+angles[0] for angles in body_limits_angles]
#target_angles = [ (angles[1]-angles[0])*random.choice([0,1])+angles[0] for angles in body_limits_angles]
fractionMaxSpeed = 0.0033