欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

NAO & Pepper 机器人 python 环境下开发笔记

程序员文章站 2022-07-12 23:49:45
...

环境不多说了Choregraph+Naoqi sdk for python

一些常用且重要的函数方法:

ALProxy is an object that gives you acces to all the methods or the module your are going to connect to.

class ALProxy(name, ip, port)
    name - The name of the module
    ip - The IP of your robot
    port - The port on which NAOqi listens (9559 by default)

To make NAO walk, you should use ALMotionProxy::moveInit (to put the robot in a correct position), and then ALMotionProxy::moveTo

from naoqi import ALProxy
motion = ALProxy("ALMotion", "nao.local", 9559)
motion.moveInit()
motion.moveTo(0.5, 0, 0)

This will let you make the robot do several things at the same time.

from naoqi import ALProxy
motion = ALProxy("ALMotion", "nao.local", 9559)
tts = ALProxy("ALTextToSpeech", "nao.local", 9559)
motion.moveInit()
motion.post.moveTo(0.5, 0, 0)
tts.say("I'm walking")