Home
project report
Contents
1. to read devices seen earlier this method makes all Devices write to the corresponding robot device thus making the robot move among other actions 1 The deviceController tells each Device to write the value of its buffer to the associated robot de vice 2 0 DEPENDENCY MODEL 19 2 6 Dependency model The diagram of Figure 2 9 shows dependency relationships and navigable associations between system objects as deduced from the interaction model They will be integrated into the design class model The collection controllers are now separate classes call Figure 2 9 Dependency diagram This diagram shows the various dependencies between system classes Dashed lines repre sent usage dependencies plain lines represent navigable associa tions Arrows show the direction of the relationships Association ends are marked with role names and cardinalities Here we can see the collection controllers appearing clearly as separate classes 2 7 Inheritance model The inheritance structure of class Device is shown on Figure 2 10 page 20 These subclasses have not changed since they were presented in the concept model section 2 3 This tree will be integrated into the design class model as well Figure 2 11 is not part of the design process but hints at how a user should implement his own dynamical systems I recommend making a subclass of DynamicalSystem and overriding the derivate method As an example yo
2. velocity max float velocity init float acceleration current float acceleration min float acceleration max float acceleration init float read_position double read velocity double tread acceleration double twrite position in value doubl twrite velocity in value doubl twrite acceleration in value double enable_motor disable_motor Figure 2 20 Class Servo Method interface Servo implements all methods of the Device class Generic methods like read and write affect the position of the servo and not other parameters such as velocity or acceleration double read_position Read the value of the device s position Returns a double in 1 1 double read_velocity Read the value of the device s velocity Returns a double in 1 1 double read_acceleration Read the value of the device s acceleration Returns a double in 1 1 void write_position double new_value Sets the position of the device Values out of 1 1 are truncated to 1 or 1 void write_velocity double new_value Sets the velocity of the device Values out of 1 1 are truncated to 1 or 1 2 9 IMPLEMENTATION CLASS MODEL 33 void write acceleration double new value Sets the acceleration of the device Values out of 1 1 are truncated to 1 or 1 void enable motor Enables the servo s motor void disable motor Disables the servo s motor 2 9 9 Class RotationServo Ro
3. EU WE COLE POLYTECHNIQUE BIOLOGICALLY INSPIRED FEDERALE DE LAUSANNE ROBOTICS GROUP BIRG Ordinary Differential Equations Framework for the Robotic Dog AIBO Etienne Dysli 14th February 2005 Semester project winter 2004 2005 Supervisors Jonas Buchli amp Prof Auke Jan Ijspeert ii Summary This document is a semester project report It presents the work done to develop a software framework to control an AIBO robot with a set of ordinary differential equations The first chapter explores the ideas and the tools which gave birth to this project Project goals are also defined The second chapter describes the software engineering process that was used throughout the project This process follows the guidelines of the Fondue method This chapter also serves as developer documentation for future refactoring of the software The third chapter presents an example dynamical system which was used to test and demonstrate the software Simulation and real world results are shown and discussed Chapter four draws a conclusion of this project and looks at future improvements Finally two appendices are provided to bootstrap the new user into using the resulting work of this project Copyright information About this document Copyright 2005 Etienne Dysli Permission is granted to copy distribute and or modify this document under the terms of the GNU Free Documentation License Version 1 2 or any later version published
4. write dynamicalSystemController DynamicalSystem 3 1 derivate 3 solve 2 get time 1 read from devices mydevices Device theclock TimeKeeper DynamicalSystem 1 1 read mydevices Device Figure 2 7 Collaboration diagram for update systems 1 The dynamicalSystemController first tells all DynamicalSys tems to read from their associated Devices 1 1 DynamicalSys tems call read on the Devices they are configured to read and store the returned values in their state variables 2 The dy namicalSystemController then consults the TimeKeeper in order to know the current time 3 This time is used among other parameters detailed later in section 2 9 7 to ask the Numerical Solver to solve the differential system 3 1 The solver calls back derivate of the dynamicalSystemController to obtain the values of the derivatives at the given time 3 2 The dynamicalSys temController propagates this call to each DynamicalSystem 4 Finally the dynamicalSystemController tells each DynamicalSys tem to write to their associated Devices 4 1 DynamicalSystems call write on the Devices they are configured to write to with the new values of their variables mysolver NumericalSolver 18 CHAPTER 2 SOFTWARE ARCHITECTURE write devices deviceController Device 1 writeback buffer Figure 2 8 Collaboration diagram for write devices Sim
5. A Transparent copy of the Document means a machine readable copy represented in a format whose specification is available to the general public that is suitable for revising the document straightforwardly with generic text editors or for images composed of pixels generic paint programs or for drawings some widely available drawing editor and that is suitable for input D 2 VERBATIM COPYING 59 to text formatters or for automatic translation to a variety of formats suitable for input to text formatters A copy made in an otherwise Transparent file format whose markup or absence of markup has been arranged to thwart or discourage subsequent modification by readers is not Transparent An image format is not Transparent if used for any substantial amount of text copy that is not Iransparent is called Opaque Examples of suitable formats for Transparent copies include plain ASCII without markup Texinfo input format LaTeX input format SGML or XML using a publicly available DTD and standard conforming simple HTML PostScript or PDF designed for human modification Examples of trans parent image formats include PNG XCF and JPG Opaque formats include proprietary formats that can be read and edited only by proprietary word processors SGML or XML for which the DTD and or processing tools are not generally available and the machine generated HTML PostScript or PDF produced by some word processors for output purposes only The Titl
6. For example if a patent license would not permit royalty free redistribution of the Program by all those who re ceive copies directly or indirectly through you then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program If any portion of this section is held invalid or unenforceable under any particular circumstance the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances 72 10 APPENDIX E GNU GENERAL PUBLIC LICENSE It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices Many people have made generous contributions to the wide range of software distributed through that system in reliance on consis tent application of that system it is up to the author donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License If the distribution and or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces the original copyright holder who place
7. bool get_output_variable_state size_t index Tells whether a variable is selected for data output Returns true if the variable designated by index is to be logged Returns false otherwise or if index is out of bounds i e greater than the number of variables minus one char get_variable_name size_t index Gives the name of the variable designated by index Returns a string if the name exists or a null pointer otherwise How to make your own dynamical systems First create a subclass of DynamicalSystem which overrides method derivate Inside this method you can implement your own equations You have get_DS_by_index and get_DS_ by_name from the DynamicalSystemController at your disposal to find other systems and get_variable to read their variables Please refrain from doing anything else than reading to other DynamicalSystems otherwise they will certainly start to behave in an unexpected manner Likewise you can connect your systems with I O devices by setting the two boolean arrays variable to device mapping and device_to_variable_map ping at instantiation variable to device mapping is first indexed by variable number and then by device number Meaning that if the element vari able to device mapping x y is true variable number z will get written to device number y after the system has been solved device to variable map ping is the reverse it is indexed first by device number and then by variable number Meaning that if the e
8. newlib source e build devtools 3 3 2 r1 sh installation script in your home directory 2 Unpack the OPEN R SDK e cd e tar xzf OPEN R SDK 1 1 5 r3 tar gz AT 48 APPENDIX A WEBOTS amp OPEN R QUICKSTART This will create a new directory OPEN R SDK in your home directory 3 Unpack the sample programs and documentation e cd OPEN R SDK e tar xzf OPEN_R_SDK sample 1 1 5 r2 tar gz e tar xzf OPEN_R_SDK docE 1 1 5 ri tar gz e cd 4 Edit the script build devtools 3 3 2 r1 sh to suit the installation directory to your needs The default is PREFIX usr local OPEN_R_ SDK Since this guide is intended for normal i e non administrative users the following value will be used PREFIX home username OPEN R SDK Replace username with your actual username 5 Execute the build devtools 3 3 2 r1 sh script It will unpack and compile binutils gcc and newlib for the AIBO platform This will take some time Depending on the speed of your machine you might want to have a drink while it is compiling A 2 Webots installation It is assumed that Webots is already installed on your system in usr local webots If that is not the case head to http www cyberbotics com products webots download html and download the latest version of We bots suitable for your system or kindly ask your system administrator to install it for you Don t forget to replace usr local webots with the ac tual location of your Webots i
9. AIBO lies on a box high enough to allow its legs to move freely without touching the ground or other objects Figure 3 1 Experiment setup in simulation This screen shot from Webots shows the AIBO laid on a purple rectangular box Such a setup allows its legs to move freely without touching the ground or other objects 3 2 RESULTS 39 Figure 3 2 Experiment setup in reality This photos shows the AIBO laid on a white cardboard box Such a setup allows its legs to move freely without touching the ground or other objects 3 2 Results Here are the results I obtained while running Aib O Matic on a simulated AIBO and on a real one Movies on the project web page 18 allow you to visualize these experiments 3 2 1 Simulation Webots does not yet allow the user to move parts of a robot as opposed to the robot as a whole Therefore one cannot move AIBO s right leg by hand To work around this limitation I made the leg move with a sinusoidal oscillation of frequency close to 27 This movement was implement in the robot run controller loop in order to be outside of Aib O Matic Simulation in Webots worked pretty well apart from the robot sliding on its supporting box after around thirty seconds causing its legs to rub against the side of the box and disturbing measurements Below are two graphs of the data output by Aib O Matic They show the positions of both front legs plotted against time during the first twenty seconds of simulat
10. Approaches to Advanced Information Technology First Inter national Workshop BioADIT 2004 volume 3141 of Lecture Notes in Computer Science pages 333 349 Springer Verlag Berlin Heidelberg 2004 Lukas Hohl Wireless remote control and monitoring of an AIBO robot Semester project Ecole Polytechnique F d rale de Lausanne EPFL 2003 Lukas Hohl AIBO simulation in webots and controller transfer to AIBO robot Semester project Ecole Polytechnique F d rale de Lausanne EPFL 2004 Mathieu Salzmann Development of quadruped locomotion controllers based on nonlinear oscillators Semester project Ecole Polytechnique F d rale de Lausanne EPFL 2003 Bertrand Mesot Self organisation of locomotion in modular robots Diploma project Ecole Polytechnique F d rale de Lausanne EPFL 2003 The Fondue Method website http lgl epfl ch research fondue index html 9 Alfred Strohmeier The Fondue Method 2003 45 46 10 11 12 18 14 15 16 17 18 19 BIBLIOGRAPHY Alfred Strohmeier and Shane Sendall Operation schemas and ocl Tech nical Report DI 01 358 Ecole Polytechnique F d rale de Lausanne EPFL 2001 Cyberbotics Ltd Webots Reference Manual 2004 Sony Corporation OPEN R SDK Model Information for ERS 210 2004 Erich Gamma Richard Helm Ralph Johnson and John Vlissides De sign Patterns Elements of Reusable Object Oriented Software Addison Wesley Prof
11. Class DynamicalSystemController 25 vi CONTENTS 2 9 5 Class DynamicalSystem s ru laor ems 26 2 0 0 Class Logger is a eg Me de ense d per ob m peg V dese 29 2 9 7 Class NumericalSolver 30 2 9 8 Class Servo 31 2 9 9 Class RotationServo aoaaa a 33 29 10 Class Plunger S e ed ede ea EROS 33 tds Sea mee CP Ses 33 2 9 12 Class TouchSensor 33 2 9 13 Class DistanceSensor up Ole be a 34 20 14 GSS Gamera i aeuum a E Ae A Eb RE a 34 2 9 15 56 aes 34 2 10 Implementation quirks 35 Known bugs e al A g a doge 36 3 Testing and results 37 3 1 Experiment setup oaaao 37 p Res lts RO eh e dA he dme o d ees 39 ST 39 322i Reality ue ver d dob b ep E ped a 40 3 9 DISCUSSIONS b ACE EAD b tum tust ie bikes 41 4 Conclusions 43 Vp conclusio totes Pace aie ih Sy ek BB go exei 43 42 Future Work ei ah e inta at eu A eee a ae Se ea S 43 Bibliography 46 A Webots amp OPEN R Quickstart 47 A 1 OPEN R installation 47 A 2 Webots installation 48 Remote Control System installation 4 48 A 3 1 Create your own Webots directory 48 A 3 2 Extract the world file 4 42x wore ede eda 49
12. Document are re 60 APPENDIX D GNU FREE DOCUMENTATION LICENSE produced in all copies and that you add no other conditions whatsoever to those of this License You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute However you may accept compensation in exchange for copies If you dis tribute a large enough number of copies you must also follow the conditions in section 3 You may also lend copies under the same conditions stated above and you may publicly display copies D 3 Copying in quantity If you publish printed copies or copies in media that commonly have printed covers of the Document numbering more than 100 and the Document s license notice requires Cover Texts you must enclose the copies in covers that carry clearly and legibly all these Cover Texts Front Cover Texts on the front cover and Back Cover Texts on the back cover Both covers must also clearly and legibly identify you as the publisher of these copies The front cover must present the full title with all words of the title equally prominent and visible You may add other material on the covers in addition Copying with changes limited to the covers as long as they preserve the title of the Document and satisfy these conditions can be treated as verbatim copying in other respects If the required texts for either cover are too voluminous to fit legibly you should put the first ones list
13. Each licensee is addressed as you Activities other than copying distribution and modification are not covered by this License they are outside its scope The act of running the Program is not restricted and the output from the Program is covered only if its contents constitute a work based on the Program independent of having been made by running the Program Whether that is true depends on what the Program does 1 You may copy and distribute verbatim copies of the Program s source 69 code as you receive it in any medium provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty keep intact all the notices that refer to this License and to the absence of any warranty and give any other recipients of the Program a copy of this License along with the Program You may charge a fee for the physical act of transferring a copy and you may at your option offer warranty protection in exchange for a fee You may modify your copy or copies of the Program or any portion of it thus forming a work based on the Program and copy and distribute such modifications or work under the terms of Section 1 above provided that you also meet all of these conditions a You must cause the modified files to carry prominent notices stat ing that you changed the files and the date of any change b You must cause any work that you distribute or publish that in whole or
14. a cardboard box to allow its legs to move freely But this time things went bad The legs movement was erratic and jerky at best No synchronization could be really observed Moreover no data could be salvaged from AIBO s Memory Stick to explain 3 3 DISCUSSION Al ACPO output and perturbation input compared k 2 1 5 T 7 E y D ACPO output perturbation input iL 4 o 0 5 7 o OF 4 o E lt 5r 1E H 1 5 0 5 10 15 20 Time s Figure 3 4 ACPO and perturbation with coupling This graph plots the ACPO output left leg s position and the per turbation input right leg s position against time Here one can observe a short transition period between 0 3 seconds before the oscillator synchronizes on the perturbation This synchronization is persistent The best synchronization has been observed with k 2 this phenomenon because the data file remained mysteriously empty Please refer to the movies on the project web page 18 to see what happened 3 3 Discussion It turns out that simulation and real world results are radically different This differenc
15. an item stating at least the title year new authors and publisher of the Modified Version as given on the Title Page If there is no section Entitled History in the Document create one stating the title year authors and publisher of the Document as given on its Title Page then add an item describing the Modified Version as stated in the previous sentence 62 APPENDIX D GNU FREE DOCUMENTATION LICENSE J Preserve the network location if any given in the Document for public access to a Transparent copy of the Document and likewise the network locations given in the Document for previous versions it was based on These may be placed in the History section You may omit a network location for a work that was published at least four years before the Document itself or if the original publisher of the version it refers to gives permission K For any section Entitled Acknowledgements or Dedications Preserve the Title of the section and preserve in the section all the substance and tone of each of the contributor acknowledgements and or dedications given therein L Preserve all the Invariant Sections of the Document unaltered in their text and in their titles Section numbers or the equivalent are not con sidered part of the section titles M Delete any section Entitled Endorsements Such a section may not be included in the Modified Version N Do not retitle any existing section to be Entitled Endor
16. and learning capabilities 2 CHAPTER 1 INTRODUCTION A sympathetic yet powerful dog The robotic dog AIBO is made by Sony It is marketed both as an enter tainment system and as a research platform AIBO features plenty of sensors color camera infrared distance sensor chin back and paw touch sensors and actuators LEDs and head leg ear and tails joints Sony provides a free development kit the OPEN R SDK based on the GNU Compiler Col lection gcc to write software for the AIBO OPEN R allows cross compiling programs on a PC to run them on the AIBO Simulators are helpful to try new software without taking the risk of breaking real robots Simulation is also faster than real world experiments Webots a commercial mobile robot simulation software developed by Cy berbotics Ltd 1 includes support for the AIBO It features an AIBO model and a graphical user interface to observe and control the robot s parameters both in simulation and on the real AIBO via a wireless link One can also transfer programs from the PC to AIBO s memory with a single click 1 2 Related work Previous work in the field of biologically inspired robotics contribute to the initial spark of this project Central pattern generators and quadrupedal locomotion In their article Hard wired central pattern generators for quadrupedal locomotion 2 Collins and Richmond set the grounds of central pattern generators CPG used to control the locomotion
17. by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version D 5 Combining documents You may combine the Document with other documents released under this License under the terms defined in section 4 above for modified versions provided that you include in the combination all of the Invariant Sections of all of the original documents unmodified and list them all as Invariant Sections of your combined work in its license notice and that you preserve all their Warranty Disclaimers The combined work need only contain one copy of this License and mul tiple identical Invariant Sections may be replaced with a single copy If there are multiple Invariant Sections with the same name but different contents make the title of each such section unique by adding at the end of it in parentheses the name of the original author or publisher of that section if known or else a unique number Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work In the combination you must combine any sections Entitled History in the various original documents forming one section Entitled History likewise combine any sections Entitled Acknowledgements and any sections Entitled Dedications You must delete all sections Entitled Endorsements D 6 Collections of documents You may make a collection co
18. diagram for update systems 17 Collaboration diagram for write devices 18 Dependency diagram 19 Inheritance diagram for Device 20 Inheritance diagram for DynamicalSystem 20 Design class diagram 21 Class Timekeepers rae RU ERE 22 Class DeviceController 8 5 23 Class Device cR Lum 24 Class DynamicalSystemController m CS mS en 25 Class DynamicalSystem agr ERASE 27 Class LOGGER a ree D orb pad BE hy 29 Class NumericalSolver 2 31 Glass Serto ad Bot ice es dno de e dne Oe en ed 32 Class RotationServo xu de TRIES WSR Erg eds eg eds 33 Class teta 2 ose code og Oum RO SE COR eto 33 Glass Sensor fake up ad Ub ad pee Eu et 34 Class TouchSensor 34 Class 2 34 Classi Gamera ns t ied voe xe vr sheer eae Rp Sela 35 dits OE NIE 35 Experiment setup in simulation 38 Experiment setup in reality 39 ACPO and perturbation without coupling 40 LIST OF FIGURES 3 4 ACPO and perturbation with coupling 41 Chapter 1 Introduction In this chapter we briefly explore the ideas and the tools which gave birth to this project Project goals are also defined here 1
19. dimension size t in time double in data double in mask bool solve in x double inout dx double in dimension size t in t double in h double out output x double in output interval int in output variables bool Figure 2 19 Class NumericalSolver Method interface void solve Arguments are double amp x Reference to Z double amp dx Reference to 2 size_t amp dimension Dimension of the system const double t Value of t i e time const double h Runge Kutta interval double amp output x Output of after computation int amp output interval Log data each output interval calls to solve The time between two output lines is h output interval bool amp output variables Selects which variables to log Solves an ODE system with the fourth order Runge Kutta method This is a straightforward implementation quite simple but precise enough 2 9 8 Class Servo This class represents the servo motors of the AIBO Servo instances are created disabled but their motor is enabled This prevents the AIBO from falling right after the program is loaded Indeed the legs would not be able to bear the robot s weight without active servos Units are supposed to be meters m s and m s that is standard SI units 32 CHAPTER 2 SOFTWARE ARCHITECTURE position current float position min float position max float position init float velocity current float velocity min float
20. in part contains or is derived from the Program or any part thereof to be licensed as a whole at no charge to all third parties under the terms of this License c If the modified program normally reads commands interactively when run you must cause it when started running for such in teractive use in the most ordinary way to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty or else saying that you provide a warranty and that users may redistribute the program under these conditions and telling the user how to view a copy of this License Exception if the Program itself is interactive but does not normally print such an announcement your work based on the Program is not required to print an announcement These requirements apply to the modified work as a whole If iden tifiable sections of that work are not derived from the Program and can be reasonably considered independent and separate works in them selves then this License and its terms do not apply to those sections when you distribute them as separate works But when you distribute the same sections as part of a whole which is a work based on the Program the distribution of the whole must be on the terms of this Li cense whose permissions for other licensees extend to the entire whole and thus to each and every part regardless of who wrote it Thus it is not the intent of this section to claim rights or
21. it employs the NumericalSolver class to solve it s equa tions The Logger class has no associations leading to it because it enjoys system wide visibility It s purpose is to provide a facility to log error or information messages and to output system data for external use 2 8 CONCEPT MODEL 11 lt lt system gt gt Aib O Matic 1 TimeKeeper CRECIUZE M systems theclock DynamicalSystem UE systems 1 name string lt updates buffers variables real parameters real nycontroller variable_names string Q M reads amp writes output variables boolean mysystems 1 nydevices name string tag DeviceTag reads gt enabled boolean buffer real 7 _ 1 mysolver Logger NumericalSolver 7 Camera Sensor N position current real position min const real position max const real position init const real velocity current real velocity min const real TouchSensor DistanceSensor velocity max const real velocity init const real acceleration current real acceleration min const real acceleration max const real acceleration init const real force current real RotationServo Figure 2 3 Concept diagram Complete concept model in cluding inheritance relationships The upper half of this figure is the same as Figure 2 2 The lower half shows the subclass tree of Device as it is planned at this stage of the process These classes Camera TouchSensor Distan
22. object code or executable form with such an offer in accord with Subsection b above The source code for a work means the preferred form of the work for making modifications to it For an executable work complete source code means all the source code for all modules it contains plus any as sociated interface definition files plus the scripts used to control com pilation and installation of the executable However as a special ex ception the source code distributed need not include anything that is normally distributed in either source or binary form with the major components compiler kernel and so on of the operating system on which the executable runs unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated place then offering equivalent access to copy the source code from the same place counts as distribution of the source 71 code even though third parties are not compelled to copy the source along with the object code You may not copy modify sublicense or distribute the Program ex cept as expressly provided under this License Any attempt otherwise to copy modify sublicense or distribute the Program is void and will automatically terminate your rights under this License However par ties who have received copies or rights from you under this License will not have their licenses terminated so long as such partie
23. of quadrupeds Jonas Buchli and Auke Jan Ijspeert further extend the topic to differential systems in 3 A system made of amplitude controlled phase oscillators ACPO will be implemented to test and demonstrate the final program Aibo simulation and transfer to real robot First and foremost the two semester projects made by Lukas Hohl during the previous year provide the toolbox needed to develop control software for the AIBO In 4 he presents the Remote Control System which allows monitoring and controlling an AIBO robot from a PC over a wireless connection Then he integrated this software into Webots allowing the same monitoring to be performed both on a simulated and a real AIBO Moreover in 5 he added the cross compiling function of OPEN R to the graphical interface of Webots This greatly helps the development of AIBO control software as one is now able to write a single 1 8 GOALS 3 program which runs both in Webots and on the real AIBO using the Webots Controller API Quadruped locomotion controllers based on non linear oscillators Mathieu Salzmann explored controllers based on non linear oscillators to gen erate different gaits in quadruped locomotion In 6 he shows how to have transitions between the different gaits by changing only one parameter in the differential equations of the controllers He used a simulated AIBO in Webots in his experiments His work shows that it is possible to implement natural movements e g
24. suit your installation That is WEBOTS_HOME should be set to home username my webots and OPENRSDK_ROOT should be set to home username OPEN R SDK Be sure to replace username with your actual username Run make install to build the Remote Control System cd my_webots transfer openr remotecontrol Controller Controller cp v my webots src lib openr remotecontrol Controller Controller controller cp v my webots src lib openr remotecontrol Controller Controller Controller o cp v my webots src lib openr remotecontrol Controller Controller MTN o Modify the value of WEBOTS HOME in my webots transfer openr remotecontrol Controller Controller Makefile to home username my webots always replacing username with your actual username Extract files for ERS 210 cd my webots controllers tar xzf ers210 tgz cd my_webots controllers ers210 Modify the value of HOME in my webots controllers ers210 Makefile openr to home username my webots always replacing user name with your actual username Link to Webots installation cd my webots ln s usr local webots include ln s usr local webots lib A 4 AIB O MATIC INSTALLATION 51 A 4 Aib O Matic installation e cd my webots controllers ers210 e Extract Aib O Matic sources be aware that this will overwrite the Makefile sources and Makefile files tar xvzf aibomatic src tar gz e Build the controlle
25. support hints and overall great help Special thanks to Alessandro Crespi for software installations and backup restores Final thanks go to Lukas Hohl and Olivier Michel for their help with Webots iv Contents List of Figures x 1 Introduction 1 Li GIVEN OM a xu eum dh Tx a eh uei 1 1 2 R latedwork mous ded dca x CAR RATE 2 129 eae See ei o Ret Imo mes 3 FAS ewe EE So ance ee ne UA ERN oes 3 2 Software architecture 5 21 The Fondue method 5 2 1 1 Requirements 6 6 2 Desin T 2 1 4 Implementation 2 2 ote e LA E edes T 2 2 Environment 1 7 2 3 Concept model 8 2 3 1 Description of analysis classes 8 2A Behavior model m oH me ee SG eee EA 12 2 4 1 Operation model 12 2 4 2 Protocol model 12 2 9 teraction modal ue a ree des pu qne iD Rn EXIRET dete MUS 12 2 5 1 System operations 13 2 13 2 6 Dependency model 19 2 JIuherntanceinodeb Reate TREE eve rn 19 2 8 Design class model 21 2 9 Implementation class model 21 2 9 1 Class TimeKeeper anke RARE CS ee Be RO 22 2 9 2 Glass DeviceController 3 era dn aee nere me ed 22 2 0 9 Glass ime ura ete Do ee ER TE ERE eR 29 2 9 4
26. the method 5 6 CHAPTER 2 SOFTWARE ARCHITECTURE 2 1 1 Requirements The requirements phase produces two models use cases and the domain model out of a textual or oral description of the software A use case de scribes possible situations that can arise when a user has a particular goal against the system It is an informal mainly textual goal based description which captures the behavioral requirements of the software system The do main model captures the concepts in the domain of the problem and the relationships between them It uses a class diagram notation I have skipped this phase in my project because my system is not an interactive one in the sense that its actions are not triggered by an input from a human user Of course the AIBO robot has be able to react to sensory perception such as the activation of a paw touch sensor which might be triggered by human intervention but there is no real user interface to a human user Classifying my system as non reactive makes it degenerated from the point of view of Fondue Some models loose their raison d tre because they are intended to describe user system interaction or depend on user input The only user intervention at run time is switching on the robot or launch ing a simulation in Webots Then all inputs happen through the robot s de vices There would be only a single use case boiling down to switch robot on Therefore use cases are not needed The domain mode
27. this issue and offer camera support in Aib O Matic 2 9 15 Class LED Class LED inherits from Device and has the same method interface 4See 5 section 3 5 page 30 2 10 IMPLEMENTATION QUIRKS 35 Camera Figure 2 26 Class Camera LED O Figure 2 27 Class LED 2 10 Implementation quirks This section while not being part of the Fondue process is nonetheless useful It makes an inventory of the peculiarities of the current implementation of Aib O Matic This information might be of some value to future developers as well as users Source files Every class has been put into two separate source files A header file Class hh which contains the class definition and a source file Class cc which contains its implementation Of the various time steps The various time steps simulation step logger step and solver step can be adjusted in the file common hh Care must be taken to respect the following condition SOLVER STEP lt LOGGER STEP lt SIMULATION STEP Otherwise the triple loop invoking solve in DynamicalSystem Controller update systems will behave incorrectly This results from the change of the way the logging limitation is implemented Before that the NumericalSolver used to count the number of calls to solve and sent a line of data every N calls Derivate I had to choose between function pointers and methods to im plement derivate in the DynamicalSystem class I chose the latter because I thought it
28. walk trot and bound with non linear oscillators Self organization of locomotion In his study of Self Organization of Locomotion in Modular Robots 7 Bertrand Mesot uses genetic algorithms to tune oscillators toward sensible movement patterns This suggests we could do the same to find interesting parameters of dynamical systems 1 3 Goals Up to now only simulation and pre calculated trajectories have been used to test non linear systems in quadruped locomotion We now have the tools to test the same controller program in both simulated and real environment The aim of this project is to develop a software framework allowing to control the AIBO robot with a set of dynamical systems The robot running this system shall be independent of any other external processor in particular it shall not get any help from a PC to solve differential equations The same code must be used both in simulation and on the real robot 1 4 Outline The initial plan for this project was e Test Webots amp OPEN R integration and cross compilation This amounts to using and testing Lukas Hohl s software see 4 5 e Develop an ordinary differential equations ODE framework to allow control of AIBO via non linear dynamical systems The code should be the same for simulation and real world runs e Interactively demonstrate that the AIBO is controlled by a dynamical system CHAPTER 1 INTRODUCTION e Write a user manual of the developed sof
29. 1 Motivation From equations to life Non linear dynamical systems offer new and creative possibilities for the con trol of locomotion in legged robots Their interesting properties include re sistance to perturbations attractors and synchronization with other systems or external input These properties can be exploited to design a new gen eration of robot controllers online controllers These are truly reactive and can adapt themselves to their environment as opposed to programmed controllers They can react to every situation even unplanned ones However the search space of dynamical system parameters is huge So finding the right system parameters to obtain a given property is far from being trivial To explore the immense space of possible configuration it would be desirable to have software tools to test one s ideas both in simulation and on a real robot The structure of non linear dynamical systems bears some level of simi larity with the neural structure of living beings A dynamical system itself can be a collection of many dynamical systems These systems are linked together and with the robot s sensors and actuators They can be thought of as a collection of neurons a brain which generates signal patterns in response to sensory input This approach might be useful to understand how the neural system of animals and humans work Or it can be used to produce very animal like robot behavior featuring adaptive locomotion
30. A 3 3 Install the Remote Control System 49 4 Aib O Matic installation 51 B Aib O Matic user manual 53 Bel Installation oy Boe Se ke Oe AS mus 53 B 2 How to change system parameters 53 How to build your own DynamicalSystems 53 B 4 How to add new Devices 54 CONTENTS B 5 How to compile the controller C CD ROM table of contents D GNU Free Documentation License D 1 Applicability and definitions D 2 Verbatim copying D 3 Copying in quantity D 4 Modifications D 5 Combining documents D 6 Collections of documents D 7 Aggregation with independent works D 8 Translation D 9 Termination D 10 Future revisions of this license E GNU General Public License vil 54 55 57 58 59 60 61 63 63 64 64 64 65 67 viii CONTENTS List of Figures 2 1 2 2 2 8 2 4 2 5 2 6 2 7 2 8 2 9 2 10 2 11 2 12 2 13 2 14 2 15 2 16 2 17 2 18 2 19 2 20 2 21 2 22 2 23 2 24 2 25 2 26 2 27 3 1 3 2 3 3 Environment diagram 8 Simplified concept 10 Concept ace be wick Bae IRI 11 Protocol diagram 13 Collaboration diagram for tick 15 Collaboration diagram for read devices 16 Collaboration
31. ABSOLUTELY NO WARRANTY for details type show w This is free software and you are welcome to redistribute it under certain conditions type show c for details The hypothetical commands show w and show c should show the appro priate parts of the General Public License Of course the commands you use may be called something other than show wand show c they could even be mouse clicks or menu items whatever suits your program You should also get your employer if you work as a programmer or your school if any to sign a copyright disclaimer for the program if necessary Here is a sample alter the names Yoyodyne Inc hereby disclaims all copyright interest in the pro gram Gnomovision which makes passes at compilers written by James Hacker signature of Ty Coon 1 April 1989 Ty Coon President of Vice 75 This General Public License does not permit incorporating your program into proprietary programs If your program is a subroutine library you may consider it more useful to permit linking proprietary applications with the library If this is what you want to do use the GNU Library General Public License instead of this License 76 APPENDIX E GNU GENERAL PUBLIC LICENSE
32. ARE ARCHITECTURE run ef Aib O Matic lt lt time triggered gt gt tick User Figure 2 1 Environment diagram The environment dia gram is very simple because there are only two messages run and tick The user starts the system and then the system runs on its own at the beat of tick messages run Launches the system tick Updates readings from devices solves dynamical systems and applies results to devices This message is triggered at each simulation step 2 3 Concept model As already said the concept model is similar to the domain model Note that there are no actors nor classes representing actors inside the system Everything is in the system it is called a simulation model Figure 2 3 shows the full concept model and Figure 2 2 shows the same model without inheritance which makes it hopefully easier to read 2 3 1 Description of analysis classes Here is the verbal description of the classes depicted on Figures 2 2 and 2 3 pages 10 11 Class TimeKeeper Knowing the current time is essential to the operation of the NumericalSolver from where the existence of the TimeKeeper class It maintains a clock reference and takes care of updating the Devices and the DynamicalSystems regularly that is at each time step Class Device The Device class is a generic representation of all the sensors and actuators of the robot It offers basic capabilities like reading writing Starting the system is no
33. alSolver dc DeviceController tk TimeKeeper systems DynamicalSystem update systems derivate in time double in x double out dx double tget DS by index in index size t DynamicalSystem tget DS by name char DynamicalSystem set_TimeKeeper in t TimeKeeper Figure 2 16 Class DynamicalSystem Controller Method interface void update_systems Update all DynamicalSystems This method is the workhorse of Aib O Matic You might want to have a look at it s 26 CHAPTER 2 SOFTWARE ARCHITECTURE collaboration diagram Figure 2 7 page 17 for a visual representation of what it does 1 Tell all DynamicalSystems to read values from their devices if they need to and gather all state variables into one big array that will be passed to the solver 2 Launch the solver 3 Write back state variables into their respective systems and tell all DynamicalSystems to write to their devices if they need to void derivate const double t const double x double dx Derivate all DynamicalSystems Should only be called by the NumericalSolver DynamicalSystem get DS by index size t index Returns a pointer to the DynamicalSystem designated by index Returns a null pointer if index is out of bounds i e greater than the number of Dynamical Systems minus one DynamicalSystem get DS by name const char n Returns a pointer to the DynamicalSystem designated by name n Retu
34. ame in name char DynamicalSystem set TimeKeeper in t TimeKeeper devices systems 1 1 mydevices E read double write in value double update_buffer writeback_buffer enable disable derivate in t double in x double out dx double read from devices write to devices get name char get dimension size t get variable in index size t double set variable in value double in index size t get name char get output variable state in index size t bool get variable name in index size t char mysolver 1 N log line in dimension size t in time double in data double in mask bool read position double read velocity double solve in x double inout dx double in dimension size t in t double in h double out output x double in output interval int in output variables bool read acceleration double write position in value double write velocity in value double write acceleration in value double TouchSensor DistanceSensor enable motor disable motor log in level LogLevel in message char l error in message char warning in message char info in message char debug in message char output data in data double in size size t RotationServo Plunger flush data get instance Logger Figure 2 12 Design class diagram 2 9 Implementation class model The implementation classes are described in th
35. by the Free Software Foundation with no Invariant Sec tions no Front Cover Texts and no Back Cover Texts A copy of the license is included in the section entitled GNU Free Documentation License The author believes knowledge especially scientific knowledge should be free as in freedom that is why this document is released under a license that guarantees it will remain free About the software provided Aib O Matic is free software you can redistribute it and or modify it un der the terms of the GNU General Public License as published by the Free Software Foundation either version 2 of the License or at your option any later version This program is distributed in the hope that it will be useful but WITH OUT ANY WARRANTY without even the implied warranty of MERCHAN TABILITY or FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License for more details You should have received a copy of the GNU General Public License ill along with this program if not write to the Free Software Foundation Inc 59 Temple Place Suite 330 Boston MA 02111 1307 USA Trademarks e Webots is a trademark of Cyberbotics Ltd e AIBO and OPEN R are trademarks or registered trademarks of Sony Corporation e Memory Stick is a trademark of Sony Corporation e Linux is a registered trademark of Linus Torvalds Acknowledgments The author would like to thank Jonas Buchli and Prof Auke Jan Ijspeert for their
36. ceSensor LED Servo Ro tationServo are all inspired by Webots controller API Servo and RotationServo are essentially the same save their treatment of numbers the former s base unit is meters and the latter s is radi ans Sensor is a generic representation of a sensor device It has little interest in itself except that it forbids writing to sensors A Plunger is a limited servo which has only two positions on and off This class stems from AIBO s ears which are restricted to two positions 12 CHAPTER 2 SOFTWARE ARCHITECTURE 2 4 Behavior model Last model of the analysis phase the behavior model is the addition of the protocol model and the operation model It expresses the behavior of the system regarding input messages The operation model states what the effect of messages are It serves as a base to write program code later The protocol model defines the authorized sequence of messages 2 4 1 Operation model The OCL is not easy to read if you don t know it That s why pre and post conditions are expressed in plain English rather than in OCL Operation schema of tick Operation Aib O Matic tick Description Advance the simulation by one time step Scope TimeKeeper Device DynamicalSystem NumericalSolver Pre true Post Read the input of all devices Solve the dynamical system Write the output of the dynamical system to the devices 2 4 2 Protocol model Due to the low number of messages the pr
37. contest your rights to work written entirely by you rather the intent is to exercise 70 APPENDIX E GNU GENERAL PUBLIC LICENSE the right to control the distribution of derivative or collective works based on the Program In addition mere aggregation of another work not based on the Pro gram with the Program or with a work based on the Program on a volume of a storage or distribution medium does not bring the other work under the scope of this License 3 You may copy and distribute the Program or a work based on it under Section 2 in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following a Accompany it with the complete corresponding machine readable source code which must be distributed under the terms of Sec tions 1 and 2 above on a medium customarily used for software interchange or b Accompany it with a written offer valid for at least three years to give any third party for a charge no more than your cost of physi cally performing source distribution a complete machine readable copy of the corresponding source code to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange or c Accompany it with the information you received as to the offer to distribute corresponding source code This alternative is allowed only for noncommercial distribution and only if you received the program in
38. controller e Build the controller program for Webots with make e Build the controller program for AIBO with make f Makefile openr Appendix C CD ROM table of contents This appendix lists the contents of the CD ROM associated with this project aibomatic Aib O Matic source distribution fondue models Fondue diagrams made with Dia images Screen shots and photos movies Movies of experiments ode out Sample output data files with processing scripts for GNUplot and Matlab openr sdk install Archives files needed to install the OPEN R SDK on Linux rcs install Remote Control System installation files report Report IXTEX source files slides Presentation slides IXTEX source files 59 56 APPENDIX C CD ROM TABLE OF CONTENTS Appendix D GNU Free Documentation License Version 1 2 November 2002 Copyright 2000 2001 2002 Free Software Foundation Inc 59 Temple Place Suite 330 Boston MA 02111 1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document but changing it is not allowed Preamble The purpose of this License is to make a manual textbook or other functional and useful document free in the sense of freedom to assure everyone the effective freedom to copy and redistribute it with or without modifying it either commercially or noncommercially Secondarily this License preserves for the author and publisher a way to get credit for their work
39. d D 10 FUTURE REVISIONS OF THIS LICENSE 65 copies or rights from you under this License will not have their licenses terminated so long as such parties remain in full compliance D 10 Future revisions of this license The Free Software Foundation may publish new revised versions of the GNU Free Documentation License from time to time Such new versions will be similar in spirit to the present version but may differ in detail to address new problems or concerns See http www gnu org copyleft Each version of the License is given a distinguishing version number If the Document specifies that a particular numbered version of this License or any later version applies to it you have the option of following the terms and conditions either of that specified version or of any later version that has been published not as a draft by the Free Software Foundation If the Document does not specify a version number of this License you may choose any version ever published not as a draft by the Free Software Foundation Addendum How to use this License for your documents To use this License in a document you have written include a copy of the License in the document and put the following copyright and license notices just after the title page Copyright OYEAR YOUR NAME Permission is granted to copy distribute and or modify this document under the terms of the GNU Free Documentation License Version 1 2 or any later ver sion pub
40. e Page means for a printed book the title page itself plus such following pages as are needed to hold legibly the material this License requires to appear in the title page For works in formats which do not have any title page as such Title Page means the text near the most prominent appearance of the work s title preceding the beginning of the body of the text A section Entitled XYZ means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses follow ing text that translates XYZ in another language Here XYZ stands for a specific section name mentioned below such as Acknowledgements Dedications Endorsements or History To Preserve the Ti tle of such a section when you modify the Document means that it remains a section Entitled XYZ according to this definition The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document These Warranty Disclaimers are considered to be included by reference in this License but only as regards disclaiming warranties any other implication that these War ranty Disclaimers may have is void and has no effect on the meaning of this License D 2 Verbatim copying You may copy and distribute the Document in any medium either commer cially or noncommercially provided that this License the copyright notices and the license notice saying this License applies to the
41. e designated by name n Returns a null pointer if no Device with this name is found 2 9 3 Class Device This class represents a device of the AIBO robot inside the Aib O Matic sys tem Devices can be any input or output mechanism from servos to cameras This class provides basic I O functionalities and is meant to be sub classed to represent more specific devices with more capabilities 24 CHAPTER 2 SOFTWARE ARCHITECTURE All input and output through the method interface should occur with normalized values in the 1 1 interval Calls to the Webots API use the float data type and Device uses double a loss of precision is thus possible here Device name char tag DeviceTag enabled bool buffer doubl tread double value double update_buffer t writeback_buffer tenable disable get_name char Figure 2 15 Class Device Method interface All methods are declared virtual to allow them to be inherited double read Returns the value of the device stored in its buffer This method should return a value in 1 1 The device must have been previously enabled otherwise behavior is undefined void write double new value Write a new value to the device s buffer The new value should be in 1 1 The device must have been pre viously enabled otherwise behavior is undefined The change in the buffer is not propagated to the real device This has to be expl
42. e is difficult to explain because no experimental data is available for the real AIBO Possible causes might be the differences between the simulated AIBO model and the real one or that the robot s processor isn t fast enough to compute all derivatives in the given time step lYes this is a bug It is listed in section 2 10 1 42 CHAPTER 3 TESTING AND RESULTS Chapter 4 Conclusions 4 1 Conclusion This project s goal have almost been fulfilled Webots is well integrated with OPEN R thanks to 4 5 the ODE framework has been completely designed implemented and demonstrated The two weaknesses remaining are that this system really works in simulation only and needs more testing On the other hand its strong points are the completeness of the software with respect to the specification and the intrinsic documentation We now have the tool to test new CPGs on the AIBO As a whole I enjoyed working on this project Facing last minute hard ware troubles with the AIBO and having to cope with C s intricacies was compensated by the excitement of working at the boundary between strict mathematics and animal locomotion Using a software development method was a bit of a masochistic initiative but it helped writing the software docu mentation which is of immense value to users Speaking of users let s turn to the future 4 2 Future work In decreasing order of priority here are the things to improve in Aib O Matic e Elimi
43. ed as many as fit reasonably on the actual cover and continue the rest onto adjacent pages If you publish or distribute Opaque copies of the Document number ing more than 100 you must either include a machine readable Transparent copy along with each Opaque copy or state in or with each Opaque copy a computer network location from which the general network using public has access to download using public standard network protocols a complete Transparent copy of the Document free of added material If you use the latter option you must take reasonably prudent steps when you begin dis tribution of Opaque copies in quantity to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy directly or through your agents or retailers of that edition to the public It is requested but not required that you contact the authors of the Document well before redistributing any large number of copies to give them a chance to provide you with an updated version of the Document D 4 MODIFICATIONS 61 D 4 Modifications You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above provided that you release the Modified Version under precisely this License with the Modified Version filling the role of the Document thus licensing distribution and modification of the Modified Version to whoever possesse
44. em and writing the new values of state variables to the DynamicalSystems and their output Devices if any The collaboration diagram of update systems is depicted on Figure 2 7 page 17 The dynamicalSystemController first tells all DynamicalSystems to read from their associated Devices That is what they immediately do by calling read on the Devices they are configured to read They store the returned values in their state variables The dynamicalSystem Controller then consults the TimeKeeper in order to know the current time This time is used among other parameters detailed later in section 2 9 7 to ask the NumericalSolver to solve the differential system The solver calls back derivate of the dy nam icalSystem Controller to obtain the values of the derivatives at the given time The latter propagates this call to each DynamicalSystem Note that solve is called multiple times during a single simulation step because the solver advances with smaller steps than the simulation Finally the dynami calSystem Controller tells each DynamicalSystem to write to their associated Devices They call write on the Devices they are configured to write to with the new values of their variables DeviceController write devices Similarly to read devices seen earlier this method Figure 2 8 on page 18 triggers the writing of every Device s buffer into the corresponding robot device thus making the robot move act and generally react to its environme
45. ent One leg of the robot is controlled by an ACPO Another leg driven by a human user gives this oscillator a perturbation input If the frequency of the movement given by the user is close enough to the intrinsic frequency of the ACPO synchronization of the two legs movement will occur Thus demonstrating that the robot is indeed controlled by a differential system The ACPO s first state variable x will be the position of the left front leg The right front leg s position will be added to z multiplied by a coupling constant k The oscillator is specified below 1 0 g Yo l1 r yw i em Lal g mm 1 Where e p is the right fore leg s position input e 2 drives the left fore leg s position 3T 38 CHAPTER 3 TESTING AND RESULTS e kis the coupling constant e parameters g 10 is the oscillator s gain rg 1 is the oscillator s radius w 2m is the oscillator s intrinsic frequency Trials will be run with different values of k According to the Arnold tongues graphs see 17 the higher the value of k the stronger the coupling between the two legs will be until a certain value of k above which it gets chaotic Since this experiment consists of moving the robots legs without making it walk we cannot allow them to touch the ground Otherwise their movement will get hampered Figures 3 1 and 3 2 show how this was accomplished in simulation and in the real world
46. es to Devices are simply implemented with an array of fixed size Thus lookup by index is fast com plexity is O 1 but lookup by name can be inefficient worst case complexity 2 9 IMPLEMENTATION CLASS MODEL 23 is O n where n is the size of the array A hash table could be more efficient here Since the number of devices is rather small 32 the burden of imple menting a hash table to manage them is not worth the small performance gain Therefore hash tables were left out during development The constructor of this class creates all Device objects If one wants to add remove or modify robot devices it is the right place to do it Numerical data such as maximum and minimum positions of servos come from 5 12 DeviceController tread devices write devices tget device by index in index size t Device tget device by name name char Device Figure 2 14 Class DeviceController Method interface void read devices Tell all Devices to read the value of their associated robot device and to put it into their buffer void write devices Tell all Devices to write the value stored in their buffer into the corresponding robot device Device get device by index size t index Returns a pointer to the De vice designated by index Returns a null pointer if index is out of bounds i e greater than the number of Devices minus one Device get device by name const char n Returns a pointer to the Devic
47. essional Computing Series Addison Wesley Boston first edition October 1994 William H Press Brian P Flannery Saul A Teukolsky and William T Vetterling Numerical Recipes in C The Art of Scientific Computing Cambridge University Press Cambridge second edition 1992 Rubin H Landau and Manuel J P ez Computational Physics Problem Solving with Computers John Wiley amp Sons first edition July 1997 Sony Corporation OPEN R SDK Programmer s Guide 2004 A Pikovsky R Rosenblum and J Kurths Synchromization A uni versal concept in nonlinear sciences volume 12 of Cambridge Nonlinear Science Series Cambridge University Press Cambridge 2001 This project s web page http birg epfl ch page56278 html Sony Corporation OPEN R SDK Installation Guide 2004 Appendix A Webots amp OPEN R Quickstart This guide details the installation procedure on a Linux system to obtain a running Webots with OPEN R and RCS integration plus Aib O Matic software A 1 OPEN R installation Install the OPEN R SDK according to the instructions in 19 These in structions are summarized below 1 Fetch the following files from http openr aibo com free but reg istration required e OPEN R SDK 1 1 5 r3 tar gz OPEN R SDK e OPEN R SDK sample 1 1 5 r2 tar gz sample programs e OPEN R SDK docE 1 1 5 ri tar gz manuals e gcc 3 3 2 tar gz gcc source e binutils 2 14 tar gz binutils source e newlib 1 10 0 tar gz
48. esting and maintenance All infor mation and relationships defined in the concept model must be preserved This results in a collection of interacting objects which realizes the operation model This phase yields four models Interaction model The interaction model shows how objects interact at run time to support the functionality specified in the operation model Dependency model The dependency model describes dependencies be tween classes and communication paths between interacting objects Inheritance model The inheritance model describes the superclass subclass inheritance design structure Design class model The design class model is composed of the contents of all design classes their attributes and methods all the navigable associations between design classes and the inheritance structure 2 1 4 Implementation The work to be done in this phase relies on the interaction model and the design class model The class interface has to be defined as well as the visibility of attributes methods and whether a method or class is abstract or not This will yield the implementation class model Finally code writing can take place One has just to follow the implemen tation class model using an object oriented programming language 2 2 Environment model The environment is very simplified because the system is not interactive There is one user actor only one input message run and one time triggered message tick 8 CHAPTER 2 SOFTW
49. icitly done with the writeback buffer method void update buffer Read from the robot s device and update the de vice s buffer if the device is enabled void writeback buffer Write the device s buffer to the robot s device if the device is enabled void enable Enable device feedback movement etc 2 9 IMPLEMENTATION CLASS MODEL 25 void disable Disable the device char get name Returns the human readable name of the device 2 9 4 Class DynamaicalSystem Controller This class is responsible for managing the collection of DynamicalSystems It allows looking up a DynamicalSystem by its name or index References to the DynamicalSystems are simply implemented with an array of fixed size Thus lookup by index is fast complexity is O 1 but lookup by name can be inefficient worst case complexity is O n where n is the size of the array A hash table could be more efficient here Again if the number of dynamical systems is small implementing a hash table might not be worth the effort If your system does have a lot of differential systems you might look into it though The constructor of this class creates all DynamicalSystem objects All dynamical systems have to be specified in this constructor This is the part of the program that the user has to edit to run his own systems DynamicalSystemController total dimension size t output variables bool output names char output interval int mysolver Numeric
50. ion 40 CHAPTER 3 TESTING AND RESULTS The first graph Figure 3 3 corresponds to a run with k 0 leading to no synchronization The second one Figure 3 4 represents a run with k 2 leading to synchronization after a few seconds The best synchronization has been observed with k 2 ACPO output and perturbation input compared k 0 1 5 r r r r 1 r r r r 1 1 r r ACPO output perturbation input 1 L n o 0 5 N c E 9 1 B lt 05 4 f H E 1 5 1 1 1 0 5 10 15 20 5 Figure 3 3 and perturbation without coupling This graph plots the ACPO output left leg s position and the perturbation input right leg s position against time Albeit the frequencies of the two movement are close no synchronization oc curs because the coupling constant equals zero At some points in time between 6 7 seconds and also between 14 15 seconds the two movements seem to be synchronized Actually they aren t because this coincidence does not persist 3 2 2 Reality As in simulation the robot has been raised on
51. is section Their attributes and methods are shown along with their visibility According to the UML 22 CHAPTER 2 SOFTWARE ARCHITECTURE notation a in front of a name means the method or attribute is private a means it is protected and a means it is public Constructors and destructors are not shown in this model Private at tributes and methods are generally not described unless they have a certain importance to the user For more details please refer to the source code and it s comments 2 9 1 Class TimeKeeper Since it is not possible as of now to read AIBO s Real Time Clock RTC through the Webots API this class has been designed to maintain a clock reference At each simulation step it counts how many milliseconds have elapsed since the beginning of the computation and accumulates this number in a counter rtc unsigned long dc DeviceController dsc DynamicalSystemController ttick in dt int tget time double Figure 2 13 Class TimeKeeper Method interface void tick int dt Triggers operation tick This method should be called at each simulation step for the program to work correctly It s collabora tion diagram depicted on Figure 2 5 page 15 shows what operation tick does double get time Returns the elapsed time in seconds 2 9 2 Class DeviceController This class is responsible for managing the collection of Devices It allows looking them up by their name or index Referenc
52. is to make it free software which everyone can redistribute and change under these terms To do so attach the following notices to the program It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty and each file should have at least the copyright line and a pointer to where the full notice is found one line to give the program s name and a brief idea of what it does Copyright C yyyy name of author 74 APPENDIX E GNU GENERAL PUBLIC LICENSE This program is free software you can redistribute it and or mod ify it under the terms of the GNU General Public License as pub lished by the Free Software Foundation either version 2 of the License or at your option any later version This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PAR TICULAR PURPOSE See the GNU General Public License for more details You should have received a copy of the GNU General Public Li cense along with this program if not write to the Free Software Foundation Inc 59 Temple Place Suite 330 Boston MA 02111 1307 USA Also add information on how to contact you by electronic and paper mail If the program is interactive make it output a short notice like this when it starts in an interactive mode Gnomovision version 69 Copyright C yyyy name of author Gnomovision comes with
53. l closely if not exactly resembles the concept model to be seen in the next phase I decided to draw it only once 2 1 2 Analysis The analysis phase generates five models Environment model The environment is the set of actors with which the system communicates via messages This model uses a collaboration diagram to model the interactions between the actors and the system It is defined by the set of input messages the system can receive the set of time triggered input events the set of operations the system can perform and the set of it can output Concept model The concept model is a subset of the domain model It keeps only what is part of the system Everything else belonging to the environment is left out It contains the set of classes and associations modeling the system state Behavior model The behavior model is the addition of the protocol model and the operation model 2 2 ENVIRONMENT MODEL T Operation model The operation model uses the Object Constraint Language OCL see 10 to specify the effects of operations in terms of system state changes and output messages sent Protocol model The protocol model defines the allowable sequence of operations during the lifetime of the system It is a state diagram 2 1 3 Design The design phase aims to develop an object oriented system architecture that satisfies the requirements defined during the analysis phase It also provides the foundations of the implementation t
54. lement device to variable mapping xl is true the value of device number z will get written to variable number y before the system is solved You can set those two arrays to null if you don t use them Right after writing the above paragraphs I realized that the coupling between dynamical systems had been badly designed The coupling is frozen in the derivate method with no way to specify it elsewhere for instance at object creation Because of that the user has to create one class for each DynamicalSystem even if they only differ in their coupling If one has a lot of systems this will be cumbersome That design flaw makes Aib O Matic 2 9 IMPLEMENTATION CLASS MODEL 29 unsuitable for evolutionary experiments because the coupling between sys tems cannot be changed without recompiling the whole program Desirable improvements for Aib O Matic now include refactoring it to fit the needs of GAs and to ease the task of creating lots of identical dynamical systems 2 9 6 Class Logger Utility class for logging messages and data Messages are logged to stdout when run in Webots and to the console when run on the AIBO robot Data is logged to a text file named ode out dat The data file is overwritten at each new instantiation of Logger hopefully only once at program launch This class is a Singleton only one instance of it may exist at any time Thus it s constructors and destructor have to be private Underlined attributes and meth
55. lished by the Free Software Foundation with no Invari ant Sections no Front Cover Texts and no Back Cover Texts A copy of the license is included in the section entitled GNU Free Documentation License If you have Invariant Sections Front Cover Texts and Back Cover Texts replace the with Texts line with this with the Invariant Sections being LIST THEIR TITLES with the Front Cover Texts being LIST and with the Back Cover Texts being LIST 66 APPENDIX D GNU FREE DOCUMENTATION LICENSE If you have Invariant Sections without Cover Texts or some other com bination of the three merge those two alternatives to suit the situation If your document contains nontrivial examples of program code we recom mend releasing these examples in parallel under your choice of free software license such as the GNU General Public License to permit their use in free software Appendix E GNU General Public License Version 2 June 1991 Copyright C 1989 1991 Free Software Foundation Inc 59 Temple Place Suite 330 Boston MA 02111 1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document but changing it is not allowed Preamble The licenses for most software are designed to take away your freedom to share and change it By contrast the GNU General Public License is intended to guarantee your freedom to share and change free software to make sure the software is free for all its use
56. ly by the user A separate method flush data is provided for this purpose void flush data Flushes the current data file buffer to disk 2 9 7 Class NumericalSolver This class is responsible for solving ODE systems It implements a simple solver using the fourth order Runge Kutta method with a fixed step Initially I wanted to use the GNU Scientific Library GSL to solve the differential equations But the inability to correctly cross compile any library for AIBO s processor prevented me to use such precious tools I had to turn to other implementations requiring no libraries The Runge Kutta method was first implemented using the code in 14 but comparison testing with Matlab s ode45 solver showed that this algorithm suffered some precision loss The shape of the function was right but it was shifted along the time axis and that gap grew with time So the Recipes code was dismissed Wandering on the World Wide Web revealed many more implementations of the Runge Kutta method I eventually came up with my own which is somewhat influenced by 15 I improved this algorithm by reducing the number of times the derivative function is called A fixed step method was preferred over an adaptive step one for simplicity s sake and because of its quick implementation 3See http www gnu org software gsl 2 9 IMPLEMENTATION CLASS MODEL 31 NumericalSolver doutput step counter int dsc DynamicalSystemController log_line in
57. manager which is represented as a particular instance of the class it manages here deviceController Device Collection managers are a new type of class introduced in the design phase They are very useful to send messages to all instances of the same class to insert and remove instances and to browse or search them Likewise all Dynamical Systems are told to update themselves that is solve their equations Finally the TimeKeeper tells all Devices to write their possibly new values to the robot s devices 2 5 2 Methods Collaboration diagram for methods show what certain important or compli cated methods shall do DeviceController read_devices This method Figure 2 6 on page 16 triggers the reading of every robot device in the system by the corresponding Device object Each Device instance holds the latest value read in a buffer The buffer speeds up access to device values because no call to the Webots 14 CHAPTER 2 SOFTWARE ARCHITECTURE API is needed It also prevents different values of the same device to be read in one time step This ensures consistency of the values during a simulation step Hence the robot s status is made available to the controller program DynamicalSystemController update systems This is one of the most important methods of the whole program This method is responsible for telling every DynamicalSystem to read from it s input Devices if any launch ing the NumericalSolver to solve the syst
58. ment means any work containing the Document or a portion of it either copied verbatim or with modifications and or translated into another language A Secondary Section is a named appendix or a front matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document s overall subject or to related matters and contains nothing that could fall directly within that overall subject Thus if the Document is in part a textbook of mathematics a Secondary Section may not explain any mathematics The relationship could be a matter of historical connection with the subject or with related matters or of legal commercial philosophical ethical or political position regarding them The Invariant Sections are certain Secondary Sections whose titles are designated as being those of Invariant Sections in the notice that says that the Document is released under this License If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant The Document may contain zero Invariant Sections If the Document does not identify any Invariant Sections then there are none The Cover Texts are certain short passages of text that are listed as Front Cover Texts or Back Cover Texts in the notice that says that the Document is released under this License A Front Cover Text may be at most 5 words and a Back Cover Text may be at most 25 words
59. n arrays variable to device mapping and device to variable map ping at instantiation Use get device by index and get device by name from the DeviceController to obtain references to devices variable to device mapping is first indexed by variable number and then by device number Meaning that if the element variable to device mapping x l y is true variable number x will get written to device number y after the system has been solved device to variable mapping is the reverse it is indexed first by device number and then by variable number Meaning that if the element device to variable mapping xl yl is true the value of device number will get written to variable number y before the system is solved You can set those two arrays to null if you don t use them Load your new systems in DynamicalSystemController s constructor in file DynamicalSystemController cc Add or modify array elements of array systems Remember to adjust the size of the array NB DYNAMICAL SYS TEMS in common hh You ll have to create all parameters before instantiat ing a new system Refer to the ACPO implementation as an example files ACPO hh and ACPO cc B 4 How to add new Devices You can add new devices by creating a new subclass of Device To load your new classes modify the constructor in DeviceController cc and add new array elements to the devices array Remember to adjust the size of the array NB DEVICES in common hh B 5 How to compile the
60. nate the two bugs mentioned in 2 10 1 and other yet to be discovered bugs e Test the software Aib O Matic has only had one user yet its author Real users which have no previous knowledge of the software make much better testers 43 44 CHAPTER 4 CONCLUSIONS Do some serious code refactoring to use more design patterns and to fit the program to use with optimization methods like genetic algorithms Add the feature of being able to receive data and logs via AIBO s wire less LAN interface Speed up the numerical solver or use an adaptive step method Look into the library cross compilation issue Interesting libraries to use include the GSL already mentionned in section 2 9 7 for numerical solving and GNU Nana for assertions checking and logging Improve the Webots world file to prevent the robot from sliding on the box Add the ultimate feature to read differential systems specifications from a file 1See http www gnu org software nana Bibliography 8 Webots http www cyberbotics com Commercial Mobile Robot Simulation Software J J Collins and S A Richmond Hard wired central pattern generators for quadrupedal locomotion Biological Cybernetics 71 375 385 1994 Jonas Buchli and Auke Jan Ijspeert Distributed central pattern gener ator model for robotics application based on phase sensitivity analysis In A J Ijspeert M Murata and N Wakamiya editors Biologically Inspired
61. nsisting of the Document and other documents released under this License and replace the individual copies of this License in the various documents with a single copy that is included in the collection provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects You may extract a single document from such a collection and distribute it individually under this License provided you insert a copy of this License into the extracted document and follow this License in all other respects regarding verbatim copying of that document 64 APPENDIX D GNU FREE DOCUMENTATION LICENSE D 7 Aggregation with independent works A compilation of the Document or its derivatives with other separate and independent documents or works in or on a volume of a storage or distri bution medium is called an aggregate if the copyright resulting from the compilation is not used to limit the legal rights of the compilation s users be yond what the individual works permit When the Document is included in an aggregate this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document If the Cover Text requirement of section 3 is applicable to these copies of the Document then if the Document is less than one half of the entire aggregate the Document s Cover Texts may be placed on covers that bracket the Document within the aggregate or the electronic eq
62. nstallation in the rest of this guide A 3 Remote Control System installation A 3 1 Create your own Webots directory e cd e mkdir my webots e mkdir my webots worlds Always be kind to system administrators otherwise you might dearly regret it See http www theregister co uk odds bofh for examples of what happens when one isn t A 3 REMOTE CONTROL SYSTEM INSTALLATION 49 mkdir my webots controllers cp usr local webots controllers Makefile include my webots controllers A 3 2 Extract the world file cd my webots worlds gunzip aibo ers210 wbt gz You ll get the aibo_ers210 wbt world file in your Webots directory A 3 3 Install the Remote Control System mkdir my webots transfer cd my webots transfer tar xzf openr tgz mkdir my webots src mkdir my webots src lib mkdir my webots src lib openr cd my webots src lib openr tar xzf remotecontrol tgz Clean up CVS files optional find depth name CVS exec rm rv Delete the line include lt prototype h gt in the file my webots src lib openr remotecontrol Controller Controller Controller cc because prototype h doesn t exist anymore Prepare for building cd my webots src lib openr remotecontrol RCServer make clean 50 APPENDIX A WEBOTS amp OPEN R QUICKSTART Edit the file my_webots src lib openr remotecontrol Controller Controller Makefile Correct the values of WEBOTS_HOME and OPENRSDK ROOT to
63. nt 2 5 INTERACTION MODEL TimeKeeper 2 update systems 1 read devices 3 write devices dynamicalSystemController DynamicalSystem deviceController Device Figure 2 5 Collaboration diagram for tick Operation tick is triggered by the controller loop robot run of Webots at each simulation step The TimeKeeper is the controller of this oper ation 1 It first instructs all Devices to read their values from the real robots devices This is done via a special object a col lection manager which is represented as a particular instance of the class it manages here deviceController Device 2 Likewise all DynamicalSystems are told to update themselves that is solve their equations 3 Finally the TimeKeeper tells all Devices to write their possibly new values to the robot s devices 15 16 CHAPTER 2 SOFTWARE ARCHITECTURE read devices deviceController Device 1 update buffer n Device Figure 2 6 Collaboration diagram for read devices 1 The object deviceController Device tells every Device instance to update its buffer by reading the robot device they correspond to All Devices hold the latest value they ve read in a buffer The star next to the message number denotes the fact that the message is sent to multiple objects 2 5 INTERACTION MODEL update systems 3 2 derivate 4 write to devices DynamicalSystem 4 1
64. ods on Figure 2 18 means they are static the loqqer Logger data file ofstream 109 level LogLevel in message char message char message char tinfo in message char debug in message char toutput data in data double in size size t flush_data tqet instance Logger Figure 2 18 Class Logger Method interface static Logger get instance Returns a pointer to the unique instance of the Logger class If the instance does not exist when this method is called it is created void log LogLevel level const char message Logs a message to the console at the given level 2 detailed explanation of the Singleton design pattern is kindly waiting for you to read in 13 30 CHAPTER 2 SOFTWARE ARCHITECTURE void debug const char message Shortcut for logging a message at the debug level void info const char message Shortcut for logging a message at the info level void warning const char message Shortcut for logging a message at the warning level void error const char message Shortcut for logging a message at the error level void output data double data size_t size Outputs one row of raw data into a text file The numbers are arranged in whitespace separated columns Flushing the write buffer is not done after each line for performance reasons The decision to flush is either taken by the operating system or explicit
65. otocol model is very simple Figure 2 4 page 13 The run operation starts the system and brings it in the running state Once it is running it keeps on running with tick and it is the only thing it can do There is no provision for stopping the system because the controller program will simply be unloaded from memory by Webots in simulation or by AIBO s operating system on the real robot at shutdown 2 5 Interaction model Here begins the design phase The interaction model details what operations and methods do how objects interact to realize what has been specified in the previous phase Message order is specified via Dewey numbers on the collaboration diagrams 2 5 INTERACTION MODEL 13 running system Figure 2 4 Protocol diagram The run operation starts the system Once it is running it keeps on running with tick There is no provision for stopping the system because the controller pro gram will simply be unloaded from memory by Webots or by AIBO s operating system at shutdown 2 5 1 System operations Aib O Matic tick Figure 2 5 on page 15 shows the collaboration diagram describing the operation tick It is triggered by the controller loop robot_ run of Webots at each simulation step function robot_run is documented in 11 The TimeKeeper is the controller of this operation It first instructs all Devices to read their values from the real robot s devices This is done via a special object a collection
66. r program for Webots with make e Build the controller program for AIBO with make f Makefile openr 52 APPENDIX A WEBOTS amp OPEN R QUICKSTART Appendix B Aib O Matic user manual B 1 Installation Follow this procedure to install Aib O Matic into your Webots directory It is assumed that this directory is my_webots e cd my webots controllers ers210 e Extract Aib O Matic sources be aware that this will overwrite the Makefile sources and Makefile files tar xvzf aibomatic src tar gz B 2 How to change system parameters Edit the file common hh Interesting parameters to tune include MAX LOG LEVEL SIMULATION STEP LOGGER_STEP and SOLVER STEP Care must be taken to respect the following condition SOLVER STEP LOGGER STEP SIMULATION STEP Otherwise the program will behave incorrectly How to build your own DynamxiicalSys tems First create a subclass of DynamicalSystem which overrides method derivate Inside this method you can implement your own equations You have get_ DS by index and get DS by name from the DynamicalSystemController at 53 54 APPENDIX B AIB O MATIC USER MANUAL your disposal to find other systems and get variable to read their variables Please refrain from doing anything else than reading to other DynamicalSys tems otherwise they will certainly start to behave in an unexpected manner Likewise you can connect your systems with I O devices by setting the two boolea
67. rally No WARRANTY 11 12 73 BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE THERE IS NO WARRANTY FOR THE PROGRAM TO THE EXTENT PERMITTED BY APPLICABLE LAW EXCEPT WHEN OTHERWISE STATED IN WRIT ING THE COPYRIGHT HOLDERS AND OR OTHER PARTIES PROVIDE THE PROGRAM AS IS WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU SHOULD THE PRO GRAM PROVE DEFECTIVE YOU ASSUME THE COST OF ALL NECES SARY SERVICING REPAIR OR CORRECTION IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER OR ANY OTHER PARTY WHO MAY MODIFY AND OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE BE LIABLE TO YOU FOR DAMAGES INCLUDING ANY GENERAL SPECIAL INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES END OF TERMS AND CONDITIONS Appendix How to Apply These Terms to Your New Programs If you develop a new program and you want it to be of the greatest possible use to the public the best way to achieve this
68. rns a null pointer if no system with this name is found void set TimeKeeper TimeKeeper t Sets the reference to the Time Keeper Should only be called once at system startup This is a workaround to the chicken and egg problem the TimeKeeper needs a reference to the DynamicalSystem Controller and vice versa So the DynamicalSystemController is created first then the TimeKeeper with a reference to the DynamicalSystemController and finally a ref erence to the TimeKeeper is given to the DynamicalSystemController This is more of a hack than a satisfactory solution One should have a look at design patterns 13 to find a better answer to this problem It might seem that this problem is solvable by using the Singleton de sign pattern Since this requires private constructors it is incompatible with constructors that accept parameters So that rules the Singleton out Moreover doing without constructors is not the good way to ini tialize object references in my opinion But some hope may reside in Factories 2 9 5 Class DynamicalSystem This class represents a non linear dynamical system It is not abstract but is expandable nonetheless remember Figure 2 11 2 9 IMPLEMENTATION CLASS MODEL 27 DynamicalSystem name char dimension size t variables init double variables current double variables names char output variables bool parameters double nb parameters size t mydevice
69. rs This General Public License applies to most of the Free Software Foundation s software and to any other program whose authors commit to using it Some other Free Software Foundation software is covered by the GNU Library General Public License instead You can apply it to your programs too When we speak of free software we are referring to freedom not price Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software and charge for this service if you wish that you receive source code or can get it if you want it that you can change the software or use pieces of it in new free programs and that you know you can do these things To protect your rights we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the software or if you modify it 67 68 APPENDIX E GNU GENERAL PUBLIC LICENSE For example if you distribute copies of such a program whether gratis or for a fee you must give the recipients all the rights that you have You must make sure that they too receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two steps 1 copyright the software and 2 offer you this license which gives you legal permission to copy distribute and or modify the sof
70. s Device nb devices size t variable to device mapping bool device to variable mapping bool derivate in t double in x double out dx double tread from devices twrite to devices t name char t dimension size t t variable in index size t double t variable in value double in index size t t output variable state in index size t bool t variable name in index size t char Figure 2 17 Class DynamicalSystem Method interface void derivate const double t const double x double dx Calculates the derivative of the system void read from devices Reads the values of the devices associated with this DynamicalSystem and writes them into his variables according to the device to variable mapping void write to devices Write the variables to the corresponding devices according to the variable to device mapping char get name Returns the name of the system size t get dimension Returns the system s dimension i e the number of state variables 28 CHAPTER 2 SOFTWARE ARCHITECTURE double get variable size t index Returns the value of the variable des ignated by index If index is out of bounds ie greater than the number of variables minus one returns 0 int set_variable double value size_t index Sets the variable designated by index to the given value Returns 1 if index is out of bounds i e greater than the number of variables minus one 0 otherwise
71. s a copy of it In addition you must do these things in the Modified Version A Use in the Title Page and on the covers if any a title distinct from that of the Document and from those of previous versions which should if there were any be listed in the History section of the Document You may use the same title as a previous version if the original publisher of that version gives permission List on the Title Page as authors one or more persons or entities respon sible for authorship of the modifications in the Modified Version together with at least five of the principal authors of the Document all of its prin cipal authors if it has fewer than five unless they release you from this requirement State on the Title page the name of the publisher of the Modified Version as the publisher D Preserve all the copyright notices of the Document Add an appropriate copyright notice for your modifications adjacent to the other copyright notices Include immediately after the copyright notices a license notice giving the public permission to use the Modified Version under the terms of this License in the form shown in the Addendum below Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document s license notice Include an unaltered copy of this License Preserve the section Entitled History Preserve its Title and add to it
72. s remain in full compliance You are not required to accept this License since you have not signed it However nothing else grants you permission to modify or distribute the Program or its derivative works These actions are prohibited by law if you do not accept this License Therefore by modifying or distributing the Program or any work based on the Program you indicate your acceptance of this License to do so and all its terms and conditions for copying distributing or modifying the Program or works based on it Each time you redistribute the Program or any work based on the Program the recipient automatically receives a license from the origi nal licensor to copy distribute or modify the Program subject to these terms and conditions You may not impose any further restrictions on the recipients exercise of the rights granted herein You are not responsible for enforcing compliance by third parties to this License If as a consequence of a court judgment or allegation of patent infringe ment or for any other reason not limited to patent issues conditions are imposed on you whether by court order agreement or otherwise that contradict the conditions of this License they do not excuse you from the conditions of this License If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations then as a consequence you may not dis tribute the Program at all
73. s the Program under this License may add an explicit geographical distribution limitation excluding those countries so that distribution is permitted only in or among countries not thus excluded In such case this License incorporates the limitation as if written in the body of this License The Free Software Foundation may publish revised and or new versions of the General Public License from time to time Such new versions will be similar in spirit to the present version but may differ in detail to address new problems or concerns Each version is given a distinguishing version number If the Program specifies a version number of this License which applies to it and any later version you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation If the Program does not specify a version number of this License you may choose any version ever published by the Free Software Foundation If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different write to the author to ask for permission For software which is copyrighted by the Free Software Foundation write to the Free Software Foundation we sometimes make exceptions for this Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software gene
74. sements or to conflict in title with any Invariant Section O Preserve any Warranty Disclaimers If the Modified Version includes new front matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document you may at your option designate some or all of these sections as invariant To do this add their titles to the list of Invariant Sections in the Modified Version s license notice These titles must be distinct from any other section titles You may add a section Entitled Endorsements provided it contains nothing but endorsements of your Modified Version by various parties for example statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard You may add a passage of up to five words as a Front Cover Text and a passage of up to 25 words as a Back Cover Text to the end of the list of Cover Texts in the Modified Version Only one passage of Front Cover Text and one of Back Cover Text may be added by or through arrangements made by any one entity If the Document already includes a cover text for the same cover previously added by you or by arrangement made by the same entity you are acting on behalf of you may not add another but you may D 5 COMBINING DOCUMENTS 63 replace the old one on explicit permission from the previous publisher that added the old one The author s and publisher s of the Document do not
75. t covered by Fondue From this point of view run is not really a message so it won t be covered in the analysis phase Of course objects have to be created at system startup thus run will appear again in the implementation phase 2 8 CONCEPT MODEL 9 buffering normalizing values and enabling disabling It is meant to be ex tended via subclasses to represent more precise peripherals like servos and sensors Class DynamicalSystem The DynamicalSystem class is burdened with the representation of ODE systems equations state variables parameters initial conditions names and a selection of variables to export for external use There will be one instance of this class per differential system to fa cilitate the definition of the systems by the user But mathematically the collection of differential systems can be seen as one single system and will be treated as such at the time of numerical solving It has the ability to read and write to any Device It can also read other DynamicalSystem s state variables This serves the need of introducing coupling between systems and also between the robot s devices and the various dynamical systems Finally DynamicalSystems employ the NumericalSolver class to solve their equations Class Logger The Logger class has no associations leading to it because it has only a single instance and thus enjoys system wide visibility In the other direction it also doesn t need any association with other classes beca
76. tationServo inherits from Servo and has the same method interface It assumes all numbers are in radians rad s and rad s RotationServo Figure 2 21 Class RotationServo 2 9 10 Class Plunger A plunger is a joint which has only two positions on and off The Plunger class inherits from Servo but velocity and acceleration controls have no effect Position values above and equal to zero mean the plunger is on values below zero mean it is off Plunger Figure 2 22 Class Plunger 2 9 11 Class Sensor Class Sensor inherits from Device and has the same method interface 2 9 12 Class TouchSensor Class TouchSensor inherits from Sensor TouchSensor instances are used to model the four paw touch sensors of the AIBO These are binary sensors returning either 0 off or 1 on 34 CHAPTER 2 SOFTWARE ARCHITECTURE PC _ Figure 2 23 Class Sensor Figure 2 24 Class TouchSensor 2 9 13 Class DistanceSensor Class DistanceSensor inherits from Sensor A DistanceSensor instance is used to model the Position Sensing Device PSD of the It returns only positive values as measured distances cannot be negative DistanceSensor Figure 2 25 Class DistanceSensor 2 9 14 Class Camera Class Camera inherits from Device This class has not been implemented because AIBO s camera is not controllable via the Remote Control System although it is in the Webots model of the AIBO One could devote some time to look into
77. tware Chapter 2 Software architecture This chapter describes the software engineering process that I have used throughout my project This process follows the guidelines of the Fondue method I learned in a software engineering course given by Prof Alfred Strohmeier I choose to use this method because writing code without plan ning first is a bad thing and it is the only method I already know since I practiced it during the software engineering project Employing this method also has the advantage of documenting the software itself while designing it which is important for users and future developments 2 1 The Fondue method What is Fondue From 8 Fondue is a software development method for reactive systems Fondue evolved from the Fusion method originally defined by Derek Coleman It keeps the process and the models of the orig inal Fusion method but uses the UML for the notation The Fondue process has four phases requirements elicitation analysis design and implementation The first phase defines what the software is required to do The analysis phase turns the requirements into a specification The design phase turns this specification into an architecture And finally the implementation phase maps this architecture to a programming language I will briefly explain these phases to give the reader enough background to understand the following models The interested reader might want to read 9 for a detailed description of
78. tware Also for each author s protection and ours we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed on we want its recipients to know that what they have is not the original so that any problems introduced by others will not reflect on the original authors reputations Finally any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will in dividually obtain patent licenses in effect making the program proprietary To prevent this we have made it clear that any patent must be licensed for everyone s free use or not licensed at all The precise terms and conditions for copying distribution and modifica tion follow TERMS AND CONDITIONS FOR COPYING DISTRI BUTION AND MODIFICATION 0 This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed un der the terms of this General Public License The Program below refers to any such program or work and a work based on the Program means either the Program or any derivative work under copyright law that is to say a work containing the Program or a portion of it ei ther verbatim or with modifications and or translated into another language Hereinafter translation is included without limitation in the term modification
79. u can refer to the ACPO implementation described in files ACPO hh and ACPO cc 20 CHAPTER 2 SOFTWARE ARCHITECTURE Device Camera RotationServo Figure 2 10 Inheritance diagram for Device It is the same inheritance structure as the one shown in the concept model on Figure 2 3 DynamicalSystem ExampleOscillator Figure 2 11 Inheritance diagram for DynamicalSystem This is the recommended way of implementing your own differen tial systems Make a subclass of DynamicalSystem and override the derivate method As an example you can refer to the ACPO implementation described in files ACPO hh and ACPO cc 2 8 DESIGN CLASS MODEL 21 2 8 Design class model Last model of the design phase the design class model regroups all infor mation from previous models All classes inheritances and relationships are shown Classes appear with their methods but without their attributes Trivial navigation methods i e getters and setters and constructors are not shown lt lt call gt gt theTK mri un TimeKeeper dt int get time double heDSC 1 d DeviceController DynamicalSystemController T read devices update systems write devices derivate in time double in x double out dx double get device by index in index size t Device get DS by index in index size t DynamicalSystem get device by name in name char Device get DS by n
80. uivalent of covers if the Document is in electronic form Otherwise they must appear on printed covers that bracket the whole aggregate D 8 Translation Translation is considered a kind of modification so you may distribute trans lations of the Document under the terms of section 4 Replacing Invariant Sections with translations requires special permission from their copyright holders but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections You may include a translation of this License and all the license notices in the Document and any Warranty Disclaimers provided that you also include the original En glish version of this License and the original versions of those notices and disclaimers In case of a disagreement between the translation and the orig inal version of this License or a notice or disclaimer the original version will prevail If a section in the Document is Entitled Acknowledgements Dedica tions or History the requirement section 4 to Preserve its Title section 1 will typically require changing the actual title D 9 Termination You may not copy modify sublicense or distribute the Document except as expressly provided for under this License Any other attempt to copy modify sublicense or distribute the Document is void and will automatically terminate your rights under this License However parties who have receive
81. use it won t use them The Logger s purpose is to provide a facility to log error or information messages and to output system data i e the DynamicalSystems state variables for external use 10 CHAPTER 2 SOFTWARE ARCHITECTURE lt lt system gt gt Aib O Matic theclock 1 TimeKeeper thecloc updates systems P D icalSyst Systems ynamicaloystem name string variables real parameters real variable names string mycontroller output variables boolean updates buffers mysystems Urat reads amp writes 1 mysolver NumericalSolver devices 1 mydevices name string tag DeviceTag enabled boolean buffer real Figure 2 2 Simplified concept diagram Concept diagram shown without inheritance relationships This model captures the initial idea of the system s classes and their interaction Knowing the current time is essential to the NumericalSolver from where the existence of the TimeKeeper class It maintains a clock reference and takes care of updating the Devices and the Dynam icalSystems regularly The Device class represents all the sensors and actuators of the robot It offers basic capabilities like reading writing buffering normalizing values and enabling disabling The DynamicalSystem class is burdened with the representation of differential systems It has the ability to read and write to any Device it can also read other DynamicalSystem s state variables Finally
82. while not being considered responsible for modifications made by others This License is a kind of copyleft which means that derivative works of the document must themselves be free in the same sense It complements the GNU General Public License which is a copyleft license designed for free software We have designed this License in order to use it for manuals for free software because free software needs free documentation a free program should come with manuals providing the same freedoms that the software does But this License is not limited to software manuals it can be used for any textual work regardless of subject matter or whether it is published 57 58 APPENDIX D GNU FREE DOCUMENTATION LICENSE as a printed book We recommend this License principally for works whose purpose is instruction or reference D 1 Applicability and definitions This License applies to any manual or other work in any medium that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License Such a notice grants a world wide royalty free license unlimited in duration to use that work under the conditions stated herein The Document below refers to any such manual or work Any member of the public is a licensee and is addressed as you You accept the license if you copy modify or distribute the work in a way requiring permission under copyright law A Modified Version of the Docu
83. would ease the task of creating lots of similar dynamical systems Instead this makes the equations impossible to change without creating an other class Thus the coupling which is part of the equations is frozen in 36 CHAPTER 2 SOFTWARE ARCHITECTURE the derivate method It would be nice to have a dynamic way of specifying the coupling between systems so that it could be changed at run time 2 10 1 Known bugs Alas bug free software almost doesn t exist Aib O Matic is no exception I discovered a few bugs too late to fix them Empty data file on Aibo The data file on the Memory Stick where state variables are output is empty when running on the AIBO For some yet unknown reason nothing is written to it OPEN R logging calls System calls to log messages described in 16 are used when compiling for the AIBO Sadly the documentation is not precise enough so as to where these messages go The Logger class uses these calls but it turns out the messages end up nowhere Chapter 3 Testing and results This chapter shows the results obtained by implementing an ACPO to test and demonstrate Aib O Matic A single oscillator is used to exhibit synchro nization of AIBO s left front leg movement on the movement of its right front leg 3 1 Experiment setup In order to test the software and demonstrate that it is possible to have an online dynamical systems based controller on the AIBO my supervisors and I have devised a simple experim
Download Pdf Manuals
Related Search
Related Contents
iiyama ProLite E2607WSD-B1 Master 2 SSP (Sciences-Po Strasbourg) Année InLine USB 3.0 cable 38085-Anclasil Oclu ES EPC-110/120 Operating Manual JVC AV-28RH4SU User's Manual Publishing Camera Trap Data A Best Practice Guide MV-372 VoIP GSM Gateway User Manual PORTech PDF版 Copyright © All rights reserved.