資源簡介
nao機器人抓取程序,python的代碼程序親測可用, 謝謝支持。

代碼片段和文件信息
#?-*-?encoding:?UTF-8?-*-
‘‘‘Walk:?Small?example?to?make?Nao?walk‘‘‘
‘‘‘?This?example?is?only?compatible?with?NAO?‘‘‘
import?argparse
import?motion
import?time
import?almath
from?naoqi?import?ALProxy
def?footmove(motionProxy):
????x?=?1.0
????y?=?1.0
????theta?=?0.0
????frequency?=?0.5
????motionProxy.moveToward(x?y?theta?[[“Frequency“?frequency]])
????#?Lets?make?him?stop?after?3?seconds
????motionProxy.stopMove()
def?userArmArticular1(motionProxy):
????#?Arms?motion?from?user?have?always?the?priority?than?walk?arms?motion
????JointNames?=?[“LShoulderPitch“?“LShoulderRoll“?“LElbowYaw“?“LElbowRoll““LWristYaw““LHand“]
????Arm1?=?[76.535.0-63.5-59.6-39.30]
????Arm1?=?[?x?*?motion.TO_RAD?for?x?in?Arm1]
????pFractionMaxSpeed?=?0.1
????motionProxy.angleInterpolationWithSpeed(JointNames?Arm1?pFractionMaxSpeed)
def?userArmArticular2(motionProxy):
????#?Arms?motion?from?user?have?always?the?priority?than?walk?arms?motion
????JointNames?=?[“LShoulderPitch“?“LShoulderRoll“?“LElbowYaw“?“LElbowRoll““LWristYaw““LHand“]
????Arm2?=?[70.525.0-63.5-59.6-39.31]
????Arm2?=?[x?*?motion.TO_RAD?for?x?in?Arm2]
????pFractionMaxSpeed?=?0.1
????motionProxy.angleInterpolationWithSpeed(JointNames?Arm2?pFractionMaxSpeed)
def?userArmArticular3(motionProxy):
????#?Arms?motion?from?user?have?always?the?priority?than?walk?arms?motion
????JointNames?=?[“LShoulderPitch“?“LShoulderRoll“?“LElbowYaw“?“LElbowRoll“?“LWristYaw“?“LHand“]
????Arm3?=?[67.8?19?-62.8?-58.6?-24?1]
????Arm3?=?[x?*?motion.TO_RAD?for?x?in?Arm3]
????pFractionMaxSpeed?=?0.1
????motionProxy.angleInterpolationWithSpeed(JointNames?Arm3?pFractionMaxSpeed)
def?userArmArticular4(motionProxy):
????#?Arms?motion?from?user?have?always?the?priority?than?walk?arms?motion
????JointNames?=?[“LShoulderPitch“?“LShoulderRoll“?“LElbowYaw“?“LElbowRoll““LWristYaw““LHand“]
????Arm3?=?[67.24.9-57.8-58.6-241]
????Arm3?=?[x?*?motion.TO_RAD?for?x?in?Arm3]
????pFractionMaxSpeed?=?0.1
????motionProxy.angleInterpolationWithSpeed(JointNames?Arm3?pFractionMaxSpeed)
def?main(robotIP?PORT=9559):
????motionProxy??=?ALProxy(“ALMotion““127.0.0.1“2948)
????postureProxy?=?ALProxy(“ALRobotPosture““127.0.0.1“2948)
????#?Wake?up?robot
????motionProxy.wakeUp()
????#?Send?robot?to?Stand
????postureProxy.goToPosture(“StandInit“?0.5)
????#####################
????##?Enable?arms?control?by?Motion?algorithm
????#####################
????motionProxy.setMoveArmsEnabled(True?True)
????#?motionProxy.setMoveArmsEnabled(False?False)
????footmove(motionProxy)
????time.sleep(3.0)
????#####################
????##?FOOT?CONTACT?PROTECTION
????#####################
????#motionProxy.setMotionConfig([[“ENABLE_FOOT_CONTACT_PROTECTION“?False]])
????userArmArticular1(motionProxy)
????time.sleep(1.0)
????userArmArticular2(motionProxy)
????time.sleep(1.0)
????motionProxy.openHand(‘LHand‘)
????motionP
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????3692??2018-12-18?18:19??nao機器人抓取程序.py
?????文件?????????167??2018-12-18?18:19??README.md
評論
共有 條評論