Home
User Manual - RoboCup Singapore
Contents
1. cccsscccccceeceseseseeeecceeeecaaseseeeeeceeeeesaaesseeeeeeeeeeaaeaenses 56 Working with colour sensors esseeeeessssssseeeeresssssssseeresssssssecerrsssssssseeeeesssssseeeeeresssss 63 MPLAB IDE MPLAB C30 and PICkit 2 for PIC Microcontroller eee 67 OO CACY ier sa setcinne E AR oa evince eevee sod E E E AA A T E A E 67 RoboErectus Virtual Simulator Software RE VSS CSR User Guide 4 Advanced Robotics amp intelligent Control Centre pp ame Tou nen nn ee 68 9 3 Running MPLAB IDE 2 0 eee ceccccceececeeceeeeeeeeeeeaaaeasesseeseseeeeeeceeeseeeeeeeeaaaasaaaseessesees 69 9 4 PlCkit 2 Programming Interface 2 0 0 eee cccccccccccessssseeececeeeeeaeenseeeceeeeeeeaueeseeeeeeeeeeaaas 74 10 Working with Real Robots cccccceesssseeeeeeess gt call acne denen 76 10 1 Install ZigBee Modules ccccccccsteeeseseeeecceees NE oo T 6600 76 10 2 Manual Control of Real RODOtS cc cccccennnnneteeesseeeeeeeeecccceeceeeeeeeeeaaaeeeeaeseeeeeees 76 10 3 Fully Autonomous Robot ccccecccccccceeseseseececeeceeaeeesseeceeeeeeeseeeseseceeeeseeseaeeeeceeeeeeaaas ial Appendix A User Guide of Virtual Simulation Environment ccccccccesseeeeeeeeeeeeeeees 83 Al Starting Visual Simulation Environment cecccccccccccceeeesseseecceeeeeeaeeeeseeeeeeeeeeaaas 83 A2 Visual Simulation Environment Menus cccccccccccccecccecceeeaeaeeeeseseeeeseeeeeeeeeeeees 84 A3
2. f 100 F a F f o w bot TO ser J ie sit KE y LET a AFV ETS User Manua I 4 lt gt Email CoSpace robocupsingapore org http www robocupsingapore org cospace Advanced Robotics amp intelligent Control Centre TO CREATE A LEARNING ENVIRONMENT FOR TODAY AND TO FOSTER UNDERSTANDING AMONG HUMANS AND TECHNOLOGY FOR TOMORROW RoboErectus Virtual Simulator Software RE VSS CSR User Guide Advanced Robotics amp intelligent Control Centre Copyright Warning 2011 Robo Erectus All rights reserved No part of this training material may be reproduced stored in a retrieval system or transmitted in any form or by any means electronic mechanical photocopying recording or otherwise without the prior permission of the copyright owner RoboErectus Virtual Simulator Software RE VSS CSR User Guide 3 Advanced Robotics amp intelligent Control Centre Contents 1 Introduction eessessssssssrsssrsssrossssssrsssssssrssssssssssssssssssrssanss es MONER cccevecenveces 6 2 Microsoft Robotics Developer Studio MRDS and Robo Erectus Virtual Simulator 6 1 6 2 7 1 42 T3 7 4 es 8 1 8 2 8 3 8 4 9 1 software for CoSpace Rescue cccccseeesseeeeeeees MER nn o NEPEAN alee 7 Visual Simulated Environment cccccccccccccccccecceeeeeeeessesseeeeeeeecceeeeeceeeeeaaaaeaaaeseeeeeees 8 CoSpace Virtual Robot
3. 4 Advanced Robotics amp intelligent Control Centre Appendix G Action To Be Taken After the Treasures Found When a robot detects a treasure it must stop and flash the LEDs for 2 seconds In fact if the robot does not move away after 2 seconds it will still sense the treasure Hence it will not move away Therefore in order to let the robot move forward after the treasure is detected the following actions or similar actions are necessary 1 If the default type condition is used you need to write the following action in the statement Actions Duration 48 v Mi Game End a Wheel_left 0 v Wheel_Right 0 v 50 1 Ki Advanced Action if Duration lt 16 Wheel_Left 2 Wheel_Right 2 Fig G 1 The action in the default statement 2 If the super type condition is used you need to write the following action in the statement Actions Duration 48 v gt Game End r Wheel_Left 0 v Wheel_Right 0 v g eo 1 v Advanced Action if SuperDuration lt 16 Wheel_Left 2 Wheel_Right 2 Fig G 2 The action in the super statement RoboErectus Virtual Simulator Software RE VSS CSR User Guide 100 Advanced Robotics amp intelligent Control Centre Contact Us Advanced Robotics and Intelligent Control Centre ARICC Singapore Polytechnic 500 Dover Road Singapore 139651 E mail CoSpace robocupsingapore org http www robocupsingapore org
4. Fig B 2 System properties RoboErectus Virtual Simulator Software RE VSS CSR User Guide 90 Advanced Robotics amp intelligent Control Centre Step 3 Select the Hardware Tab in the system property window System Properties System Restore Automatic Updates _ Remote General Computer Mame Hardware Advanced Device Manager The Device Manager lists all the hardware devices installed 5 on your computer Use the Device Manager to change the properties of any device Device Manager Drivers Driver Signing lets you make sure that installed divers are compatible with Windows Windows Update lets you set up how Windows connects to Windows Update for drivers Hardware Profiles Hardware profiles provide a way for vou to set up and store different hardware configurations Hardware Protiles bel Fig B 3 System Properties Step 4 Double click on the Device Manager button to explore the device manager g Device Manage ET T1OCT WB Batteries Rust ooth Devices f Corguter lt Dih des T Dipsy adegters DE ATAJATAPI coctrofers D EE 1 994 Gun ot controllers J mep dim gt kebosr b Mace and other paring divus i Midern Montors BD Nami adapters Bp 1 204 Net Adapter 2 B Cece AewConnect Vet virtud Minot Adaptar for Windoess B Intech SS547LM Gagebt Metreort Commection ED ireetR WA Link 5900 AGN E POIA adapters D Paon Idertt ication De
5. MyEx3 dll 8 Load the MyEx3 dll in RE VSS CSR control panel and start the simulation 9 Monitor the robot performance RoboErectus Virtual Simulator Software RE VSS CSR User Guide 58 Advanced Robotics amp intelligent Control Centre Task 2 To program a robot to turn 180 until it faces west Method 2 using Non interrupt action Fig 8 14 Analysis 171 lt Compass Reading lt 190 Turn Right Fig 8 15 RoboErectus Virtual Simulator Software RE VSS CSR User Guide 59 Advanced Robotics amp intelligent Control Centre Procedure 1 Launch the RE VSS CSR 2 Launch the AI developer panel 3 Create a new project 4 Add anew statement Right Turn Type Non_Interrupt Add a new exit state using state manager a State Manager Conditions FacingWet oooO o Fig 8 16 Set the exit action condition to be E com aS FA e eS That means that when 171 lt Compass Reading lt 190 is true the Non Interrupt action statement Turn Right will be terminated The next statement in the program will be executed Condition Compass gt 0 amp amp Compass lt 170 I Compass gt 190 amp amp Compass lt 360 This statement means When the condition 0 lt Compass sensor reading lt 170 or 191 lt Compass sensor reading lt 360 is fulfilled the Right Turn statement will be executed RoboErectus V
6. VSS CSR User Guide 48 Advanced Robotics amp intelligent Control Centre 8 Practical Guide 8 1 Manual control of robot The RE VSS CSR provides a manual control interface When you use a mouse to control the dashboard the robot will move accordingly RE VSS CSR Control Panel _ A Copyright Warming 2011 Robo Erectus All rights reserved No part of this system and its taring material should be copied and Select Robot Blue Virtual Fig 8 1 Robot manual control RoboErectus Virtual Simulator Software RE VSS CSR User Guide 49 Advanced Robotics amp intelligent Control Centre 8 2 Working with ultrasonic sensors Task 1 To program a robot to move forward It stops when it approaches the front obstacle 1 e the distance between front obstacle and robot is less than 20 cm D lt 20 cm Fig 8 2 Analysis ai ore Fig 8 3 RoboErectus Virtual Simulator Software RE VSS CSR User Guide 50 Advanced Robotics amp intelligent Control Centre Procedure 1 Launch the RE VSS CSR 2 Launch the AI developer panel 3 Create a new project 4 Adda statement namely Stop Type Default Action Condition When the reading from front ultrasonic sensor lt 20 cm Action Both wheels speed 0 stop position WE wed Al Development Panel Controler Boars RECS a SR RE Game 0 Statements A
7. Wheel_Right ET Advanced Action Fig 8 18 6 Save the project as MyEx4 smp 7 Build the project as MyEx4 dll 8 Load the MyEx4 dll in RE VSS CSR control panel and start the simulation 9 Monitor the robot performance RoboErectus Virtual Simulator Software RE VSS CSR User Guide 62 Advanced Robotics amp intelligent Control Centre 8 4 Working with colour sensors Task 1 Program a robot to locate a black object in the field The robot will stop with an LED on for the successful identification Analysis Yes Stop with LED on Fig 8 19 Procedure 1 Launch the RE VSS CSR 2 Manually move the robot over the black object and read the colour sensor feedback This value will be used for programming QS csict M 3 Q CS Richt Fig 8 20 This means that when the colour sensor senses the red object the reading is about 40 The robot in RE VSS CSR is installed with 2 colour sensors Both left and right colour sensors can detect the object The readings for both left and right sensors are the same RoboErectus Virtual Simulator Software RE VSS CSR User Guide 63 Advanced Robotics amp intelligent Control Centre 3 Launch the AI developer panel 4 Create a new project 5 Add a new statement Left Sensor Found Object Type Default Action Condition Left colour sensor reading 1s less than 85 Act
8. cccccccsesssssseeecccccccceessssceeccceccccesssseeeeceeseseee ss Aili nnn 9 SD Virtual ENVITONIMENE os s2 casccaceseericnds sngresdavevatacesadueaaead EE EEN EEEE ERT 10 RE VSS CSR Control Patel cccsccccccccccccccccessssssssssssessssescceceeeceesccceeeesasssseess 11 Toe RODOt Control Pane a nce sssisaasacencdeswene siavivenasevesiaansad EEAO EEEE E EE EEE a 11 Competition Control Panel ccccccsssesssccecceeccaeseeeeeeeceeceseeeeseeeeeeeeeeeeeeeeeeeeeeeeeeags 16 Al Development Patel SEESE h TT Beee eee aee Baaada sa aeaee Aes 20 Introduction of AI Development Environment ccccccccssseeeseceecceeceeeeesseeeeeeeeeaeas 20 Project Management Seki R EA S A ESZ SEDE s 21 Statement Management Section ssssssseoeeeessssssseeerrsssssssseterssssssssceeresssssseseeresssssseees 2i ROIC U gt o C 0nssssccccccccccnsssssecccccccccncsssescscccccccesssssessccceaccncaasessesccesssecuanees 33 C Programming Interface cccccsesssssseccccccseeesssseeecccccsneeesseseescccesueeeaseseececeeenees 43 Practical CGRIGNSHRREEIPEEIEEPIIIE csssssscssscssecccccccccccssecceecansssesssssssesecccececscsenceeeeeaassesess 49 Manual control Of rob0t cc cccssssssssesssseeeeeeecceecccceeeeeeeaaeeaeeseseeeeeeeeeeeeeeeeeeeeeeaaaeaegs 49 Working with ultrasonic Sensors eessssssseoeeresssssssseeresssssssecerrsssssssseteersssssseeeeeeesssss 50 Working with compass sensors
9. Advanced Robotics amp intelligent Control Centre Task 2 To program a robot to avoid an obstacle That means that the robot will turn right when the front ultrasonic sensor detects an obstacle i e the distance between front obstacle and robot is less than 20 am D lt 20 cm Fig 8 6 Analysis Turn Right Fig 8 7 RoboErectus Virtual Simulator Software RE VSS CSR User Guide 53 Advanced Robotics amp intelligent Control Centre Procedure 1 Launch the RE VSS CSR 2 Launch the AI developer panel 3 Create a new project 4 Adda statement namely Turn Right Type Default Action Condition When the reading from front ultrasonic sensor lt 20 cm Action Left wheel speed 2 Right wheel speed 2 a MyEx2 Al Development Panel a MyEx2 Al Development Panel p PHE HE A Copyright Warning Rebotup 2011 Robo Erectus All nghts reserved Controller Board RE CS01 v No part of this system and its training material should be copied and used for commercial product and training E RE Game 0 Statements States Statement SiteManager Twee Bat Condon Conditions Sensor Min Value US Front r 1 US_Back US Fig 8 8 RoboErectus Virtual Simulator Software RE VSS CSR User Guide 54 Advanced Robotics amp intelligent Control Centre 5 Add a statement namely Forward Type Default Action Condition no re
10. Visual Simulation Environment Keyboard and Mouse ccccccccccsnsseeeseeeeeeeeeeees 87 Appendix B ZigBee Communication Module Setup cccccccsssesssecccceeeeeeeeesseeeeeeeeseaes 90 Appendix C RE VSS CSR Directory Structure eenessssssseeeressssssssecreesssssssecteenssssssees 93 Appendix D How to Control the Real and Virtual Robots Using Your Own C Code 95 Appendix E Hardware Connection for CoSpace ROb0 cccccssesssecceceeeeeeeeeeeeeeeeeeeeeaas 96 Appendix F Communication Protocol cccccccccccccccccsesseeeeecceceeeeeeesseecceeeeesaeeeseeeceeeeeeaaas 98 Appendix G Action To Be Taken After the Treasures Found cccccccsssseeeeeeeeeeeeeees 100 fontact Us AIMEE ssssssessssssscccccccccccssnceeeeessssessessseaescccceccsassseceeesnassesees 101 RoboErectus Virtual Simulator Software RE VSS CSR User Guide 5 Advanced Robotics amp intelligent Control Centre 1 Introduction Popular interest in robotics has increased astonishingly in the last few years Robotics is seen by many as offering major new benefits in education at all levels Is it a fashion No Robots are excellent tools to train students competency in both academic and workplace Robotics in Education can enhance their knowledge in science mathematics physics mechanics and programming as well as time management project management problem solving skills creativity and teamwork Ma
11. file select the file and save it to the PC Unzip the file and execute the resulting setup exe file to install Please note Before the installation is completed you will be asked to install HI TECH Please select NO to end To uninstall MPLAB IDE e Select Start gt Settings gt Control Panel to open the Control Panel e Double click on Add Remove Programs Find MPLAB IDE on the list and click on it e Click Change Remove to remove the program from your system 9 2 2 Install Uninstall MPLAB C30 Compiler To install MPLAB C30 Compiler on your system e Download and install the following compiler from Microchip website www imicrochip com MPLAB C Compiler for PIC24 MCUS and dsPIC DSCs academic version To uninstall MPLAB C30 Compiler e Select Start gt Settings gt Control Panel to open the Control Panel e Double click on Add Remove Programs Locate amp select the MPLAB C for dsPIC DSCs and PIC24 MCUs e Click uninstall button to uninstall it from your system Both MPLAB IDE amp MPLAB C30 Compiler must be installed on the system Failure to do so may cause failure errors when compiling the project RoboErectus Virtual Simulator Software RE VSS CSR User Guide 68 Advanced Robotics amp intelligent Control Centre 9 2 3 Install Uninstall PICkit 2 PICkit2need to be purchased To install the PICkit 2 on your system e Insert the PICkit 2 Starter Kit CD ROM into the CD R
12. return CurGame IsGameEnd return bGamekFnd int sum 0 Us Eront CCPIUl s Dackec 0 Us _Fronu sum t Us Front Us Back CCP packet ll US Back sum t US Back US bei CCE 2Z packeclz Us bert sum T Us tert US Right CCF packec gt Uo Right sum F Us Right Cs Loit AVC Zi packer 4 Cs Lert sum T Co ler 46 Advanced Robotics amp intelligent Control Centre CO Right ADCI3 7 packecl 5 Compass compass packet 6 Compass sum Compass Time play time packet 7 sum void GetCommand int Motor int LegoMotor int LED Motor 0 Wheel Left Movor 2 Wheel Right LEDIO LED 1 LEDA LED 17 void Game0O 1f SuperDuration gt 0 SuperDuration else if Duration gt 0O urea on elem ront gt 0 Ba US Front lt 30 Duration 0 CurAction 0 else if true Duration 0 Curk tmon I SNI CN CurAciri1 one Case 0 tee Dae iene O GED O break casem Weel Lecis Mao l Rangine 2 y IEA LEO break default break void OnTimer Switch CurGame case 100 break case 101 RoboErectus Virtual Simulator Software RE VSS CSR User Guide Co Right sum CS Right 47 Advanced Robotics amp intelligent Control Centre Wheel Left 0 Wheel Right 0 L D 10 break case 0 GameO break default break RoboErectus Virtual Simulator Software RE
13. 524441 sf sp ec G amp A notedata sf sp GP cserver sspnas p File name Star DLL v LoadAI dii v Fig 6 11 Load a AI strategy RoboErectus Virtual Simulator Software RE VSS CSR User Guide 18 Advanced Robotics amp intelligent Control Centre e Virtual Game Start to start a virtual game e Virtual Game Pause to pause a virtual game e Virtual game Stop to stop a virtual game e Virtual Game Reset All to reset the virtual game Score will be reset to the initial value e Real Game Start to start a real robot in the real world The communication between the server and real robot is via ZigBee communication protocol e Real Game Stop to stop a real game in the real world e Penalty Red Team the Red team will receive penalty as described in the rule e Penalty Blue Team the Blue team will receive penalty as described in the rule e Penalty Both Teams both teams will receive penalty as described in the rule Programming interface fl Tewdoos The programming interface is to launch the AI development panel RoboErectus Virtual Simulator Software RE VSS CSR User Guide 19 Advanced Robotics amp intelligent Control Centre 7 AI Development Panel 7 1 Introduction of AI Development Environment The RE VSS CSR Robot programming uses an event driven approach The graphical AI development panel in the RE VS
14. Advanced Robotics amp intelligent Control Centre Table F 1 The Communication Protocol for CoSpace Platform Feedback c is a char denoted Play State P 006PC1 gt Play State 0 Normal Mode 1 AI Mode CG Feedback ooo Sa is a gaa denoted Game ID Game ID Its value is 0 8 Set Play 0 Normal Mode 1 AI Mode set to this value Robot lt 1 00 60C State The Play state in Control center will G c is a char denoted Play State MyID Sl to s7 are sensor s value of front back left and right ultrasonic sensor lt 006Ss1 left and right color sensor and s2 S3 8S4 compass sensor Sum is the sum of all S5 S6 S7 sensors value All this value is in Sum gt digital number for example if sensor value 123 it sents three chars 1 e 1 2 and 3 V1 to v4 are four chars denoted speed of four wheels Its value is 0 5 5 Set Game cis achar denoted Game ID lt 1 006GC gt l ID Its value is 0 8 c is a char Set LED 100 Ginc4 0 OFF 1 TOGGLE 2 ON deon lt 006H gt Game ID Set Play CODI c is a char denoted Play State State 0 Normal Mode 1 AI Mode Request lt 006Q gt Pedues lt 006T gt Play time Request S Sensor lt Q06S gt Value RoboErectus Virtual Simulator Software RE VSS CSR User Guide 99 Feedback Sensor Value Set Motor lt 006Vv1v Speed AN DV A N gt CoSpace Server P b M o
15. Build All RoboErectus Virtual Simulator Software RE VSS CSR User Guide 73 Advanced Robotics amp Intelligent Control Centre gt 8 The output window shows the result of build process There should be no errors or warning at any step However if you do receive errors go back to the previous sections and check the project assembly steps Errors will prevent the project from building If you receive warnings you may ignore them for this project as they will not prevent the project from building yarian Conte Fired Fda Sxecoting T Progroa files Microckig Loaded C Prolects MyPraject ont eee eee ee EE ee ee ee Debus build of project C Projects Project acp succeeded Lenguese tool versions pic3O es exe v3 12 pi cdO lt gee exe v3 12 pi cBl ld exe v3 12 91 30 e exe v3 12 Preprocessor syabol DEBUG is detined Hon Jan 10 11 12 04 2011 Fig 9 10 Output window If you follow all the steps mentioned previously you will get the message BUILD SUCCEEDED as shown in Fig 9 10 shown above on your output window when you select Build All 9 4 PICkit 2 Programming Interface Start the PICkit 2 Programming Software by selecting Start gt Programs gt Microchip gt PICkit 2 The programming interface appears as shown in Fig 9 11 PIA re ontrediee Progamm alo a Me Oeveefenty Progen Jooh Abo Menu Bar Hamp Device Canigsator Dewees Not Prosent ree User
16. Copyright Warning btoas am f 2011 Robo Erectus All nghts reserved No part of this system and its training material should be copied and used for commercial product and training States Statement Te Eat Contin Ss Conditions Sensor Min Value US Front r 1 US_Back US Fig 8 4 RoboErectus Virtual Simulator Software RE VSS CSR User Guide 51 Advanced Robotics amp intelligent Control Centre i 4 5 Add a statement namely Forward Type Default Action Condition no restrictions Action Both wheels speed 2 as Myx Al Development Panel lS ea nS SS wre 2011 Robo Erectus All nghts reserved Controller Board RE CS01 X No part of this system and its training material should be copied and used for commercial product and training E RE Game 0 Statements States Statement Stop State Manager Type Default Exit Condition gga Forward Conditions Duration EE i Game End E Wheel_tet 2 Wheei_Ri 2 EI Advanced Action Fig 8 5 6 Save project The saved project has an extension of smp It can be reloaded for editing 7 Build project The built project has an extension of dll This file can be loaded in the control panel for execution 8 Load the built project and start the simulation 9 Monitor the robot performance RoboErectus Virtual Simulator Software RE VSS CSR User Guide 52
17. Fr Change the render mode F3 O Toggle the physics engine enable F5 o Toggle between Edit Mode and Run Mode F8 Change the active camera When the simulator is in Edit mode the navigation keys work the same but some additional options are available when the left Ctrl key is held down When the left Ctrl key is pressed the currently selected entity will be highlighted if it has a valid bounding sphere associated with it While the Ctrl key is pressed the following additional keys are available View the selected A a eee from above a positive Y distance from the Up Arrow object Shift Up Arrow TEORA ater selected object from below a negative Y distance from the Using the Mouse In most cases dragging the mouse cursor through the Graphics pane by holding down the left button and moving the mouse causes the camera viewpoint to change In general keyboard commands affect the position of the camera while mouse movement affects the orientation of the camera When the simulator is in Edit mode and the left control key is held down the mouse behavior can be different If an entity is selected and the Position property is selected in the Property window the mouse movement affects the position of the entity If any component of the position vector is selected the entity is constrained to move only along that axis Similarly 1f the rotation property is selected in the Property window the mouse movement affects the orientation of the
18. ID s FAF Device Configuration De Sum OF DPF Progress Bar Pend wie Verte Emme ou r Sagat v Progam memory Sawee None beret sre HOO FFF 0008 JFFF J3FFF 3 J 0010 FFF IFPF 0010 JFFF SFFF 3 0020 FFF JFFF 3 0070 JFFF FFP 0030 FFF SFFF 3 Program Memory 0038 lt IFFF IFFF 3 i 0040 JFFF SFFF 3 0040 JFFF JFFF 3 0050 JFFF 3FFF 0059 JFFF 3FFF 0060 JFFF JFFF 3 Data EEPROM Memory Fig 9 11 PICkit 2 programming interface 9 4 1 Checking Communication RoboErectus Virtual Simulator Software RE VSS CSR User Guide 74 Advanced Robotics amp intelligent Control Centre Plug PICkit 2 into both computer and Robot controller board To test the communication select the Tools gt check communication The message PICkit 2 found and connected will be displayed in the status bar RoboErectus Virtual Simulator Software RE VSS CSR User Guide 75 Advanced Robotics amp intelligent Control Centre 10 Working with Real Robots Upon successful compilation and building of a project ai c a C code file is automatically generated The ai c can be downloaded to the real robot Of course you can open the ai c file to study the programming logics if you wish do You can also modify the C code for further improvement This feature allows students to program a robot controlled by a microcontroller without writing a C code for any specific microcontroller 10 1 Install ZigBee Modules The real robot
19. Launch the AI developer panel 3 Create a new project 4 Add anew statement Stop Type Default Action Condition Action Left wheel speed evelopment Panel Controller Board RE CSO1 x E RE Game 0 Statements States When Compass sensor reading is in between 171 and 190 degree 0 Right wheel speed 0 A Copyright Warning 2011 Robo Erectus All nghts reserved No part of this system and its training material should be copied and used for commercial product and training Statement Tne Eat Contin Conditions 1 us 1 us Sensor Min Value US_Back Fig 8 12 RoboErectus Virtual Simulator Software RE VSS CSR User Guide m 57 Advanced Robotics amp intelligent Control Centre 5 Add anew statement Turn Right Type Default Action Condition No restrictions Action Left wheel speed 1 Right wheel speed 1 i DRS GA kro wamn Rebate 2011 Robo Erectus All nghts reserved Controller Board RE CS01 hd No part of this system and its training material should be copied and used for commercial product and training E RE Game 0 Statements States Statement E Se State Manager Type Default Exit Condition Tum Right Conditions Duration EE y Game End E Whee tet T Whea mo Gs MEF Advanced Action Fig 8 13 6 Save the project as MyEx3 smp 7 Build the project as
20. Nisei nig a OF a NE OU oul ie static string GetTeamName return Happy public static void SetGameID int GameID CurGame GamelD bGamekEnd false public static int GetGamelID return CUurGame public static bool IsGameEnd return bGameknd RoboErectus Virtual Simulator Software RE VSS CSR User Guide 43 Advanced Robotics amp intelligent Control Centre public static void OnTimer Switch CurGame case 100 break Gase 101 Wheel Left 0 Wheel Right 0 LED 1 0 break case 0 GameO break dertault break public static void SetData int Sens r r int Sensors p int Sensor4 int Sensors p ant Sengoro US Front Sensor US Back Seggorl ee Left Seieer2 went ght Sam isor3 Gamectt Semeor4 Cs Right Se a Compass Sensor6 Time Sensor public static void GetCommand ref int ActuatoroO ref int Actuator2 Actuator0O Wiagel gL 5 AC UTOM Unet Actuator LED 1 private static void Game0 1f SuperDuration gt 0 Slee PUieaieanen else if Duration gt 0O Diiis che ONF e En FF ront gt 0 amp amp US Front lt 30 Duration 0 CurAction 0 else if true Duration 0 CurAction 1 Switch CurAction RoboErectus Virtual Simulator Software RE VSS CSR User Guide 7 7 int Sensorl int Sensor2 int Sensor ref int M
21. RoboErectus Virtual Simulator Software RE VSS CSR User Guide 101
22. RoboErectus Virtual Simulator Software RE VSS CSR User Guide 28 Advanced Robotics amp intelligent Control Centre 7 3 3 Managing statements and subroutines You can delete move up move down and change the statement or subroutine s name To do so you need to select the statement or subroutine and right click to select the appropriate action as shown in Fig 7 16 ache Gis Controller Board RE CSO1 x E Lucky Game 0 Statements States TumRight State M Hi MoveForward Add a New Statement Add a New Statement Bundle Add a New Statement within the Bundle Add a New Bundle within the Bundle oe SY Move Up Move Down Change Name Fig 7 16 Managing statement 7 3 4 Statement type The type of the statement has to be specified when each new statement is added There are three types statements for different requirements namely default action non interrupt action and super action as shown in Fig 7 17 States Statement state Manager Fig 7 17 Statement types e Default action The default action statement has the lowest priority A project can have many default action statements e Non interrupt action The non interrupt statement has the same priority as the default statement When the non interrupt statement is executed it will not be interrupted or terminated unless 1 The exit action condition 1s fulfilled 2 The super action
23. VSS CSR User Guide 65 Advanced Robotics amp intelligent Control Centre a 7 7 Add anew statement Move Forward Type Default Action Condition No restrictions Action Left wheel speed 1 Right wheel speed 1 ple gt a conte Boara REGED E RE Game 0 Statements States A Copyright Warning Rebotup 2011 Robo Erectus All nghts reserved No part of this system and its training material should be copied and used for commercial product and training Statement ae Leh Serisor Found Giyect State Manager Type Default Exit Condition im Right Sensor Found Object 9 Move Forward Conditions Duration EE y Game End E Qwreate O Owren 2 Eeo Advanced Action Fig 8 23 8 Save the project as MyEx5 xml 9 Build the project as MyExS dll 10 Load the MyEx5 dll in RE VSS CSR control panel and start the simulation 11 Monitor the robot performance RoboErectus Virtual Simulator Software RE VSS CSR User Guide 66 Advanced Robotics amp intelligent Control Centre 9 MPLAB IDE MPLAB C30 and PICkit 2 for PIC Microcontroller 9 1 Get Ready CoSpace robot is equipped with PIC microcontroller Therefore MPLAB IDE MPLABC30 Compiler and PICkit2 are required for program compiling and downloading to real robot controller 9 1 1 MPLAB Integrated Development Environment IDE and MPLAB C30 Compiler MPLAB Integrated Development
24. VSS CSR 3D virtual environment Obstacles The obstacles are 10cm in height Virtual Objects There are two types of objects red objects and black objects Virtual Robots Two virtual robots red robot and blue robot are used to represent two teams Information Board The Information board shows the team name score etc Team name Total score Points for the treasures on the cart Treasures on the cart Fig 5 2 Information Board RoboErectus Virtual Simulator Software RE VSS CSR User Guide 10 Advanced Robotics amp Intelligent Control Centre 6 RE VSS CSR Control Panel Fig 6 1 shows the RE VSS CSR control panel The control panel consists of two sub panels namely Robot Control Panel and Competition control Panel S SG RE VSS CSR Control Panel enn k ea Ay Copyright Warning Reobotup Ay Copyright Warning wens amp 2011 Robo Erectus All rights reserved 2011 Robo Erectus All rights reserved No part of this system and its taning material should be copied and No part of this system and its training material should be copied and Select Robot Blue Virtual Sensors 1 US_Front s US Back US_Left 1 US_Right a CS Left Robot ied Category Soe Blue Team Red Team RE Blue RE Red 100 100 Ready 0 0 Load Blue Team Al Load Red Team Al Virtual Game Real Game Penalty e
25. applicable for RE VSS CSR Not applicable for RE VSS CSR DIY Biped Not applicable for RE VSS CSR Not applicable for RE VSS CSR Project AI strategies programing Each project will have its own folder There are 4 files in each project folder There are ai cs C source code generated based on the graphical programing developed in the AI development panel ai cs is for virtual wheeled robot ai c C source code generated based on the graphical programing developed in the AI development panel ai c is for real wheeled robot MyAI smp Ai strategy file It can be loaded for editing in AI development panel MyAI DLL the dynamic link library file of the AI strategy It can be loaded to control a virtual real wheeled robot RealAI Real robot AI strategy files VirtualAI Virtual robot AI strategy files Entity re Not applicable for RE VSS CSR RoboErectus Virtual Simulator Software RE VSS CSR User Guide 94 Advanced Robotics amp intelligent Control Centre Appendix D How to Control the Real and Virtual Robots Using Your Own C Code The RE VSS CSR provides a C programming interface which enables professional programmers to test the AI strategy using the CoSpace platform Following are the steps of creating your own AI strategy for both virtual and real robots AI strategy for virtual robot If you like to write your own AI strategy in Visual C or modify the ai cs gene
26. between 10 30 The advanced condition can be used to specify more complex conditions such as US_Front gt 10 amp amp US_Front lt 50 II CS_Left gt 10 amp amp CS_Left lt 30 Fig 7 22 shows the implementation of advanced condition aJ State Manager Conditions Sensor 4 CS Left Q CS_Right 1 US_Front 1 US_Back 1 US_Left 1 US_Right Compass 4 ro 360 lt Time ro 1000 lt Advanced Condition KUS Front gt 10 amp amp US Front lt 50 I CS_Left gt Fig 7 22 Define a state with advanced condition The basic conditions can be combined with the advanced condition Fig 7 23 shows US Front gt 0 amp amp US Front lt 50 amp amp CS Left lt 50 Fig 7 24 shows Us Frontl gt 0 cUS Fronts 50 Cs tert lt o0 RoboErectus Virtual Simulator Software RE VSS CSR User Guide 32 Advanced Robotics amp intelligent Control Centre a State Manager Conditions 0 0 ad State Manager ric Fig 7 24 Define a state 7 4 Programming Section Robot programming uses an event driven approach That means that the robot acts based on the sensors feedback The condition and action section is to specify the perception action of a robot Once a new statement is created the corresponding conditions and actions have to be specified This graphical perception action programming interface as shown in Fig 7 25 is suitable for a
27. igi E 1 US_Right gi so pss J E gi so 255s E gii gt 0 255 E Sil ajo 250 E A 54 i A v Fig E 2 The connection of each component Please refer to the RE CSOI and RE CS02 User Guide for the educational controller board RoboErectus Virtual Simulator Software RE VSS CSR User Guide 97 Advanced Robotics amp intelligent Control Centre Appendix F Communication Protocol One device is able to communicate with many devices via ZigBee communication Hence the CoSpace server equipped with ZigBee transceiver is able to communicate with many real robots with ZigBee module installed In order to establish one to one communication each robot has to assign a unique ID The ID is made up of three integer numbers It is defined at the end of main h file of Real project ZigBee utilizes Serial Port for communication Fig F shows the setting of serial port properties COM6 Properties eee Port Settings Bits per second Data bits Panty Stop bits 1 Flow control Fig F 1 Serial Port Properties All packets follow the communication protocol in the following format lt l start code three integer number real robot ID a char command data gt end code The communication protocol is listed in Table F 1 RoboErectus Virtual Simulator Software RE VSS CSR User Guide 98
28. motherboard o D souwce c D source h Fig 9 7 Adding files Once it is done clicking Next will show up a project summary dialog The project summary dialog summaries the selected device the toolsuite and the new project file name RoboErectus Virtual Simulator Software RE VSS CSR User Guide 72 Advanced Robotics amp intelligent Control Centre l d d i S M Summary Click Firesh to creete comigure fe project with these poremeters Project Parameters Devices ds PICO E0144 Tooleate Microchip C30 Toolmste C Prosects MyProjectimep A naw workspace wii be ceated end the new praci addad to thet workspace EEr Jt Licance tie Fig 9 8 Project summary Click on Finish to generate the project and proceed to the MPLAB WorkSpace Step 6 Viewing the Project You can select View gt Project in menu bar to view the project created b gt e J te aera 9 ama oe T face ee Fig 9 9 MPLAB WorkSpace Files can be added and project can be saved by clicking the right mouse button in the project window In case of error files can be manually removed from the project by selecting them clicking the right mouse button and selecting Remove from the menu 9 3 2 Building a project Build a project is to compile and link all the source files for an application Double click on the project created In the MPLAB IDE menu select Project gt
29. of the different simulation environments are listed in there as well as samples for each of the simulated robots This will display the VSE window and load the relevant simulation The Simulation Tutorials provide examples of simulated environments RoboErectus Virtual Simulator Software RE VSS CSR User Guide 83 Advanced Robotics amp intelligent Control Centre When the simulator is running you can move the camera viewpoint by dragging the mouse pointer across the screen It does not change the camera position but it changes the point that the camera is looking at To move the camera you can use the keyboard as follows _ If you hold down the Shift key while you hold one of the keys listed above the camera moves much faster You can also use the mouse at the same time as you hold down a key This allows you to fly around by changing direction with the mouse and moving with the keyboard A2 Visual Simulation Environment Menus The following commands are provided on the Microsoft Visual Simulation Environment VSE window The File Menu e Open Scene Loads a scene e Save Scene As Saves a scene When you save a scene the simulator saves the simulator state along with the state for every entity in the scene It also saves a manifest which can be used to re initialize the scene and any services associated with the entities e Save Material Changes Saves changes made to materials in Edit mo
30. routine 1s a portion of code within a larger program that performs a specific task and is relatively independent of the remaining code Procedures of adding a new subroutine Step 1 Select the previous statement subroutine in the project that you wish to have the subroutine appended and click the right mouse button Choose Add a new Bundle within the Bundle or Add a new Bundle as shown in Fig 7 14 Cotter Bed RELS Controber Boss RECS zj ust SEE States E Lic Gare 1 tere Sises iA ee er ernie Add at Ai Add New Sebemert dil a New Steternere Bunia Add r New etemert Bundle l Add Mew Sleterner within the Sundli Arist a Mowe Stabernert within the Bundle Add New Bumcte within the Bundie Add New Bundle within the Bundle Listete Dete blowe Up More Up hime 7 nge Aan Thare Maina Or Fig 7 14 Adding a subroutine Step 2 Assign a meaningful name to the subroutine created The new subroutine will then be added as shown in Fig 7 15 ag My Project Al Deve CO het gt a Controller Board RECS v e ER Lucky Game 0 Statements Peseee Tum Right ActionName We strongly suggest you give a meaningful name to each action For Example Found Ball Action Name TumRight Fig 7 15 Assigning a new subroutine name The subroutine is a set of statements You can add more statements or subroutines to an existing subroutine
31. statement is executed RoboErectus Virtual Simulator Software RE VSS CSR User Guide 29 Advanced Robotics amp intelligent Control Centre When the non interrupt action is specified it 1s necessary to define an exit condition for this action That means the non interrupt statement will only be terminated when the specified exit condition is true The Section 7 3 5 on managing states will illustrate the details A project can contain many non interrupt action statements e Super action The super action statement has the highest priority Once the condition for the statement is true it will be executed immediately All other actions will be interrupted A project can contain many super action statements 7 3 5 Managing states State Manager allows you to add delete new state variables and define the states States Statement Eat Condition State Manager a Fig 7 18 State manager A state is needed for a non interrupt statement When a new state is defined it is compulsory to specify the exit action condition The non interrupt statement will only be terminated when the exit condition is true Fig 7 19 shows the state manager environment wo State Manager Conditions US_Right 4 CS Left Fig 7 19 State manager RoboErectus Virtual Simulator Software RE VSS CSR User Guide 30 Advanced Robotics amp intelligent Control Centre Add a new state To add a n
32. you Use advanced action program 7 4 3 Advanced programming function In the advanced function you can write simple codes for specific conditions and actions The Advanced programming supports the symbols for C arithmetic operations and relational operators Symbol Meaning Operator Meaning Addition gt Greater than Subtraction a Greater than or Equal to Multiplication lt Less than Division lt Less than or Equal to Equal to I Not Equal to You can use all pre defined variables and global variables specified in the advanced conditions and actions RoboErectus Virtual Simulator Software RE VSS CSR User Guide 39 Advanced Robotics amp intelligent Control Centre Advanced Conditions The advanced conditions are used for more complicated combination of conditions Advanced Condition Il Condition 0 lt Front Ultrasonic Sensor Reading lt 50 and 0 lt Left Colour Sensor Reading lt 60 How do you Agyanced Condition a amp US_Front lt 50 amp amp CS_Left lt 60 program Condition 0 lt Front Ultrasonic Sensor Reading lt 50 or 0 lt Left Colour Sensor Reading lt 60 How do you Advanced Condition amp amp US_Front lt 50 I CS_Left lt 60 program Condition 40 lt Back Ultrasonic Sensor Reading lt 80 and Right Colour Sensor Reading gt 100 How do you US Back gt 40 amp amp US Back lt 80 amp amp CS Right gt 1
33. 00 program Advanced Condition amp amp Condition 40 lt Back Ultrasonic Sensor Reading lt 80 or Right Colour Sensor Reading gt 100 How do you US Back gt 40 amp amp US Back lt 80 CS Right gt 100 program Advanced Condition ae US_Back gt 40846US Back lt s0 II CS_Right Condition 0 lt Left Colour Sensor Reading lt 60 and 45 lt Compass Sensor Reading lt 90 How do you CS Left lt 600 amp amp Compass gt 45 amp amp Compass lt 90 program 5 amp kCompass lt RoboErectus Virtual Simulator Software RE VSS CSR User Guide 40 Advanced Robotics amp intelligent Control Centre The advanced conditions can be combined with the basic conditions to fulfill more comprehensive requirement Condition 0 lt Front Ultrasonic Sensor Reading lt 50 and 0 lt Left Ultrasonic Sensor Reading lt 40 or 0 lt Left Colour Sensor Reading lt 60 How do you program Condition 0 lt Front Ultrasonic Sensor Reading lt 50 or 0 lt Left Ultrasonic Sensor Reading lt 50 or 0 lt Left Colour Sensor Reading lt 60 How do you program 255 255 255 255 255 0 360 Oo 1000 lt Maad Condition v US _Left lt 40 II CS_Left lt 60 RoboErectus Virtual Simulator Software RE VSS CSR User Guide 41 Advanced Robotics amp intelligent Control Centre Advanced Actions The advanced actions are used for more complicated c
34. 4B4 0034B4 0034B4 0034B4 0034B4 0034B4 0034B4 0034B4 0034B4 0027BC 0034B4 0034B4 0034B4 0034B4 0034B4 0034B4 0034B4 0027BC 0034B4 0034B4 0034B4 0034B4 0034B4 0034B4 001812 0034B4 0034B4 001862 0034B4 0034B4 0034B4 0034B4 001814 0034B4 0034B4 001862 0034B4 0034B4 0034B4 0034B4 0034B4 001C62 00182A 0034B4 0034B4 0034B4 0034B4 0034B4 0034B4 001c62 00182A 0034B4 0034B4 Enabled Hex Only PICkit Z Fig 10 8 Downloading program to Real Robot Step 12 Remove the PICKit 2 and test the program 10 3 3 Testing Step 1 Power on the robot Step 2 Select the real robot from the Robot Section segment in the Robo Control Panel The real time sensor readings will be displayed RoboErectus Virtual Simulator Software RE VSS CSR User Guide 81 Advanced Robotics amp intelligent Control Centre Step 3 You can also control the robot in the competition panel p Robot Fed Category Finan Blue Team Red Team LUCKY STAR 100 100 nani aaa Load Load Blue Team Al Team Al Load Red Team Al Red Team Al en Game Game Pause Fig 10 9 Real time control of real robot The sensor reading are displayed on the LCD panel attached on the controller board The two rows display segments shows eight readings ss Left colour sensor Right colour sensor Compass sensor Front ultrasonic PRowi 0 Front ultrasonic Back ultrason
35. Contents box e Click each one in the list and locate them from the respective directory If you are not sure the exact location of the file use search function in Windows to find e Use the browse button to set them to the proper files in the MPLAB IDE subfolders When you finish click Next RoboErectus Virtual Simulator Software RE VSS CSR User Guide 71 Advanced Robotics amp intelligent Control Centre Step 4 Naming a new project and put it into a folder Project Wizard Step Three Cigala a New project or reconfigure he actyve project 3 Create New Project File C Projects 4 Project mop Fig 9 6 Name Project In this example we will create a sample project will be called C Projects MyProject Type this into the text box and then click Next You will be prompted to create the directory since it does not exist Click OK Step 5 Adding files Select the necessary files Gmotherboard o motherboard h main c and main h and click Add to add them into the right panel Project Wizard Step Four Add msing Mes your project O Microsot Robotes Studio le _ AC Proects My Projects ymain c 4 Program Files Add gt gt AC Provects My Projects ynain A 5 Projects A O Propects My Projects noth erboare CJ My Projects AC Projects My Projects natherboarc E CI sowece tes Remaye D mene D manh D mono D mohaibaowdce D motherboard h D
36. Environment IDE 1s a comprehensive editor project manager and design desktop for application development of embedded designs using Microchip PIC MCUs and dsPIC DSCs MPLAB IDE provides the ability to e Create and edit source code using the built in editor e Assemble compile and link source code e Debug the executable logic by watching program flow with the built in simulator or in real time with in circuit emulators or in circuit debuggers e Make timing measurements with the simulator or emulator e View variables in watch windows e Program firmware into devices with device programmers for details consult the user s guide for the specific device programmer 9 1 2 PICkit 2 MCU Programmer Debuger The PICkit 2 Development Programmer Debugger is a low cost development programmer It is capable of programming most of Microchips Flash microcontrollers and serial EEPROM devices Fig 9 1 PICkit 2 RoboErectus Virtual Simulator Software RE VSS CSR User Guide 67 Advanced Robotics amp intelligent Control Centre 9 2 Installation 9 2 1 Install Uninstall MPLAB IDE To install MPLAB IDE on your system e If installing from a CD ROM place the disk into a CD Drive Follow the on screen menu to install MPLAB IDE If no on screen menu appears use Windows Explorer to find and execute the CD ROM menu menu exe e If downloading MPLAB IDE from the Microchip website www microchip com locate the download zip
37. OM drive In a few moments the introductory screen should appear Follow the directions on the screen for installing the PICkit 2 Programming Software If the introductory screen does not appear browse to the CD ROM directory and select the Setup exe program To install the PICkit 2 on your system e Select Start gt Settings gt Control Panel to open the Control Panel e Double click on Add Remove Programs Locate amp select the PICkit 2 e Click uninstall button to uninstall it from your system 9 3 Running MPLAB IDE To start MPLAB IDE double click on the icon installed on the desktop after installation or select Start gt Programs gt Microchip gt MPLAB IDE v8 xx gt MPLAB IDE A screen will appear displaying the MPLAB IDE logo followed by the MPLAB IDE desktop as shown in Fig 9 2 ws E Fig 9 2 MPLAB IDE Desktop RoboErectus Virtual Simulator Software RE VSS CSR User Guide 69 Advanced Robotics amp intelligent Control Centre In order to create code that is executable by the target PIC Microcontroller unit source files need to be put into a project The codes can then be built into executable code using selected language tools assemblers compilers linkers etc In MPLAB IDE the project manager controls this process All projects will have these basic steps 1 Create Project 2 Select Device 3 Select Language Tools 4 Put Files in Project 5 Create Code 6 Build
38. PFF PFFF FFFF FFFF FFFF FFFF FPFF Export Hex File 020 FPPP FPFF PREF PFPPP PFFF Frere PPFP frre 030 PFFFPF PFFFF FFFF PFFF FFFF PFFF FFFF FPFF PICkit 2 040 FFrF FPFF PFFF FFFPF FRPP Ferrer FPEF FPPP wv Fig 10 7 Import HEX file Step 11 Download the program to real robot by clicking the Write button The message Programming Successful will be displayed upon successful downloading RoboErectus Virtual Simulator Software RE VSS CSR User Guide 80 PUeteh File Device Family Programmer dsPIC30 Configuration Enabled Hex Only Advanced Robotics amp intelligent Control Centre PICkit 2 Programmer Device User IDs Checksum dsPICSOF6014A E788 Program Memory 040100 0034B4 0034B4 0034B4 0034B4 0018F2 0034B4 0034B4 FFFFFF 0034B4 0034B4 0034B4 0034B4 0018F2 0034B4 EEPROM Data 000000 0034B4 002086 0034B4 0010BC 0019324 0034B4 0034B4 FFFFFF 0034B4 002086 0034B4 0010BC 0019324 0034B4 Source 0034B4 0034B4 0034B4 001088 001BEC 0034B4 0034B4 0034B4 0034B4 0034B4 0034B4 001088 001BEC 0034B4 0034B4 Tools View Help Configuration C703 003F 8730 310F 330F 0007 C003 AN MICROCHIP VDD PICkit 2 On MCLR C tilow_educationalrobot RE2009PIC_hex 0034B4 0017D4 001B92 0034B4 0034B4 0034B4 0034B4 0034B4 0034B4 0017D4 001B92 0034B4 0034B4 0034B4 0034B4 0034B4 0034B4 0034B4 0034B4 0034B4 0034B4 0034B4 003
39. Project 7 Test Code with Simulator 9 3 1 Creating a Project A project is the way the files are organized to be compiled and assembled A project can be created using the Project Wizard Step 1 Choosing Project gt Project Wizard Project Wizard Welcome This wren halgu you Creale cantous 6 new MPLAB DE To continue check Meat dere a Cancel a Help Fig 9 3 Project Wizard Welcome From the Welcome dialog click on Next to advance RoboErectus Virtual Simulator Software RE VSS CSR User Guide 70 Advanced Robotics amp intelligent Contr ol Centre Step 2 Selecting a device Project Wizard Step One Selects dewce Fig 9 4 Project Wizard Select Device From drop down list choose the dsPIC30F6014A and follow by clicking on Next to proceed to setup a programming language Step 3 Setting up a programming language Project Wizare Step Iwo Select 2 Genguage toolsute Actve Toolsutts Mictoctp CID Toctsute Todlevis Cotter MPLAB ASM Asserstyiee oJ 0s eee v 12 MPLAS LINK IO Object Linker pic Md ame v9 12 Swee too ocohoees in orciect Helpi My Sune lar t Litad MIShow al notated teotsutes Back E Cancel Fig 9 5 Project Wizard Select language tools e Select Microchip C30 Toolsuite in the Active Toolsuite list box Then MPLAB C30 C compiler pic30 gcc exe v3 25 should be listed in the Toolsuite
40. S CSR as shown in Fig 7 1 is designed for participants in three different levels If you are a new programmer without any programming knowledge and skills the RE VSS CSR provides a perception action based programming techniques which allows you to write a simple program using the graphical programming interface to control the robot If you have experience in using Lego NXT VEX or other robot platforms your knowledge in programming will help you to program the CoSpace robot with ease as the RE VSS CSR provides advanced programming techniques The RE VSS CSR also provides a C programming interface which enables professional programmers to test the AI strategy using the CoSpace platform ay Al Development Pane l Project A Copyright Warning Rebotup Management 2011 Robo Erectus All rights reserved s No part of this system and its training material should be copied and Section used for commercial product and training State Manager Type Conditions Statement Programming Management Section Section Advanced Condition amp amp Actions Duration 1 Fig 7 1 RE VSS CSR AI development environment The RE VSS CSR AI programming interface consists of 3 sections 1 e project management section statement management section and the programming section RoboErectus Virtual Simulator Software RE VSS CSR User Guide 20 Advanced Robo
41. T Videos jE Computer Sev Win7 C et Data D th Network t Filename My First Project smp State Machine File smp v Fig 7 4 Load a project 7 2 3 Savea project This function is to save a project The project file has an extension of smp To save a project click the bes button The project can be loaded for editing using Load a project function The saved project will have the same file name as the project name by default You may wish to save it as another project by simply changing the project name Save Project ProjectName My First Project ProjectFolder C Users s24441 Microsoft Robotics Dev Studio 2008 R3 CoSpace DIYWheel Project My First Project Fig 7 5 Save a project RoboErectus Virtual Simulator Software RE VSS CSR User Guide 22 Advanced Robotics amp intelligent Control Centre 7 2 4 Build a project This function is to build a project The built project has an extension of dll The built project can be loaded in the control panel via loading AI function To build a project click the button 7 2 5 Defineanew variable The RE VSS CSR has a set of pre defined variables They are Duration bGameEnd CurAction and CurGame In addition to the pre defined global variables additional variables can be added for the project Click on the Add Variable to add a variable All parameters such as variable name initial
42. ae _ Fig 6 1 RE VSS CSR control panel 6 1 The Robot Control Panel Fig 6 2 shows the robot control panel In this panel you are able to e View the real time sensor feedback of a selected robot e Control real virtual robot s via dashboard or game controller RoboErectus Virtual Simulator Software RE VSS CSR User Guide 11 Advanced Robotics amp intelligent Control Centre RE VSS CSR Control Panel oo gt Ay Copyright Warning Rebotup 2011 Robo Erectus All rights reserved No part of this system and its taring material should be copied and Robot Selection Real time Sensor Feedback Robot Control Fig 6 2 RE VSS CSR Robot Control Panel RoboErectus Virtual Simulator Software RE VSS CSR User Guide 12 Advanced Robotics amp intelligent Control Centre Robot selection Fig 6 3 shows the robot selection It allows user to select a robot and view the real time sensor reading The real robot will only be selected once it is connected to the server Select Robot Blue Virtual Fig 6 3 Robot selection Real time sensor feedback Fig 6 4 shows the real time sensor feedback segment It allows users to monitor the real time sensor readings when the selected virtual robot navigates through the 3D virtual environment or the selected real robot moves in the real world Sensors Reading of front ultraso
43. ation form in order to launch the VSE The quick user guide for the Virtual Simulation Environment is attached in Appendix A RoboErectus Virtual Simulator Software RE VSS CSR User Guide 8 Advanced Robotics amp intelligent Control Centre 4 CoSpace Virtual Robot The platform supports all types of real robots equipped with the RE controller board It can be integrated with Lego brick Vex components and other commercial sensors servos and motors The CoSpace virtual robot RE VWheelie02 is equipped with 4 ultrasonic sensors 2 colour sensors and 1 compass sensor as shown in Fig 4 1 They are used to detect obstacles boundaries colour objects and direction Left Ultrasonic Sensor Front Ultrasonic Sensor Right Ultrasonic Sensor Compass Sensor Left Colour Sensor Right Colour Sensor Fig 4 1 CoSpace virtual Robot RE V Wheelie02 RoboErectus Virtual Simulator Software RE VSS CSR User Guide 9 Advanced Robotics amp intelligent Contr ol Centre 5 3D Virtual Environment Fig 5 1 shows the 3D virtual environment for the CoSpace Rescue Challenge It consists of two virtual robots some obstacles and a set of different coloured objects The information centre displays the current date and time the team name and the score Information Board ce Rescue C SP mete Rbetep AE Rod 0 0 0 0 Virtual Robot Virtual Object Obstacles Fig 5 1 RE
44. communicates with the virtual control competition panels via ZigBee communication protocol Hence it is necessary to make sure that the ZigBee modules are connected to the real robot and the computer properly If this 1s your first time using ZigBee you need to install FT232R USB UART Driver for the ZigBee module Appendix B shows the procedures of determining the correct com port connected with the ZigBee module 10 2 Manual Control of Real Robots 10 2 1 Connecting the real robot Step 1 Identify the com port ID used to connect the ZigBee module Step 2 Double click the robot icon in the control panel as shown in Fig 10 1 Virtual Virtual Real Real Robot 1 Robot 2 Robot l Robot 2 Control otro D e Se TZ weer a ae a oa es ap d d Game Controller 2 x x x d d Fig 10 1 Robot control configuration Step 3 Assign the correct com port and robot ID in the pop up window The robot ID must be unique It has to be the same as the robot ID assigned to the real robot RoboErectus Virtual Simulator Software RE VSS CSR User Guide 76 Advanced Robotics amp intelligent Control Centre E Connect Real Robot Robot Name Real In Hot Seno Pon CONF v ID 7 v Cenc OK Fig 10 2 Connect real robot window 10 2 2 Testing Step 1 Double click on the blue cross button as indicated in Fig 10 3 It will turn to green tick once it is connected Cont
45. de e Open Manifest Load a service manifest e Create Embedded Resources Creates a single saved file containing all effects textures meshes etc e Capture Image As Save the current view of the simulation to a file RoboErectus Virtual Simulator Software RE VSS CSR User Guide 84 Advanced Robotics amp intelligent Control Centre e Exit Exits the simulation and shutdown its Decentralized Software Services DSS node The Simulator will remember the window size and position for the next time it is Started The Entity Menu The Entity Menu ts only visible when you select Edit from the Mode menu e Undo Undoes the previous change e Redo Repeats the last change that was undone e Cut Removes the currently checked entities e Copy Copies the currently checked entities e Paste Adds the last cut or copied entities back into the scene e Paste As Child Pastes the last cut or copied entities as a child of the currently checked entity e New Displays a dialog that enables you to create a new entity e Load Entities Loads entities from a file e Save Entities As Saves the currently checked entities to a file The View Menu e Playback bar Displays the playback bar for recording and playing back recorded sequences e Status bar Displays or hides the status bar The status bar shows you the current frame rate in frames per second the simulation time as well as the current camera position and look at
46. eedback value from the compass sensor e Time Time sequence RoboErectus Virtual Simulator Software RE VSS CSR User Guide 34 Advanced Robotics amp intelligent Control Centre You can also use self defined variables RE VSS CSR uses a perception based programming strategy You just need to specify the conditions and action Fig 7 26 shows the condition action panel Copyright Warning Rebotup 2011 Robo Erectus All nghts reserved No pert of this system and its training material should be copied and used for commercial product and training States Statement State Manager Type Exit Condition Conditions Sensor Min Value Max Value Pe ee al I i ee ee ee 1 US_Front a a l l l 1 US_Back ho 255 7 I I I e e Edit Max Value s US_Left He i aes l I I I I CS_Left a on 1 255 i I l I l 2 Compass rie 389 I l Time Fie li 1000 ee ee Ea ee Advanced Condition amp amp Actions Duration 1 i Game End F Wheel_Left 5 Wheel_Right 5 e e Set motor speed e LED_1 0 Set LED mode Advanced Action Fig 7 26 Programming panel The simple conditions can be defined using the slider to specify the data range Condition 0 lt Front Ultrasonic Sensor Reading lt 50 How do you program Condition How do you program RoboErectus Virtual Simulator Software RE VSS CSR User Guide 35 Advanced Robotics amp intelligent Control Cent
47. entity If any component of the rotation vector is selected the entity is constrained to rotate only along that axis RoboErectus Virtual Simulator Software RE VSS CSR User Guide 88 Advanced Robotics amp intelligent Control Centre Using an Xbox Controller If you have an Xbox Controller connected to your PC you can use it to control the camera as well The two thumbsticks on the controller can be used to move the camera around Note that you must press and hold the Left Shoulder button just above the left thumbstick while you are moving the camera This is not immediately obvious The movement of the camera is controlled using the left thumbstick and the right thumbstick is used to pan and tilt the camera as follows with Left Shoulder held down Left Let o Move to the left slide sideways IMPORTANT NOTE If you are using another application that uses the Xbox Controller such as the Simple Dashboard you must make sure that the Simulation window has the input focus in order to use the controller to move the camera Click inside the simulation window with the mouse to give it focus A blue border appears around the simulation area when it has focus If another application has the focus then you cannot control the simulation camera using the Xbox Controller The simulation coordinate system The simulator uses a right handed coordinate system The Y axis represents elevation above the ground plane The X and Z axes are
48. erent computers Users have to identify the com port connected with Zigbee module RoboErectus Virtual Simulator Software RE VSS CSR User Guide 92 Advanced Robotics amp intelligent Control Centre Appendix C RE VSS CSR Directory Structure The files such as entity property wheeled robot programming humanoid robot gait tuning data performance file etc are automatically organized by default if you do not change the file location manually All files are stored in the Microsoft Robotics Developer Studio 2008 R3 directory To access it l Click on Start gt All Programs gt Microsoft Robotics Dev Studio 2008 R3 gt Robotics Developer Studio Expend the Microsoft Robotics Developer Studio 2008 R3 directory you will be able to see the CoSpace file directory where the user guide icon all files associated with the virtual environment virtual robot and manifest files etc for CoSpace Dance are located as shown in Fig C 1 EE ar Microsoft Robotics Dev Studio 2008 R3 E CoSpace a G Dance Media I Property S DIYBiped Design i Gait E DIY Wheel D Design G Project C MyAI RealAl C VirtualAl Q Entity Fig C 1 The structure of CoSpace Directory RoboErectus Virtual Simulator Software RE VSS CSR User Guide 93 Advanced Robotics amp intelligent Control Centre The CoSpace directory contains four subdirectories Dance DIY Biped DIY Wheel and Entity Dance Not
49. et teeeorl 44 case 0 Wheel Wheel LED 1 break case 1 Wheel Wheel LED i break default break Advanced Robotics amp intelligent Control Centre Left 0 Ragnr 0 0 Left 2 Rignt 2Z 0 RoboErectus Virtual Simulator Software RE VSS CSR User Guide 45 Advanced Robotics amp intelligent Control Centre ai c is a C program It is generated according to the graphical programming The ai c can be further modified and then be compiled and downloaded onto the real robot The real robot will perform in the real environment according the program edited in the environment PIITEIT IF LLII LIII The ID It must be three digital number Valus Se R k Y GIR tooo OOO 15 reserved char Al MyID 3 002 TPIT TIA TIA TITS ETAT TPIT TI define true 1 define false 0 eae int Tat int int Ine IAE int int int Ine int TAC IAC int int int int AI MotorType 0 Duration 0 SuperDuration 0 bGameEnd false CurAction 0 CurGame 0 US Front US Back 0 US Left 0 US Mahi 0 C o Oh F iess Amey Time 0 Dee aE mecel Ragin 07 ima 1 OF AI SensorNum 7 void SetGameID int GamelID ie Ine oem el ne eine Ket int CCP int ADC int compass int play time RoboErectus Virtual Simulator Software RE VSS CSR User Guide CurGame GamelD bGamekEnd false GetGamelD
50. ew state double click the and specify the new state Fig 7 20 Add a new state The new state name can only contain a z A Z and 0 9 Delete a state To delete a state highlight the state you wish to delete and click the Date l Save a state Just simply click on the See button The state manager window will be closed and the states will be saved Define an exit action condition In this platform we can define the exit condition based on the sensor readings from 4 ultrasonic sensors Ultrasonic Sensor Front Ultrasonic Sensor Back Ultrasonic Sensor Left Ultrasonic Sensor Right 1 Direction Sensors 2 colour sensors Colour Sensor Left Colour Sensor Right time sequence and other self defined variables For example Sensor Min Value Max Value a Sako iy specifies the ultrasonic front sensor reading is in between 10 and 50 cm That means that distance between the front obstacle and the front ultrasonic sensor is in between 10 50 cm h Man Value Ma Vabue sensor CS Left 30 Eg yi specifies the left colour sensor reading is in between 10 30 RoboErectus Virtual Simulator Software RE VSS CSR User Guide 31 Advanced Robotics amp intelligent Control Centre a State Manager aisa Gital am Fig 7 21 Define a state Fig 7 21 shows the front ultrasonic sensor reading is in between 10 50 and left colour sensor reading is in
51. hown in Fig 7 8 Rc a My Project AI Development Panel Th lt gt a Controler Board RECS 7 Ready 06 00 Fig 7 8 New team nme is displayed RoboErectus Virtual Simulator Software RE VSS CSR User Guide 24 Advanced Robotics amp intelligent Control Centre 7 2 7 Select a controller board There are two types of controller board RE CSO1 board and RE CS02 board for Lego sensors and motors are used for the CoSpace robot You can select the controller board used from the dropdown list as shown in Fig 7 9 z era a a My Project Al Development Panel S lS e Controller Board REA RE CS02 LEGO Fig 7 9 Select a controller board 7 3 Statement Management Section Fig 7 10 shows the statement management section In this section you are able to e Add anew statement and a new subroutine e Define the statement type and state fale 7 A Copyright Warning gt la 2011 Robo Erectus All nghts reserved Controller Board RE CSO1 No part of this system and its training material should be copied and used for commercial product and training Lucky Game 0 Statements States Statement State Manager Type Default Conditions Fig 7 10 Statement management section The RE VSS CSR CoSpace platform uses sequential programming technique The compiler executes the program statements sequentiall
52. ic i ultrasonic oe 8 ultrasonic sensor sensor sensor sensor rwa to SOSH RoboErectus Virtual Simulator Software RE VSS CSR User Guide 82 Advanced Robotics amp Intelligent Control Centre Appendix A User Guide of Virtual Simulation Environment A1 Starting Visual Simulation Environment The Visual Simulation Environment VSE provides simulates physical objects and their interactions including collisions friction and gravity It requires a reasonably powerful graphics card Please check the requirements below and ensure that your computer satisfies them For best performance hide or close all pop up windows that may appear on top of the simulation window Microsoft Visual Simulation Environment Graphics Card Requirements e Minimal Requirements Graphics card supporting DirectX 9 0c or later and Shader Model 2 0 with 64MB of video memory or greater Examples include ATI Radeon 9800 or NVIDIA FX series or later e Recommended Requirements Graphics card supporting DirectX 9 0c or later and Shader Model 3 0 with 128MB of video memory or greater Examples include ATI Radeon x1300 or NVIDIA 6 series or later e Minimal Requirements to use GPU Accelerated Physics NVIDIA GeForce 8 GeForce 9 or GTX 200 series GPU or later 256MB of video memory or more required Starting Simulations To start VSE select one of the entries in the VSE folder under Microsoft Robotics Developer Studio in the Start menu All
53. ig 6 6 Robot control configuration Fig 6 6 shows that the real robots and game controller are not connected Session 10 shows the procedure of connecting a real robot to the CoSpace server Dashboard and Game Controller The dashboard and game controller are used to control both real and virtual robots movement in their corresponding real world and 3D virtual environment The sensor feedback segment will display the real time sensor reading during the robots navigation RoboErectus Virtual Simulator Software RE VSS CSR User Guide 15 Advanced Robotics amp intelligent Control Centre gt 8 6 2 Competition Control Panel The Competition Control Panel as shown in Fig 6 7 is used for both virtual and real CoSpace Rescue competition an ee SH We RE VSS CSR Control Panel ao Sm e Ay Copyright Waring Rebotup 2011 Robo Erectus All rights reserved No part of this system and its taring material should be copied and Competition Arena Scoreboard Virtual Game Real Game Programming Interface Penalty Game Control l l l l l l l l l l l l l l l l l l l m l l l l l l I Fig 6 7 Competition Control Panel RoboErectus Virtual Simulator Software RE VSS CSR User Guide 16 Advanced Robotics amp intelligent Control Centre Competition arena The interactive competition arena allows you
54. ing of a robot Students will be able to program a robot to perform its mission in both real and virtual environment using this educational package The RE VSS CSR offers hands on technological experience to motivate young minds to learn and share knowledge with fellow participants It also helps in the social and emotional development of the students as they work together in groups and build inter personal skills required for their successful future in the real world RoboErectus Virtual Simulator Software RE VSS CSR User Guide 7 Advanced Robotics amp intelligent Control Centre 3 Visual Simulated Environment The Visual Simulation Environment VSE simulates physical objects and their interactions including collisions friction and gravity To launch the RE VSS CSR you need to double click the icon on desktop Fig 3 1 shows the Visual Simulation Environment VSE for CoSpace Rescue It consists of many virtual entities such as virtual robots a rescue arena ground sky sun and camera invisible etc Mrt y fe Yow fete Cmos Byes Mem fsp o gt Renty 06 00 Fig 3 1 Microsoft visual simulation environment When the simulator is running in the Visual Simulation Environment you can move the camera viewpoint by dragging the mouse pointer across the screen It does not change the camera position but it changes the point that the camera is looking at You will need to fill up a registr
55. ion Left wheel speed 0 Right wheel speed 0 LED is on Gone ole ii a 2011 Robo Erectus All nights reserved Controller Board RE CSO1 hd No part of this system and its training material should be copied and f used for commercial product and training E RE Game 0 Statements States Statement fe Left Sensor Found Object State Manager Type Default Exit Condition Conditions 3 Duration 32 ij Game End Wheat wheat rat eo fo Advanced Action Fig 8 21 RoboErectus Virtual Simulator Software RE VSS CSR User Guide 64 Advanced Robotics amp intelligent Control Cent Pia ig vecwwic 6 Add a new statement Right Sensor Found Object Type Default Action Condition Right colour sensor reading is less than 42 Action Left wheel speed 0 Right wheel speed 0 LED is on es py ER ah tail po tao et OE ok 5 Al Development Pane ol eid gt la ee Rebotup 2011 Robo Erectus All nghts reserved Controller Board RE CS01 hd No part of this system and its training material should be copied and used for commercial product and training E RE Game 0 Statements States Statement ae Se State Manager Type Default Exit Condition Right Sensor Found Object Conditions Duration 32 Wheci_Let eo o 4 Advanced Action Fig 8 22 RoboErectus Virtual Simulator Software RE
56. irtual Simulator Software RE VSS CSR User Guide 60 Advanced Robotics amp intelligent Control Centre Action Left wheel speed 1 Right wheel speed 1 DERE hae Rebotup 2011 Robo Erectus All nghts reserved Controller Board RE CS01 No part of this system and its training material should be copied and used for commercial product and training E RE Game 0 Statements States Statement State Manager Type Non_Intem v Exit Condition Conditions Sensor 1 US_Front na a 1 US_Back m i 1 US_Left ra ca o 4 mi Oo 1000 lt lea Advanced Condition amp amp lt 170 Il Compass gt 190 amp amp Compass lt 360 Actions Duration 1 GameEnd F C Whedieh Lr Where rr ge Advanced Action Fig 8 17 RoboErectus Virtual Simulator Software RE VSS CSR User Guide 61 Advanced Robotics amp Intelligent Control Centre gt 8 5 Add anew statement Stop Type Default Action Condition No restrictions Action Left wheel speed 0 Right wheel speed 0 a MyBct Al Development Pon Om yer 2011 Robo Erectus All nghts reserved Controller Board RE CS01 hd No part of this system and its training material should be copied and used for commercial product and training E RE Game 0 Statements States Statement Conditions Duration EE y Game End E Wheel_Len
57. kwards Negative Value Negative Value e Define robot moving speed Speed Setting Motor Speed dp SSS Robot moves at 20 of its full speed Robot moves at 40 of its full speed Robot moves at 60 of its full speed Robot moves at 80 of its full speed Robot moves at full speed e Set LED display LED off e Duration Duration is used to specify the duration for the action The action will be continuously executed for the period that is specified in duration The unit for duration is 60ms e Game End If the Game End box is checked the entire game will end when this statement is executed RoboErectus Virtual Simulator Software RE VSS CSR User Guide 38 Advanced Robotics amp intelligent Control Centre Actions Robot moves forward with 40 of the full speed for 120 ms How do you program Duration J Game End F Oe Cs Qe Gs Actions Robot moves forward with 40 of the full speed for 120 ms while LED is flashing geeeeceaeeeceeasesceaaseeacaeeceeececa How do you Duron Mf Game End F program Queue Fo Omosa Fe a LED 1 aooo y Actions Robot moves forward with 40 of the full speed for 120 ms At mean time The internal variable Alpha is set to 5 a ee ee a EE O How do
58. l Centre 2 Microsoft Robotics Developer Studio MRDS and Robo Erectus Virtual Simulator Software for CoSpace Rescue Microsoft Robotics Developer Studio MRDS is a development platform for the robotics community supporting a wide variety of users hardware and application scenarios MRDS is not a tool to program code that will execute directly on the microcontroller of a robot Instead researchers and scientists can use MRDS to develop a user friendly graphical interactive programming interface and virtual environment for their own robots Students without programming experience can then use the programming interface and virtual environment developed to program and control both real and virtual robots The high resolution visual simulation environment that integrates 3D software physics supplied by the Ageia Technologies PhysX engine let students have an actual virtual 3D or CoSpace experience The virtual robot and the user friendly interactive programming interface the Virtual Simulator Software for CoSpace Rescue RE VSS CSR is developed by the Advanced Robotics and Intelligent Control Centre ARICC a Technology amp Innovation Centre in Singapore Polytechnic This educational package is powered by Microsoft Robotics Developer Studio It gives users an opportunity to work with both virtual and real robots The RE VSS CSR platform provides a venue for users to understand the physical structure sensors motors and the programm
59. nic sensor cm Reading of back ultrasonic sensor cm Reading of left ultrasonic sensor cm Reading of right ultrasonic sensor cm Reading of left colour senor Reading of right colour sensor Reading of compass sensor degree Timer second Fig 6 4 Real time sensor feedback RoboErectus Virtual Simulator Software RE VSS CSR User Guide 13 Advanced Robotics amp intelligent Control Centre Robot control The robot control segment as shown in Fig 6 5 provides the real time control of virtual real robots via a build in dashboard controller and external game controller Virtual Virtual Real Real Robot 1 Robot 2 Robot l Robot 2 Control Dashboard 1 lt ZG Dashboard 2 ae R Game Controller 1 oa i lt 5i Game Controller 2 sA x d Fig 6 5 Robot control segment The configuration in Fig 6 5 shows that the virtual robot 1 is controlled by Dashboard 1 and virtual robot 2 is controlled by dashboard 2 If you wish to use Dashboard 1 to control the virtual robot 1 and 2 you just simply click on the corresponding which connects virtual robot 1 and 2 and change it to The Dashboard 1 will then controls the virtual robot 1 and 2 The Dashboard 2 will only control the virtual robot 2 Fig 6 6 shows the configuration RoboErectus Virtual Simulator Software RE VSS CSR User Guide 14 Advanced Robotics amp intelligent Control Centre Control F
60. novice programmer If you are an experienced programmer the advanced function would RoboErectus Virtual Simulator Software RE VSS CSR User Guide 33 Advanced Robotics amp intelligent Control Centre better suit your needs Of course the package also provides an interface for proficient C programmers to write their own C code Copyright Warning Rebotup 2011 Robo Erectus All rights reserved No pert of this system and its training material should be copied and used for commercial product and training States Statement ime ot contin Conditions Sensor Min Value Max Value 1 US_Front 0 255 i 1 US Back lt ro mee NT i 1 US_Left to mes A i 1 US_Right i to 35 i i cto 0 255 i KD cS_Rioht l o 255 i 2 Compass an 360 Time o 1000 Advanced Condition amp amp Actions Duration 1 Mr Game End F Wheel_Left 5 Wheel_Right 5 e LED_1 0 Advanced Action Fig 7 25 Graphical Programming Interface 7 41 Basic conditions The following sensors readings are used for specifying conditions e US_Front feedback value from the front ultrasonic sensor e US_Back feedback value from the back ultrasonic sensor e US_Left feedback value from the left ultrasonic sensor e US_Right feedback value from the right ultrasonic sensor e CS_Left feedback value from the left colour sensor e CS_Right feedback value from the right colour sensor e Direction f
61. ny schools have their own robotics lab for extra curricula activities but most schools still lack the resources Students may not be able to own a robot all by themselves If it can be shown that robotics has sustained potential in education the virtual robot and easy programming tool will give students an alternative platform for learning in the area of robotics Fig 1 1 Students participating in RoboCupJunior CoSpace Rescue Demo Challenge RoboCupJunior CoSpace Rescue Challenge is an educational initiative to promote knowledge and skills in engineering design programming electronic control and the 3D simulation through robotics for young minds The CoSpace Challenge aims to fuse real and virtual robotic technologies towards bridging two prominent areas of the future namely Interactive Digital Media and Robotics In CoSpace Rescue Demo Challenge treasure hunt challenge a treasure map with a list of treasures will be provided to each participating team The team has to develop appropriate strategies for a virtual autonomous robot to navigate through the treacherous terrain by avoiding obstacles and collecting treasures in the 3D virtual environment while competing with another robot that is performing the same mission The strategies will then be applied to a real robot to search the treasures in the real world RoboErectus Virtual Simulator Software RE VSS CSR User Guide 6 Advanced Robotics amp intelligent Contro
62. ombination of actions Advanced Action Actions Robot moves forward with 40 of the full speed for 120 ms Robot moves forward with 40 of the full speed for 120 ms while LED is flashing Robot moves forward with 40 of the full speed for 120 ms At mean time The internal variable Alpha is set to 5 program Please note that when the advanced action is created it overwrites the basic actions for the Same variables RoboErectus Virtual Simulator Software RE VSS CSR User Guide 42 Advanced Robotics amp intelligent Control Centre 7 5 C Programming Interface When a project is built there will be two files namely ai cs and ai c generated automatically e ai cs is a CSharp program It is generated according to the graphical programming The ai cs can be further modified and then be compiled and run in the virtual environment ai cs can be opened using Note Pad or Microsoft Visual Studio net using System namespace Al public static class Al Static int Duration 0 static Static weer Statie static static Staple Static s t aea static static Static static static Sita wae tat SuperDuration 0 bool bGameEnd false Ine int mnt nie aie TTS kn t mnt rnt int a fant PE E CurAction 0 CurGame 0 US Fram 0 WSeBack ao US alo Verh E ovn m CS R19 MURO Compass 0 Time FQ Wheel Stir SV 7 HAYS
63. parallel to the ground plane When facing in the X direction the Z axis is to the right Some modeling tools use a different coordinate system and it is important to export the models rotated in such a way that they appear correct in the simulation environment RoboErectus Virtual Simulator Software RE VSS CSR User Guide 89 Advanced Robotics amp intelligent Cc Control aI Centre OnVYVYECWHR Appendix B ZigBee Communication Module Setup Step 1 Launch the Control Panel Start gt Settings gt Control panel Fe Eat Yew Fovintes Toots bisp CB j srmn D ros Me E rae gre Bex amp b amp b wad 2 oeiy Addtirdwre hit aani saa AEAII Morak Daia ardi Tret Optinra kareys Lpcistes A Ww F a B e EJ Ceris Potter Options Patt riers aS Q Wordnet ged or Ootirs gt et Seater f TS y ma gt n Phos ard Possi Cntions ees a Fed a a7 8 e arrears arc Langage ort adnate Crews 2 TE wetted Soare art 4 overtec own Audo Devers O amp w aoa User Accounts who dovi Ariya Prot Cwriipace Fig B 1 Launch the Control Panel Step 2 Double click on the icon The system properties window appears as shown in Fig B 2 ysiem Properties Mictosalt Windows PF Profesnorssl Verman 2002 Seice Pack 3 Regetered to Stel Singapore Poptechnic 76487 640 0792563 23654 Computer inte R Cot HI Duo CPU TAD 2 666He 771 MHz 296 GE of RAM Physta Ahes Edtennon
64. point e Profiler Brings up the Profiler UI dialog e Look Along Sets the camera view to a specific viewing axis Useful for accurately re orienting the camera after you have moved it around a lot The Render Menu The first four entries in this menu enables you to change how entities in the simulation are rendered You can toggle between these modes using the F2 key e Visual Renders a full 3D view Meshes associated with each entity in the scene are rendered with realistic lighting and shading RoboErectus Virtual Simulator Software RE VSS CSR User Guide 85 Advanced Robotics amp intelligent Control Centre e Wireframe Renders the scene as a wireframe view This mode enables you to get a rough idea of how many polygons make up each mesh and where the polygon edges are e Physics Renders the scene showing physics outlines This mode enables you to see how each entity is modeled in the physics engine The scene is not rendered completely if the physics engine 1s disabled e Combined Renders the full 3D view with physics This mode makes it easy for you to determine how well the physics shapes match the visual mesh for each entity The physics part of this scene is not rendered completely if the physics engine is disabled e No Rendering This option turns off the rendering to economize on CPU time The simulator continues to run e Graphics Settings Enables you to change settings that control how the scene i
65. raphical programming interface for the virtual robots and the real robots It enables the communication between the real robots and the CoSpace server The synchronization of the real robots and the virtual environment virtual robots can be realized using the patform Fig E 1 shows the connection and communication of the CoSpace system ZigBee Com CoSpace Server Fig E 1 CoSpace System In order to program the real robot using the same AI development panel as for the virtual robot all sensors motors and other hardware components must be connected to the controller board RE CSO1 or RE CS02 according to the connection stated in table E 1 Table E 1 The Connection of all Components of a CoSpace Rescue Robot Component Unit RE CS01 RE CS02 LEGO Motor 1 DUO Motor 1 LEGO Wheel Speed scale 5 5 Motor 2 DUO Motor 3 LEGO Ultrasonic CCP2 CCP2 Distance in centimeter Right CCP4 CCP4 Color Sensor Brightness value Right ADC3 ADC3 RoboErectus Virtual Simulator Software RE VSS CSR User Guide 96 Advanced Robotics amp intelligent Control Centre In the AI development panel a prompt message will show you again the correct pin connection when the mouse hover over a ComboBox Slider or TextBox as shown in Fig E 2 Conditions Sensor Min Value Max Value s US Front gii gt 0 is lt E 1 US Back i P E 1 US_Left gi o
66. rated from graphical programming you need to l 2 6 Install Visual C compiler Copy ai cs from the project directory to VirtualAI VirtualAI directory and replace the existing ai cs file Launch the visual C project by double clicking VirtualAI csproj The ai cs will be the part of the project Edit the necessary C code Build solution to generate the DLL file The virtualAI dll is created in VirtualA I VirtualAI bin Release folder The virtual dll file can be loaded AI strategy for real robot If you like to write your own AI strategy in C or modify the ai c generated from graphical programming only GameQ you need to E 2 Install MPLAB and PICKit 2 downloader Please refer to session 9 and 10 Copy ai c from the project directory to realAI directory and replace the existing ai c file Launch the real robot project by double clicking RE2009PIC mcp The ai c will be the part of the project Edit the necessary C code Build ALL to generate update the RE2009PIC hex The RE2009PIC hex is the AI strategy in the machine language Download the RE2009PIC hex to the real robot Session 10 shows the details Observe the real robot performance RoboErectus Virtual Simulator Software RE VSS CSR User Guide 95 Advanced Robotics amp intelligent Control Centre Appendix E Hardware Connection for CoSpace Robot The RE VSS CSR platform provides the same g
67. re Condition 0 lt Left Colour Sensor Reading lt 60 How do you program How do you program You can combine any two or more conditions using the same method Please note that the relationship between these conditions will be Logical AND 0 lt Front Ultrasonic Sensor Reading lt 50 and 0 lt Left Colour Sensor Reading lt 60 How do you program Condition 0 lt Front Ultrasonic Sensor Reading lt 50 or 0 lt Left Colour Sensor Reading lt 60 How do you Use advanced condition program RoboErectus Virtual Simulator Software RE VSS CSR User Guide 36 Advanced Robotics amp intelligent Control Centre Condition 40 lt Back Ultrasonic Sensor Reading lt 80 and Right Colour Sensor Reading gt 100 How do you program 1 US_Righil gt CS Left Condition 40 lt Back Ultrasonic Sensor Reading lt 80 or Right Colour Sensor Reading gt 100 How do you program Condition 0 lt Left Colour Sensor Reading lt 60 and 45 lt Compass Sensor Reading lt 90 How do you program RoboErectus Virtual Simulator Software RE VSS CSR User Guide 37 Advanced Robotics amp intelligent Control Centre 7 4 2 Basic action e Define robot moving direction Movement Left Wheel Right Wheel Robot moves forward Positive Value e g 1 Robot turns right Negative Value e g 1 Robot turns left Negative Value Robot moves bac
68. rol Control Dashboard 1 T T lt Q S 4 p _ f p Fig 10 3 Manual control of a real robot Step 2 Move the dashboard to control the real robot The real robot will move accordingly 10 3 Fully Autonomous Robot 10 3 1 Connecingt the real robot Repeat the steps stated in 10 2 1 to establish the communication via ZigBee 10 3 2 Download the Program into the Real Robot Step 1 Copy the folder RealAI from the CD or from the following website to your own PC RoboErectus Virtual Simulator Software RE VSS CSR User Guide 71 Advanced Robotics amp Intelligent Control Centre Step 2 Substitute the file ai c in the RealAI folder with the new ai c generated The same file name must be retained As the lighting condition in real environment varies and it is certainly different from the virtual world the sensor readings will change Therefore it is important to do a sensor calibration and make necessary changes in the program before downloading it onto the real robot Step 3 Launch the MPLAB workspace and open a project called RE2009PIC mcp Step 4 In order to receive the real time feedback from all sensors during the navigation controlled by a program it is compulsory to change the robot ID in the ai c file eee LVIII IIIA ages amp The ID It must be three digital number Value is from 001 to 999 00O is reserved char AI MyID 3 002 Assign the correc
69. s rendered e Physics View Settings Allows you to select the items that are shown in Physics View The Camera Menu The Camera menu allows you to easily switch between cameras if you have more than one in the scene You can press F8 to quickly switch between cameras e Main Camera Sets the view from the simulated camera provided by default e Other cameras Sets the view from other cameras defined in the current scene Note that there are also options to display cameras in separate windows This allows you to have for example a view from a camera mounted on a robot at the same time as the main view so that you can see not only what the robot sees but also what it is doing This 1s very useful for diagnosing computer vision programs The Physics Menu e Enabled Enables or disables physics forces in the simulation You can also use the F3 key to toggle physics on off e Settings Enables you to control whether default camera is treated as a rigid body and the gravity setting If the camera option is set you can use the camera to bump objects in the scene You can also adjust the simulation speed The Mode Menu e The settings on the Mode menu enable you to change how you can interact with entities in the scene Pressing F5 toggles between the options RoboErectus Virtual Simulator Software RE VSS CSR User Guide 86 Advanced Robotics amp intelligent Control Centre e Run The normal operation mode for running
70. se button Choose Add a new statement within the Bundle or Add a new statement as shown in Fig 7 12 ad My Projers AD al Pa Comtoter Board RECSO1 Confer Soar HECSUT we uw Lazy Gare anamata States Ludy Garnes U Farerams States id ERK ba ae o tes et ries iwiertie Ahia Si b Wa at ov rs oe am dd s Mew treer rdle Add a Now Stators within the Buruile PORTE EIN EEN Add 2 New Burdie wnhin the Bunde ijd 3 Mow Scwle erthey the Bundis Ducts M tirme De Charge kamne or Fig 7 12 Adding a new statement Step 2 Assign a meaningful name to the statement created The new statement will then be added as shown in Fig 7 13 ent Dane Action Name a My Project Al Development Pane ie 4 We strongly suggest you give a gama l d meaningful name to each action For Example Found Ball Controller Board RE CS01 x Action Name MoveForward a Lucky Game 0 Statements amp of MoveForward ok Fig 7 13 Assigning a new statement name The statement type conditions and actions associated with the new statement need to be specified It will be illustrated in later section You can continue to add more statements to the program RoboErectus Virtual Simulator Software RE VSS CSR User Guide 27 Advanced Robotics amp intelligent Control Centre 7 3 2 Addanew subroutine A subroutine also called procedure method function or
71. strictions Action Both wheels speed 2 Tag MyEx2 AI Development Panel ee r ZAF A Copyright warning Rebotup i 2011 Robo Erectus All nights reserved Controller Board RE CS01 X No part of this system and its training material should be copied and used for commercial product and training E RE Game 0 Statements States Statement Uy State Manager Type Default 7 Exit Condition orwal Conditions Min Value gt 21 Duration EE i Game End E Wheel_Let 2 x Wheel_Right 2 g Advanced Action 6 Save project MyEx2 smp The saved project has an extension of smp It can be reloaded for editing 7 Build project MyEx2 dll The built project has an extension of dll This file can be loaded in the control panel for execution 8 Load the MyEx2 dll in RE VSS CSR control panel and start the simulation 9 Monitor the robot performance RoboErectus Virtual Simulator Software RE VSS CSR User Guide 55 Advanced Robotics amp intelligent Control Centre 8 3 Working with compass sensors Task 1 To program a robot to turn 180 until it faces west Method 1 using default action Fig 8 10 Analysis 171 lt Compass Reading lt 190 Turn Right Fig 8 11 RoboErectus Virtual Simulator Software RE VSS CSR User Guide 56 Advanced Robotics amp intelligent Control Centre Procedure 1 Launch the RE VSS CDR 2
72. t robotID Boece ete ee beet eee eo sess eee ees define true 1 define false 0 int AI MotorType 0 Int Duration Step 5 Build the project The message Build Succeeded will appear upon successful building The compiled file will have an extension HEX Fle Edt View Project Deue Programmer Took Configure Window ep Build All ie h u r Ae 38 Reon L A af s Checksum 0xJe47 ene ee 5 m REMEC o ap E C Documents ang Setrings staff iDenktop lewDencet C Matherboord Programa c auh ment manh moteboendch J RENC cp a D Seerte Fis E void Strategy Saini sensor date int LSpeed int RSpesd int LED int Tine int tsEut PET on J TENE TE J Sa es nas US Froni SENI data i g e sani Eii US Gack sensor_data 5 metsecbewtn b US Len sensor datai 2 retary ag US Right sensor data a Chet Ales SoH Direction sensor data tr tee ant CS Lel serso data feet Ame ma am ri i Fig 10 4 Build a project RoboErectus Virtual Simulator Software RE VSS CSR User Guide 78 Advanced Robotics amp intelligent Control Centre Step 6 Power off the robot and Connect the PKCKIT2 to controller board PICKit 2 J N T E meres Fig 10 5 PICKit 2 connection oS iss w Step 7 Launch the PICkit 2 programmer by clicking the PICkit 2 exe Step 8 Choose Tool Check Communication from the menu bar The message PICkit 2 found and connec
73. ted will be displayed in the status bar as shown in Fig 10 6 PICkit 2 Programmer File Device Family Programmer Midrange Standard Configuration No Device Found Configuration O000 Device User IDs FF FF FF FF Checksum FCOO PICK 2 found and connected AN MICROCHIP Doo y oe Jo a ada Program Memory sled Source None Empty Erased Hes Onlu PICkit 2 Fig 10 6 PICkit 2 Communication RoboErectus Virtual Simulator Software RE VSS CSR User Guide 79 Advanced Robotics amp intelligent Control Centre Step 9 Click on Erse button to erase the memory This is to erase the program memory data EEPROM memory ID and configuration bits Step 10 Import the correct HEX file built in step 5 by choosing File Import HEX file function The message Hex file successfully imported will be displayed in the status bar gt PiCkit 2 Programmer x Eie Device Family Programmer Took View Hek Export Hex 1 C t low_educationairobot RE2009PIC hex 2 C C Motherboard Program RE2009PIC hex 3 C C Motherboard Program RE2009PIC hex 4 C C Motherboard Program RE2009PIC hex toka O RC Motedosd Progam v Oo a Se 00000 00010 4 00020 wMmyRecec 00030 Documents 00040 00050 j 00060 Desiinp 00070 00080 00090 nm 000A 00080 n 900c0 000D0 My Computer 00020 5 Paces Fimme REZO he z ime Fapa rete 000 F z fe 010 FFFF F
74. tics amp intelligent Control Centre 7 2 Project Management Section Fig 7 2 shows the project management section In this section you are able to e Create and initialize a new project e Load a project e Save a project e Build a project e Define global variables e Define a team name e Select a controller board a AI Development Panel SEHE a Mother Board ARICE Boa Fig 7 2 Project management section 7 2 1 Create and initialize a new project This function is to create and initialize a new project When a new project is created a project folder will be created in the designated path You may change the path if you wish To create a new project double click on the new project New Project ProjectName My First Project Project Folder C Users s24441 Microsoft Robotics Dev Studio 2008 R3 CoSpace DIYWheel Project My First Project Fig 7 3 Create a new project RoboErectus Virtual Simulator Software RE VSS CSR User Guide 21l Advanced Robotics amp intelligent Control Centre 7 2 2 Load a project This function is to load a project The project file has an extension of smp To load a project click the button The project can be edited after loading a Load Project OO Organize New folder i Ar Favorites Name Date modified lype _ My First Project smp 17 02 2011 12 14 SMP File caw Libraries C Documents a Music fe Pictures
75. to place the virtual robot on to the virtual competition arena by clicking at the designated place in the virtual arena For example if you choose the red robot will be selected and placed on the respective location in the virtual competition arena zl Robot Fed Category op Fig 6 8 Interactive competition arena Scoreboard The scoreboard displays the team names scores and the running clock Blue Team Red Team Test RE Red 100 100 Ready 0 0 Fig 6 9 Scoreboard RoboErectus Virtual Simulator Software RE VSS CSR User Guide 17 Advanced Robotics amp intelligent Contr ol Centre Game control The game control as shown in Fig 6 10 provides the overall control of the competition It allows judges to load the AI strategies and run the game Load Blue Team Al Load Red Team Al Virtual Game Real Game Stop Recet Al Fig 6 10 The game control e Load Blue Team AlI Load Red Team AI to load the AI strategy designated for Blue Team or Red Team The AI strategy is designed via AI Developmnt Panel The AI strategy file has an extension of dll as shown in Fig 6 11 s _ i Ce d DlvWheel gt Project Star a Sa H Organize v New folder jz A aoe sr Pauoites at Name Date modified 5 Star DLL 18 02 2011 1 18 PM ow Libraries C Documents a Music Pictures i Videos Computer Se Win7 C Gis Data D G
76. value variable type etc associated with the variable are to be set as shown in Fig 7 6 al Add Global Variables s oo ae Variables Sc 24 bGameEnd E Basic CurAction AraryLength 0 CurGame Initial Value ai Name VarType Void Name The name of the variable Fig 7 6 Add a global variable Parameter What it means ArrayLength The length of the array if the global variable is defined as an array Set this parameter to be O for other variable types Initial value The initial value of the variable Name Name of the variable It can only contain a z A Z and 0 9 VarType Type of the variable It can be Byte Intl6 Boolean Float String Byte Array and Int16 Array RoboErectus Virtual Simulator Software RE VSS CSR User Guide 23 Advanced Robotics amp intelligent Control Centre Step 3 Click to add the defined variable to the list Step 4 Click we to save If you wish to delete a global variable from the list click on gt If you do not wish to save click on gt 7 2 6 Add a team name This function is to add a team name to the designed project To add a team name click the button Team Name button The team name must be less than 8 characters a Team Name Team Name Lucky on Fig 7 7 Add a team name The added team name will be displayed in the scoreboard as well as in the virtual environment as s
77. wees J Ports COM amp LPT DB Procemmors 5 Secure Dipta host cortrofers T 2 2 2 FF S amp S FE lt gt SA Dever Z Sard viceo onal gare comtrofers Syriam torvces Lrevereal Serud fire controfers m 2 32 eS SS S gt Fig B 4 Device Manager RoboErectus Virtual Simulator Software RE VSS CSR User Guide Advanced Robotics amp intelligent Control Centre Step 5 Double click on the Ports COM amp LPT to identify the port which the Zigbee module is connected ET T1OCT ABI Batteries Rj Pautooth Devices T Corguter See Otek dhes T Depe siper gt DE ATASATAPR cortrofers Sp TELE 1994 Gun Peet corttrofers J hpg devi om Kevborc Mace and other paring divas b i Mijem E Montis EP Nami adapters Bp 1 2 Net Adapter 7 Ep Cio Awlonnect VPN virtud Meport Adapta for Winedoees Be reed S567 Gagebt Metak Comection Be ireete WA Link 5000 AGN E PONIA adapters D Persona ldertF cation Devices Inteka Actie Management Technology SOL COM F D Serial Port Cone gt Process bal Secure Digha host cortrobers Y SM Derver Sarul vdeo ad gare cortroders Syriam threres b Liwversal Sariai Bus controfiers Fig B 5 Device Manager Step 6 Check the com port assigned to the USB Serial Port The COM Port 8 is used in this example Note The com port assigned for Z gBee module is automatically generated by computer It is not the same for diff
78. y in a top down manner Therefore the order of the statements in the program plays a very important role in deciding the priority of statements with the same priority In order to synchronise the real and virtual robots and maintain real time data updating the CoSpace platform RE VSS CSR automatically scans all sensors readings in an interval of 60 ms In other words all the variables associated with sensors will be updated every 60 ms Fig 7 11 shows the program execution flow RoboErectus Virtual Simulator Software RE VSS CSR User Guide 25 Advanced Robotics amp intelligent Control Centre Scan Begins Scan Time 0 Read all sensors value CoSpace Program Re arrange all statements according to the priorities Is the statement with the highest priority executed Is the statement with the 2nd highest priority executed No Default Statement msm eee eee eee eee eee Wait until Scan Time 60 ms Fig 7 11 Program execution flow RoboErectus Virtual Simulator Software RE VSS CSR User Guide Advanced Robotics amp intelligent Control Centre 7 3 1 Add a new statement Statement specifies action A program is formed by one or more statements in sequence Each statement will have an expression Procedure of adding new statement Stepl Select the statement subroutine which you wish the new statement to be appended in the project and then click the right mou
79. your simulation e Edit The mode that enables you to edit state of entities in the simulation This mode automatically disables Physics The Help Menu e Contents Shows web pages that provide more information about how to use the various features and controls of the VSE e About Shows a dialog that displays information about the version of the VSE and also information about the current graphics hardware A3 Visual Simulation Environment Keyboard and Mouse The Visual Simulation Environment VSE simulation window provides keyboard and mouse operations that can be used to control the view and elements in the simulation environment Using the Keyboard The following keys control the movement and orientation of the camera in the simulation environment when the Simulation pane has input focus When the Simulation pane has input focus it is surrounded by a blue border Click inside the pane or press the Tab key until the blue border appears d or Right Arrow Move to the right slide sideways q or Page Up Move up e or Page Down Move down Reset to initial position Note that you can also use the numeric keypad as long as it is not in numeric mode In this case the numeric keys 2 4 6 and 8 act as arrow keys RoboErectus Virtual Simulator Software RE VSS CSR User Guide 87 Advanced Robotics amp intelligent Control Centre If you press the Shift key with these keys the movement keys move 20 times faster
Download Pdf Manuals
Related Search
Related Contents
Untitled - Terasic Ateca AT371EP317 / opera00317 User Manual - Projector Central 月号 - 全国中小建築工事業団体連合会 Honda WH15X/WH20X User's Manual SCOTT RXi 400 WL KVH Industries NS-CLWL01 User's Manual Manuel de l`opérateur Copyright © All rights reserved.
Failed to retrieve file