当前位置: 首页 > 工具软件 > Pepper > 使用案例 >

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

翟迪
2023-12-01

环境不多说了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")

 类似资料: