1 / 29

5 Design a reactive Implementation

5 Design a reactive Implementation . Media Communications laboratory Mohammed Ahmed ID: 201250570. Designing a Reactive Implementation. List the steps involved in designing a reactive behavioral system. Use schema theory to program behaviors using object-oriented programming principles.

chick
Download Presentation

5 Design a reactive Implementation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 5 Design a reactive Implementation Media Communications laboratory Mohammed Ahmed ID: 201250570 Chapter 5: Designing a Reactive Implementation

  2. Designing a Reactive Implementation • List the steps involved in designing a reactive behavioral system. • Use schema theory to program behaviors using object-oriented programming principles. • Design a complete behavioral system, including coordinating and controlling multiple concurrent behaviors. • Describe the two methods for assembling primitive behaviors into abstract behaviors: finite state machines and scripts. Design -Beh. Table -Steps Case Study Coordination -FSA -Scripts Summary Chapter 5: Designing a Reactive Implementation

  3. Overview: Challenges: • Designing behaviors tends to be an art not a science, How to start? • Well designed and tested behaviors, How behaviors are integrated into system? Objective • Constructing a reactive robot system • Object oriented programming approach to design behaviors.(Based on schema theory) • Finite state automata and scripts(Similar to innate releasing mechanism) Chapter 5: Designing a Reactive Implementation

  4. Behaviors as Objects in OOP • Percept: data Structure, Perceptual schema • Abstract behavior:assembled from other behaviors i.e derived • primitive behavior. Chapter 5: Designing a Reactive Implementation

  5. Example: a primitive move to goal behavior • Pick up trash challenge, find coca Can[Red] , then find trash[blue] bin, then repeat • Move to goal behavior • Follow Corridor(PF), Schema Implementation 1. Chapter 5: Designing a Reactive Implementation

  6. Steps in Designing a Reactive Behavioral System Design -Beh. Table -Steps Case Study Coordination -FSA -Scripts Summary Chapter 5: Designing a Reactive Implementation

  7. CSM 1994 UGV Competition • Fully autonomous vehicle, all on-board, navigate a course 10ft wide, about 800ft long • Obstacles • Carry a 20 pound payload (this is from 1996, but it’s a way better picture) Design -Beh. Table -Steps Case Study Coordination -FSA -Scripts Summary Chapter 5: Designing a Reactive Implementation

  8. 1-3. Describe the Task, Robot, Environment • Have to use computer vision… black &white, slow processor speeds (didn’t get to design the robot) • White (bright) should be in the center of the image • Reflections on grass are white, but random so average out • If stay in middle, never encounter an obstacle! • 150ms update rate needed for steering to stay in control at ~1.5mph Camcorder on a Panning mast, going to A framegrabber 33MHz 486 PC running Lynx (commercial unix) Design -Beh. Table -Steps Case Study Coordination -FSA -Scripts Summary Sonar on a panning mast All coding was done In c++ Chapter 5: Designing a Reactive Implementation

  9. 4. Describe how robot should act • Follow the line and stay in the middle • Follow-line[only one behavior was proposed] • Only need the Camcorder! Design -Beh. Table -Steps Case Study Coordination -FSA -Scripts Summary Chapter 5: Designing a Reactive Implementation

  10. 5-6 Refine and test each behavior • Follow-line • Worked with toilet paper (indoors), • Worked with athletic line tape (outdoor) Design -Beh. Table -Steps Case Study Coordination -FSA -Scripts Summary Chapter 5: Designing a Reactive Implementation

  11. 7 Test with other behaviors • “Full dress rehearsal” • Oops, bales of hay are bright compared to grass, change the centroid to cause collision • Go back to step 4: • Follow line until “see” an obstacle, then just go straight until things return to normal • Hard to do visually in real time • Sonar! Look to the side and when something is close, it’s a bale, so go straight Design -Beh. Table -Steps Case Study Coordination -FSA -Scripts Summary Chapter 5: Designing a Reactive Implementation

  12. Final System • Round 1 • OOPS: sonar connection off so it hit the bale • Round 2 • White shoes and dandelions, plus Killer Bale • Demo round • Hill vs. implicit flat earth assumption • Round 3 • Trapped by sand, but $5K richer! Design -Beh. Table -Steps Case Study Coordination -FSA -Scripts Summary Chapter 5: Designing a Reactive Implementation

  13. Main Points • Let the WORLD BE ITS OWN BEST REPRESENTATION and CONTROL STRUCTURE • “line” wasn’t a “line” just centroid of brightest pixels in the image • Pick up trash: if can is in gripper, then go to the recycle bin • Design process was iterative; rarely get a workable emergent behavior on the first try • There is no single right answer • Could have been done with subsumption, pfields, rules, whatever Design -Beh. Table -Steps Case Study Coordination -FSA -Scripts Summary Chapter 5: Designing a Reactive Implementation

  14. Current UGV • This video was presented by Dr. Fish, the Army Chief Scientist at the beginning of his keynote speech at the AUVSI Programs Meeting Ground Day on February 7, 2012 in Washington D.C. Design -Beh. Table -Steps Case Study Coordination -FSA -Scripts Summary Chapter 5: Designing a Reactive Implementation

  15. Recap: Categories of Algorithm Chapter 5: Designing a Reactive Implementation

  16. Assemblages of Behaviors • The prev. Case study was trivial, How to represent the releasers and their interactions into some sort of sequencing logic. • Abstract Behavior: behaviors assembled from several other primitive behaviors • What to do if you have a SEQUENCE of behaviors as well as CONCURRENCY? Chapter 5: Designing a Reactive Implementation

  17. Assemblages of Behaviors • Two equivalent methods • Finite state automata (FSA) • Scripts • Skills: Collect behavior-like primitives called reaction –Action Packages(RAP) into “sketchy plan” which can be filled as the robot excutes • ( and other ways too) • Two approaches: • Stuff the coordination mechanism into a separate controlling program (like a main()) • Hurts portability, adding new behaviors “on top” • Stuff the coordination mechanism into a meta-behavior or abstract behavior using recursive-ness of schemas • Coordination mechanism is the coordinated control program part of the behavioral schema Design -Beh. Table -Steps Case Study Coordination -FSA -Scripts Summary Chapter 5: Designing a Reactive Implementation

  18. Finite state automata (FSA) • Are set of popular mechanism for specifying what a program should be doing at a given time or circumstance. • Represented as state diagram • the designer has to be able to specify a finite number of discrete states(K)that the robot should be in • By convention, START STATE(s, drawn with a double circle.)there is always a Start state, and the robot would always start there. • Inputsare the behavioral releasers, and appear under the column heading σ • third part of the FSM is the transition function, called , which specifies what state the robot is in after it encounters an input stimulus, . • Final State: Terminal task Chapter 5: Designing a Reactive Implementation

  19. FSA: M={K,S,d,s,F} CSM 1994 UGV Competition • K: all the states, each is “q”- behaviors • d: transition function, d(q,s)= new behavior • S: inputs that agent can “see”, each is s– stimulus/affordances/Represented by arrows • Each arrow represents the releaser for a behavior. • q0: Start state(s)- part of K • F: Terminating state(s)- part of K Design -Beh. Table -Steps Case Study Coordination -FSA -Scripts Summary Chapter 5: Designing a Reactive Implementation

  20. FSA representation of the coordination and control of behaviorsin the UGV competition Chapter 5: Designing a Reactive Implementation

  21. A pick up the trash FSA • The Behavior table • Problem with Behavior table, Doesn’t show the sequence and how did the designer come wit h behaviors Chapter 5: Designing a Reactive Implementation

  22. A pick up the trash FSA Chapter 5: Designing a Reactive Implementation

  23. Implementation • One advantage of FSA is that they are abstract, and can be implemented in a number of ways Chapter 5: Designing a Reactive Implementation

  24. FSA Summary • If the robot had many tasks,, the ability to recycle trash would be an abstract behavior, called by the main program whenever the robot needed to recycle trash. In that case, the FSA logic would be placed in the coordinated control Program • Advantages • Formal mechanism • Have to fill in the table, so a way of spotting unforseen effects • Disadvantages • Hard to keep up with implicit behaviors • Ex. Avoid obstacle is often running throughout ALL states, gets tedious to express it formally • Tend to add explicit variable for transitions, rather than rely on emergent behavior from environment • Difficult to show behavioral concurrency Design -Beh. Table -Steps Case Study Coordination -FSA -Scripts Summary Chapter 5: Designing a Reactive Implementation

  25. Scripts • Abstract Behaviors often use scripts • Needs a more Naturalistic Representation and abstraction • Scripts idea from AI(Natural language processing) • There is a primary Causal Chain • default causal chain has 4 components • initialization • e.g. Orient to the correct direction in the corridor • Nominal • Use potential field • Termination • Stopping case • Exceptions • Behaviors are actors cues can index into sequence • Scripts are equivalent to FSA but may be more natural or readable for sequences Design -Beh. Table -Steps Case Study Coordination -FSA -Scripts Summary Chapter 5: Designing a Reactive Implementation

  26. Scripts Design -Beh. Table -Steps Case Study Coordination -FSA -Scripts Summary Chapter 5: Designing a Reactive Implementation

  27. Scripts Summary • for each update... \\ look for props and cues first: cans, trash cans, gripper rStatus=extract_color(red,rcx,rSize); • if(rStatus==TRUE) SEE_RED=TRUE;else SEE_RED=FALSE; • bStatus=extract_color(blue,bcx,bSize);if(bStatus==TRUE){ SEE_BLUE=TRUE; NO_BLUE=FALSE;}else{SEE_BLUE=FALSE; NO_BLUE=TRUE;} AT_BLUE=looming(size,bSize);gStatus=gripper_status(); • if(gStatus==TRUE){ FULL=TRUE; EMPTY=FALSE;}else{ FULL=FALSE; EMPTY=TRUE;} • if(EMPTY){ if(SEE_RED){move_to_goal(red); else wander();} else{grab_trash();if(NO_BLUE) wander();elseif(AT_BLUE)drop_trash();elseif(SEE_BLUE)move_to_goal(blue); }

  28. Scripts Summary • Advantages • A more storyboard like way of thinking about the behaviors • If-then, switch style of programming like FSA • Since a Script is “in” a behavior, other behaviors such as avoid can be running concurrently without having to appear “in” the script • Exception handling is a big plus in Real Life • Disadvantages • Can be a bit of overkill for simple sequences, especially with C++ Design -Beh. Table -Steps Case Study Coordination -FSA -Scripts Summary Chapter 5: Designing a Reactive Implementation

  29. Summary • Design of reactive systems is similar to design of object-oriented software systems • Highly modular, can test behaviors independently • Follows the basic steps in the Waterfall Lifecycle • Describe task, robot, environment, how robot should act, refine behaviors, test independently, test together. • Except lots more iteration, making it more like Spiral • Behavior tables can help keep track of what’s a behavior and its releasers and percepts • Sequences of behaviors, rather than combinations, can be controlled by a separate routine or by adding a routine to the coordinated control program in the behavioral schema • FSA and Scripts are two main methods Design -Beh. Table -Steps Case Study Coordination -FSA -Scripts Summary Chapter 5: Designing a Reactive Implementation

More Related