AIBO Tutorial.ppt

上传人:lawfemale396 文档编号:378148 上传时间:2018-10-09 格式:PPT 页数:20 大小:68.50KB
下载 相关 举报
AIBO Tutorial.ppt_第1页
第1页 / 共20页
AIBO Tutorial.ppt_第2页
第2页 / 共20页
AIBO Tutorial.ppt_第3页
第3页 / 共20页
AIBO Tutorial.ppt_第4页
第4页 / 共20页
AIBO Tutorial.ppt_第5页
第5页 / 共20页
亲,该文档总共20页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

1、AIBO Tutorial,CS 4631 Spring 2004Ram Ravichandran,Outline,IntroductionBasic OPENR Program ConstructsCode DevelopmentExecuting and DebuggingFlow of DevelopmentParting advice,Introduction,EnvironmentCode developed using C+, OPENR APIInstalled under /usr/OPENR_SDKavailable from Documentation (availabl

2、e under /usr/OPENR_SDK/documentation )AIBO Programming manualERS-210 InformationAPI Specifications (Level II reference Guide),Introduction,Sample ProgramsBest way to learn writing codeAll sample programs are available under /usr/OPENR_SDK/sample Copy to your home directory and change permissions.run

3、 using make PREFIX=/usr/OPENR_SDK,OPENR Objects,True OO (very similar to Squeak/SmallTalk)Similar to a UNIX processCommunication through message passing.Object waits for message selector,data to arrive.Once a message arrives, objects call the method based on the selector specified in stub.cfg.Argume

4、nts to the method is the data in the messageWait for more messages.,Inter-object communication,Brief overviewSubjectObject that sends a messageObserverObject that receives the messageEvery observer has a message queue.Subject sends Observer a NotifyEvent. Observer replies with a ReadyEventASSERT_REA

5、DYDEASSERT_READY,Core Class,Each Object has a Core ClassA Sample Core Class#include #include #include #include “def.h“class SampleClass : public OObject public: SampleClass(); virtual SampleClass() OSubject* subjectnumOfSubject; OObserver* observernumOfObserver;,Core Class (2),Continued virtual OSta

6、tus DoInit(const OSystemEvent,Inter-object Communication,Control MethodUsed by the Subject to receive a connection resultConnect MethodUsed by observer to receive a connection resultNotify MethodUsed by Observer to receive a messageReady MethodUsed by Subject to receive the ASSERT_READY and DEASSERT

7、_READY signals from Observer.,DoXXXX() Method Macros,DoInitNEW_ALL_SUBJECT_AND_OBSERVERRegisters the necessary number of Subjects & Observers.REGISTER_ALL_ENTRYregisters the connection to services offered by other objects SET_ALL_READY_AND_NOTIFY_ENTRYThis registers all entry points. DoStartENABLE_A

8、LL_SUBJECT Enables all the SubjectsASSERT_READY_TO_ALL_OBSERVERThis sends ASSERT_READY to all subjects.,DoXXXX() Method Macros (2),DoStop()DISABLE_ALL_SUBJECT This disables all subjects of core class.DEASSERT_READY_TO_ALL_OBSERVER This sends a DEASSERT_READY to all connecting subjects. DoDestroy()DE

9、LETE_ALL_SUBJECT_AND_OBSERVER This deletes all observer and subjects.,More Message Passing,Observer first sends all its subjects an AssertReady void SampleObserver:SendAssertReady() observerobsfunc1-AssertReady( ); When Subject receives AssertReady, it sends the data. void SampleSubject:Ready(const

10、OReadyEvent ,More Message Passing (2),When observer receives the data, it sends an ASSERT_READY again void SampleObserver:Notify(const ONotifyEvent ,Stub File,Used to define member functions that receive messagesA sample Stub File (stub.cfg)ObjectName : SampleClass NumOfOSubject : 1 NumOfOObserver :

11、 2 Service : “SampleClass.Func1.Data1.S”,Control(),Ready() Service : “SampleClass.Func2.Data2.O”,Connect(),Notify1() Service : “SampleClass.Func3.Data2.O”,Control(),Notify2() Extra : WakeUpOnLan() Extra : UpdateBatteryStatus(),Building,Make a Directory (lets call it Output) in the parent directory o

12、f the directory where you have the source files. We will put the final output executables in this directory. Copy the directory OPEN-R from /usr/OPENR_SDK/MS into Output. Copy Makefile-parent from /usr/OPENR_SDK/MS to /Makefile Copy Makefile-child from /usr/OPENR_SDK/MS to /Makefile Edit both makefi

13、les. type make;make install in the parent directory.,Building (2),A picture is worth a thousand words,Editing Configuration Files.,.ocf file Has one line in it of the following format. object NAME STACK_SIZE HEAP_SIZE SCHED_PRIORITY cache tlb user connect.cfg fileThis file is in /MS/OPEN-R/MW/CONFDi

14、ctates who talks to who using what services (registered in stub.cfg)Contains lines similar to : object1.sendStream.datatype1.S object2.recvStream.dataType1.O object.cfg filecontains a list of .bin files (objects)add the objects you have compiled do not erase tinyftpd.bin and powermon.bin,Executing a

15、nd Debugging,Insert the memory stick in the laptop. At the prompt, typemount /sony Once the memory stick has been mounted, then copy the files from /MS/OPEN_R to /sonycp rf /MS/OPEN_R /sony un-mount the memory stick.umount /sony Put the memory stick in the dog and press the power button on the dog.D

16、EBUGGINGFor debugging information see chapter 5 in the programmers manual. The explanation in the chapter is very clear and extensive.,Flow of Development,Design your objects Decide on the data type for the inter-object communication Write the stub.cfg file Write the core class with the necessary me

17、mber functions Write connect.cfg file Write your .ocf file Build Write object.cfg file Execute on AIBO Debug (perhaps),Parting Advice,See sample programs Do NOT let the AIBO walk on hard surfaces. This will break the joints. Use the robocup field or a similar carpet like surface. Do NOT use joint va

18、lues greater than the ones in the manual. The software does not impose a limit on the joint angles. Thus you can BREAK the joints by putting in arbitrary values. You will PAY for any broken part. This tutorial is available online (by tonight) at http:/www.cc.gatech.edu/borg/robotsoccer/aibotut.html Programming the dogs for the first time can be frustrating. Do not hesitate to use the mailing list to ask questions.,

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 教学课件 > 大学教育

copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1