使用遥控器控制NAO

时间:2014-02-13 15:44:58

标签: c# controls infrared nao-robot

我想使用C#控制带有遥控器的NAO机器人。 Aldebaran网站上的Python中只有一个例子。 不幸的是,我还没有学过Python。 任何人都可以帮助我将这个Python示例转换为C#吗? 以下链接可能对您有所帮助。 https://community.aldebaran-robotics.com/doc/1-14/naoqi/sensors/alinfrared-tuto.html#alinfrared-tuto https://community.aldebaran-robotics.com/doc/1-14/naoqi/sensors/alinfrared-api.html

# -*- encoding: UTF-8 -*-

"""
Receive and display remote buttons event:
"""
import naoqi
import time

# create python module
class myModule(naoqi.ALModule):

    def pythondatachanged(self, strVarName, value, strMessage):
        """callback when data change"""
        print "Data changed on", strVarName, ": ", value, " ", strMessage

# call method
try:
    lircProxy = naoqi.ALProxy("ALInfrared")
    lircProxy.initReception(repeatThreshold = 10)
    pythonModule = myModule("pythonModule")
    memProxy = naoqi.ALProxy("ALMemory")
    memProxy.subscribeToEvent("InfraRedRemoteKeyReceived", "pythonModule",
             "pythondatachanged")
except Exception, e:
    print "error"
    print e
    exit(1)
time.sleep(10)
exit(0)

0 个答案:

没有答案