• 大小: 1KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-04
  • 语言: Python
  • 标签: nao  

资源简介

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

评论

共有 条评论

相关资源