当前位置: 首页>>代码示例>>Python>>正文


Python ALProxy.getBodyNames方法代码示例

本文整理汇总了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)
开发者ID:davidlavy88,项目名称:nao_and_opencv-python-,代码行数:15,代码来源:almotion_getBodyNames.py

示例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)
开发者ID:mrayy,项目名称:WASABI,代码行数:23,代码来源:armController.py

示例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]
开发者ID:axmtec0eric,项目名称:Nao-Robot,代码行数:19,代码来源:get_limits.py

示例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)
开发者ID:yasushisakai,项目名称:AHD-salt-examples,代码行数:32,代码来源:very_fast.py

示例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
开发者ID:yasushisakai,项目名称:AHD-salt-examples,代码行数:33,代码来源:random_move3.py


注:本文中的naoqi.ALProxy.getBodyNames方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。