150 likes | 288 Views
Conflict resolution. CS 395 Behavior-Based Robotics. Naïve behavior-based systems. Behavior = policy + trigger System = set of behaviors Assume mutually exclusive triggers Use policy of currently triggered behavior Problem: what happens when triggers aren’t mutually exclusive?.
E N D
Conflict resolution CS 395 Behavior-Based Robotics
Naïve behavior-based systems • Behavior = policy + trigger • System = set of behaviors • Assume mutually exclusive triggers • Use policy of currently triggered behavior • Problem: what happens when triggers aren’t mutually exclusive?
Types of conflict resolution • Types of activation • Binary: on or off • Graded (numerical): degrees of activation • Types of combination • Switching (choose a behavior) • Blending (form a composite action)
Switched arbitration • Fixed priorities • Give each behavior a priority • Use binary activation • Choose policy of highest priority active behavior • Dynamic priorities • Use graded activation • Choose most active behavior
Arbitration in GRL Arbitration schemes implemented as functions over behaviors • InputA set of behaviors to decide between • OutputA composite behavior with the output of the selected input behavior
Simple switching (Brooks?) (define-signal (behavior-or b1 b2) (behavior (or (activation-level b1) (activation-level b2)) (if (activation-level b1) (motor-vector b1) (motor-vector b2)))) • Assume binary activation and only two behaviors • Operates like or in Scheme or || in C++:Takes the leftmost input that’s “on”.
A cleaverer way to code it (define-signal (behavior-or b1 b2) (if (activation-level b1) b1 b2)) These compile to exactly the same code since: (or a b)is defined to be: (if a a b)
What it looks like as signals b1 or output if b2 Motor vectors Activation levels
More than two behaviors Extra args passed as a list (define-signal (behavior-or first-behavior . rest-of-behaviors) (if (null? rest-of-behaviors) first-behavior (if (activation-level first-behavior) first-behavior (apply behavior-or rest-of-behaviors)))) Notes: • This is a different (and somewhat cleaner) implementation than the one in the notes • The compiler knows to perform the outer if at compile time • There don’t end up being any linked lists at run time. calls a procedure with a list of arguments
Brooks’ suppress operator (define-signal (suppress suppressor suppressee time) (let ((suppressing? (< (true-time (not (activation-level suppressor))) time))) (behavior (or suppressing? (activation-level b2)) (if suppressing? (motor-vector b1) (motor-vector b2)))) • Like behavior-or, but stays with the first argument for a while even after it becomes inactive • Good for removing chatter
Switching with dynamic priorities (Tinbergen) (define-signal (behavior-max . behaviors) (list-ref behaviors (apply arg-max (activation-level behaviors)))) Remember: • Behaviors now have graded activation • Arg-max returns the position of the maximum argument, not its value • List-ref returns the list element with the specified position • Again, the compiler in-lines all of this so there aren’t actually any lists at run time
Computing arg-maxusing lateral inhibition • Biological system often use maximal activation for conflict arbitration using a “winner-take-all network” • Each signal inhibits the other signals • Less active signals inhibit each other less • More active signals are more inhibiting and less inhibited • Eventually, the strongest signal wins, and the others are turned off
Motor schemas (Arbib, Arkin) (define-signal (weighted-motor-vector behavior) ;; Returns behavior’s motor vector ;; with each element multiplied by the behavior’s activation-level (* (activation-level behavior) (motor-vector behavior))) (define-signal (weighted-sum . behaviors) (apply + weighted-motor-vector behaviors)) (define-signal (behavior-+ . behaviors) (behavior (apply + (activation-level behaviors)) (apply weighted-sum behaviors)))
Weighted voting (Rosenblatt/CMU) • Principle of least commitment • Don’t make decisions until you have to • Least commitment arbitration • Assume behaviors don’t return a single motor vector, but rather a set of preferences on possible motor vectors • Sum everyone’s preferences • Pick the vector with the most preference
Weighted voting for directions (define-signal avoid-obstacles sonar-readings)(define-signal go-forward (angle-preferences cos))(define-signal angle-preferences (+ avoid-obstacles go-forward))(define-signal motor-vector (follow-xy-vector (unit-vector (* (vector-arg-max angle-preferences) radians-per-angle-sample)))) Notes • Behaviors are now vectors of numbers of rating each of 16 different directions to move in • Angle-preferences takes a function from angles to numbers and returns a vector of 16 samples of the function