1 / 19

Behavior Based Control

Behavior Based Control. Institute for Personal Robots in Education (IPRE) ‏. Behavior Based Control. Behavior 2. Behavior 1. Behavior 3. Arbitrator. Robot Actions. Behavior Based Control. Behavior based control allows you (the programmer) to specify robot behaviors.

mostyn
Download Presentation

Behavior Based Control

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. Behavior Based Control Institute for Personal Robots in Education (IPRE)‏

  2. Behavior Based Control Behavior 2 Behavior 1 Behavior 3 Arbitrator Robot Actions

  3. Behavior Based Control • Behavior based control allows you (the programmer) to specify robot behaviors. • Multiple behaviors “fight it out” for control of the robot.

  4. Each Behavior • May use sensor values to determine what to ask the robot to do, or may not. • Makes a recommendation to the arbitrator about what action the robot should take. • or....tells the arbitrator that it doesn't have an opinion.

  5. The Arbitrator • Asks each behavior what the robot should do. • Decides which behavior(s) to use. • Advanced Arbitrators may even allow the robot to do a mixture of different behaviors at the same time!

  6. Implementing a Behavior based control system • You need to specify each behavior...and... • An arbitrator that decides which behavior to follow at any particular point in time and makes the robot's actuators follow that behavior's recommendation.

  7. Problem Statement: • Your robot should move continuously looking for a bright light. When it finds a bright light, it should go towards it. The robot should turn to avoid hitting obstacles.

  8. Finding Behaviors (look for verbs!)‏ • Your robot should move continuously looking for a bright light. When it finds a bright light, it should go towards it. The robot should turn to avoid hitting obstacles.

  9. Summarized: • Move • Look (for light)‏ • Go to the light • Avoid obstacles

  10. Combined/Simplified: • Move • Go towards light • Avoid obstacles

  11. Prioritized: • 1st: Avoid obstacles • 2nd: Go towards light • 3rd: Move

  12. Questions about behaviors • How does the behavior communicate with the arbitrator? • How does it indicate what action it wants the robot to take? • How does it indicate that it doesn't have a recommendation? • All of these questions can be answered by building the Arbitrator.

  13. The Arbitrator • Calls each behavior. • Sees what each behavior wants to do. • Selects the recommendation from the highest priority behavior. • Tells the robot to do that behavior's recommended action.

  14. The Arbitrator/Behavior interface • Each behavior needs to return the same data (in the same order) to the Arbitrator. • You can pick any data and any order you want, but you must be consistent in all of your code. • For this example, we choose to return: • Boolean – Tells if a behavior has a recommendation (True) or not (False)‏ • Translate Value – Float from -1.0 to 1.0 telling the recommended translate amount. (0.0 is stopped)‏ • Rotate Value – Float from -1.0 to 1.0 telling the recommended rotate amount. (0.0 is no rotation)‏ [ True, 0.0, 0.0 ] - Represents a recommendation to stop completely.

  15. Behavior 1: Cruse #Move behavior: Always recommends that the robot move. def move(): return( [ True, -1.0 , 0.0 ] )‏

  16. Behavior 2: Avoid Obstacles #Avoid behavior, makes the robot turn away from obstacles. def avoid(): sensorVals = getIR()‏ leftV = sensorVals[0] rightV = sensorVals[1] if (leftV == 0) or (rightV == 0): return( [ True, 0.0 , 1.0 ] )‏ else: return( [ False, 0.0, 0.0 ] )‏

  17. The Arbitrator: Putting Avoid & Move together! #Calls each behavior in the order listed. If a behavior gives a recommendation, # arbitrate passes the recommended action on to the robot and then skips the # rest of the behaviors. (So avoid has a higher priority than move.)‏ def arbitrate(): behaviors = [avoid, move] for behavior in behaviors: values = behavior()‏ hasRec = values[0] transVal = values[1] rotVal = values[2] if (hasRec == True): translate(transVal)‏ rotate(rotVal)‏ return()‏

  18. Behavior 3: Seek Light #seekLight behavior: turns towards (bright) light def seekLight(): values = getLight()‏ leftV = values[0] rightV = values[2] if ( leftV > 200) and (rightV > 200): return( [False, 0.0, 0.0] )‏ else: if (leftV < rightV): return( [True, -0.5, 0.33] )‏ else: return( [True, -0.5, -0.33] )‏

  19. Updating the Arbitrator for a new behavior #Calls each behavior in the order listed. If a behavior gives a recommendation, # arbitrate passes the recommended action on to the robot and then skips the # rest of the behaviors. (So avoid has a higher priority than move.)‏ def arbitrate(): behaviors = [avoid,seekLight, move] for behavior in behaviors: values = behavior()‏ hasRec = values[0] transVal = values[1] rotVal = values[2] if (hasRec == True): translate(transVal)‏ rotate(rotVal)‏ return()‏

More Related