nao机器人学习笔记5

本文介绍了NAO机器人如何利用超声波进行避障,详细阐述了指令盒的初始化和自定义函数的使用。同时探讨了Walk Tracker的运行原理,通过C++编写module实现红球追踪,解析了相关API的功能和实验结果,揭示了NAO识别方向、行走距离和方位的能力。
摘要由CSDN通过智能技术生成

 1、行走时利用超声波进行避障

 

这些都是在choregraphe中完成的,怎样修改指令盒达到自己的要求:创建一个指令盒:

class MyClass(GeneratedClass):
    def __init__(self):
        GeneratedClass.__init__(self)

    def onLoad(self):
        #~ puts code for box initialization here
        pass

    def onUnload(self):
        #~ puts code for box cleanup here
        pass

    def onInput_onStart(self):
        self.myfun()
        self.onStopped() #~ activate output of the box
        pass

    def onInput_onStop(self):
        self.onUnload() #~ it is recommanded to call onUnload of this box in a onStop method, as the code written in onUnload is used to stop the box as well
        pass
    def myfun()
        self.logger.info("++++++++++++++++++++++++
评论 34
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值