Behavioral Robots with various Controls Generalized Braitenberg Vehicles.

88
Behavioral Robots Behavioral Robots with various Controls with various Controls Generalized Braitenberg Generalized Braitenberg Vehicles Vehicles
  • date post

    19-Dec-2015
  • Category

    Documents

  • view

    228
  • download

    3

Transcript of Behavioral Robots with various Controls Generalized Braitenberg Vehicles.

Behavioral Robots Behavioral Robots with various Controlswith various Controls

Generalized Braitenberg Generalized Braitenberg VehiclesVehicles

The simplest Breitenberg The simplest Breitenberg Vehicles with analog controlVehicles with analog control

each sensor is connected to the motor

on the same side,

each sensor connected to the motor

on opposite side

both sensors connected to both the

motors.

Fear and Fear and AggressionAggression

Vehicle at left avoids light while vehicle at right follows light.

Braitenberg Vehicles represent Braitenberg Vehicles represent “emotions”“emotions”

Signal InhibitingSignal InhibitingInhibiting signals from the sensors cause light following.

Sign minus represents inhibiting

Inhibiting signals from swapped sensors causes light avoidance

Signal InhibitingSignal Inhibiting

Signals and logic in Signals and logic in Braitenberg VehiclesBraitenberg Vehicles

• Signals can be:– Analog– Binary– Multiple-valued– Fuzzy– Quantum Sensing can be done in Sensing can be done in

quantum world (Hilbert Space) quantum world (Hilbert Space) or in standard macro-worldor in standard macro-world

Our Vehicles have various types Our Vehicles have various types of drivesof drives

Choice of DrivesChoice of Drives

Braitenberg Vehicles Sensory and Braitenberg Vehicles Sensory and Effectors CharacteristicsEffectors Characteristics

• Our understanding of Braitenberg Vehicles is much more generalmuch more general than in literature:– Sensing,

– Controls (functions, automata, distributed automata),

– Effectors (Drives and their Control, walking etc)

Emotion asEmotion as synthesizedsynthesized behaviorbehavior

Emotional state = state of all emotion variables

Physical variables = positions, speeds, accelerations, words,

Serchuk et al discuss emotion as mapping from Serchuk et al discuss emotion as mapping from internal state to observable output behavior. We want internal state to observable output behavior. We want to design these mappings well, so that they wil be to design these mappings well, so that they wil be similar to humanssimilar to humans

Emotion asEmotion as emergent, emergent, evolvableevolvable behaviorbehavior

Evolved “emotional” behavior of robot

Sensors, vision and fusion = features and patterns

Drives and effectors

Main input-output mapping (perception, internal state, behavior)

Precise motion generation (behavior)

Deg

rees

of f

reed

om

• Here emotion is an emergent behavior that arises from sensors, Here emotion is an emergent behavior that arises from sensors, drives, effectors and logic.drives, effectors and logic.

• This may look like human, animal behavior but also as an entirely This may look like human, animal behavior but also as an entirely new “other world” behavior, behavior at it may be.new “other world” behavior, behavior at it may be.

Part II. Part II. Brief Review of Quantum Brief Review of Quantum Circuits and Automata Circuits and Automata

A general-purpose controlled quantum gate. U is arbitrary one-qubit quantum operator.

If S1=|0> then M2=S2

If S1=|1> then M2=U(S2)

Analysis of Quantum Circuits Analysis of Quantum Circuits and Automataand Automata

Kronecker (tensor) Product of matrices

• Every quantum circuit is a serial or parallel composition of Every quantum circuit is a serial or parallel composition of lower level circuits.lower level circuits.

• For For serial connectionserial connection use use matrix multiplicationmatrix multiplication of unitary of unitary matricesmatrices

• For For parallel connectionparallel connection use use Kronecker productKronecker product of of unitary matricesunitary matrices

Elementary Quantum GatesElementary Quantum Gates

Hadamard gate notation and its Unitary matrix. Feynman gate notation and its unitary matrix. Observe that this is a permutative matrix.

The circuit to produce entanglement that can be used as a controller of a Braitenberg Quantum Robot.

By making a feedback from P to B a Braitenberg Quantum Automaton Robot is created.

We will analyze this entanglement circuits - EPR

Analysis of Quantum Braitenberg Analysis of Quantum Braitenberg VehicleVehicle

Calculation of parallel connection of gates H and wire

Calculation of Kronecker Product of Hadamard and wire using their unitary matrices

Analysis of Quantum Braitenberg Analysis of Quantum Braitenberg VehicleVehicle

Unitary matrix of Feynman gate in the entanglement circuit.

Analysis of Quantum Braitenberg VehicleAnalysis of Quantum Braitenberg Vehicle

00

01 1011

inputsinputs

outputsoutputs

00

01

10

11

Final calculation of the unitary matrix of the entanglement circuit by multiplying matrices of Feynman gate and a parallel connection of H and wire in reverse order.

Analysis of Quantum Braitenberg VehicleAnalysis of Quantum Braitenberg Vehicle

Calculation of entangled state with no light on both sensors

Analysis of Quantum Braitenberg Vehicle in Analysis of Quantum Braitenberg Vehicle in dark roomdark room

1000

* =

1001

= 1/2 |00> + 1/2 |11>

0 interpreted as no action on motor

Conclusion:Conclusion: in dark room quantum robot can go straight forward or stop, each step after measurement

Analysis of Quantum Braitenberg Vehicle in fully Analysis of Quantum Braitenberg Vehicle in fully lighted roomlighted room

0001

* =

01-10

= 1/2 |01> - 1/2 |10>

Calculation of entangled state with light on both sensors

0 interpreted as no action on motor

Conclusion:Conclusion: in fully lightened room quantum robot turn right or left, each step after measurement

Quantum Automata ModelsQuantum Automata Models

Quantum Automaton that lives in Hilbert Space.

Quantumlogic

Quantummemory

Quantum signal

Quantum signal

In case of a robot, such robot can live only on quantum mechanics level of world, but because of

entanglement it interacts with whole universe.

Benioff ‘s Benioff ‘s Automaton and Automaton and robotrobot

Quantum Automata ModelsQuantum Automata Models

Quantum Automaton with standard memory.

Quantumlogic

standardmemory

measurement

measurement

This automaton lives in normal macro world.

initialization

Yellow signals are quantumBlue signals are standard

Several other types of automata/robots can be proposed.

initialization

Conclusion on Quantum VehiclesConclusion on Quantum Vehicles

• Quantum logic includes binary, multiple-valued and fuzzy logic

• Quantum Automaton includes quantum combinational function, probabilistic and deterministic automaton

• Quantum Braitenberg Vehicle includesincludes (for many reasons) the standard Braitenberg Vehicle.

sensors

actuator

sCombinational Block

ENVIRONMENT ENVIRONMENT Generalized Generalized Braitenberg Braitenberg RobotRobot

Part III. Part III. Generalized and Quantum Generalized and Quantum

Braitenberg RobotsBraitenberg Robots

sensors

actuator

sCombinational Block

memory

ENVIRONMENTENVIRONMENT

Braitenberg Braitenberg Automaton RobotAutomaton Robot

Generalized Braitenberg RobotGeneralized Braitenberg Robot and and Braitenberg Automaton RobotBraitenberg Automaton Robot may exist in may exist in both quantum and standard environment.both quantum and standard environment.

sensors

actuators

Combinational Block

ENVIRONMENT ENVIRONMENT

sensors

actuators

Combinational Block

memory

ENVIRONMENTENVIRONMENT

Generalized Generalized BraitenbergBraitenbergRobotRobot

BraitenbergBraitenbergAutomaton Automaton RobotRobot

A Hybrid Fuzzy-Quantum system of Automata A Hybrid Fuzzy-Quantum system of Automata in Generalized Braitenberg Robot.in Generalized Braitenberg Robot.

sensors

actuators

FuzzyCombinational

Block

QuantumCombinational

BlockQuantum

memory

ENVIRONMENTENVIRONMENT

Fuzzy

Memory

F/Q

Q/F

Quantum Robot Motion Quantum Robot Motion (Behavior) generation(Behavior) generation

Quantum sensing

Standard sensing

QuantumQuantumCounter-like Counter-like automatonautomaton

Quantum ROM

effectors

M M M

Each behavior is a sequence of states

Rough positions in Hilbert Space

Precise deterministic positions probabilistically generated

Complete Quantum Robot Complete Quantum Robot ArchitectureArchitecture

Quantum sensing

Standard sensing

Quantum associativememory

Quantum Quantum brain brain

Quantum motion control

effectors

Every realization of quantum motion is slightly different because of measurements

Quantum Braitenberg Vehicles SimulatorQuantum Braitenberg Vehicles Simulator

s1

00

(oo)1/2 , (11) 1/2

01

(o1)1/2 , (10) 1/2

11

(o1)1/2 , (10) 1/2

10

(oo)1/2 , (11) 1/2

Graphical description of EPR reactive Quantum Braitenberg Vehicle ( robot )

C

S1

S2 M2

M1Problem 1

Find the unitary matrix and the graph for this Quantum Braitenberg Vehicle

Describe in English its behavior.

0

S1

S2

garbage

garbage

0M1

M2

Problem 2

Find the unitary matrix and the graph for this Quantum Braitenberg Vehicle

Describe in English its behavior.

C2

S1

S2 M2

M1H

C1 garbage

garbage

Problem 3

Find the unitary matrix and the graph for this Quantum Braitenberg Vehicle

Describe in English its behavior.

QuantumCombinational

Block

Feature value

creation and norm

alization

Motion

generationLego camera Light sensors

Lego motors

measurem

ent

Flip-flops

clock

Motion sequence

completed

EnvironmentEnvironment

Touch and other sensors

robot

PROJECT 1.PROJECT 1.

Quantum Automaton Quantum Automaton with standard with standard memory in a setup memory in a setup where the behavior where the behavior of walking Lego of walking Lego robot is observed by robot is observed by Lego CameraLego Camera

The entire system and subsystems for Project 1

• Please observe two feedback loops.

– Small processor (microcontroller on the robot) processes sensor information

– PC processes images

– Camera looks at the robot

ceilingcamera

Laptop PC

Micro -

controller

Radio transmitter

-receiver

Radio transmitter

-receiver

Quantum controller

Selection and generation of motions

Execution of stored motionsTransmission of

motions and sensor readings

Lego camera

Light sensors

Lego motors

EnvironmentEnvironment

Touch and other sensors

robot

PROJECT 1.PROJECT 1.

Components of the entire Components of the entire system. @system. @

The entire system and subsystems for Project 1

• Please observe two feedback loops.

– Small processor (microcontroller on the robot) processes sensor information

– PC processes images

– Human looks at the robot– Camera looks at the human

Laptop PC

Micro -

controller

Radio transmitter

-receiver

Radio transmitter

-receiver

Quantum controller

Selection and generation of motions

Execution of stored motionsTransmission of

motions and sensor readings

Human observes a robot

Robot mimicks a human

Lego camera

Light sensors

EnvironmentEnvironmentrobot

sensors

motors

Two Main Simple Quantum Behavioral Architectures

• (a) Reactive architecture (mapping with no memory)

• (b) Behavioral architecture with the memory to represent emotions, moods, knowledge and stored processing information.

sensors

QuantumCombinational

Block

ENVIRONMENT ENVIRONMENT

sensors

QuantumCombinational

Block

Standar

d

memory

ENVIRONMENTENVIRONMENT

actuator

s

Measurements

(a)

(b)

Measurements

actuator

s

C

S1

S2M2

M1H

Mood

Combinational logic with probabilistic entangled results

memory

m1

m1

md

Calculations in Hilbert Space

measurements

Behavioral Quantum Robot Behavioral Quantum Robot with Memory of moodswith Memory of moods

S1 S2 C M1 M2 Mood

0 0 0 0 0 0 nice

0 0 1

0 1 0 0 1 0

0 1 1

1 0 0 1 1 1 angry

1 0 1

1 1 0 1 0 1

1 1 1

(000)1/2 or (111) 1/2

Problem 4. Complete this table for the Quantum Robot with Memory from the previous slide.

Hybrid ArchitecturesHybrid Architectures

• Modern Behavioral robots are hybrid• They combine various components (agents):

– Reactive– With memory– Fuzzy– Neural– Multi-valued– Learning– Knowledge-based– Quantum – …..

sensors

actuators

FuzzyCombinational

Block

QuantumCombinational

BlockQuantu

m

memory

ENVIRONMENTENVIRONMENT

Fuzzy

Memory

F/Q

Q/F

Hybrid Behavioral Hybrid Behavioral Robot with Fuzzy Robot with Fuzzy and Quantum and Quantum SubsystemsSubsystems

You can find many good Lego You can find many good Lego designs on Internetdesigns on Internet

New Lego New Lego KitsKits

Mindstorms NXTMindstorms NXT• It has a 32-bit processor,

• proper servo motors,

• new sensors (including color vision and hearing)

• bluetooth connectivity

• it can be controlled by a cellphone

• powered by LabVIEW from National Instruments.

when I got the Space Monorail, I thought it was the absolute height of coolness that Lego could hope to attain.  Now Lego kits have Bluetooth and their own programming language, LegOS. 

• The inclusion of Bluetooth technology also extends possibilities for controlling robots remotely, for example, from a mobile phone or PDA.

Projects Projects with new with new

LegoLego

• when I got the Space Monorail, I thought it was the absolute height of coolness that Lego could hope to attain.  Now Lego kits have Bluetooth and their own programming language, LegOS. 

Lego Lego HeadsHeads

Lego Lego BipedsBipeds

Lego robot biped googleLego robot biped google

Lego Lego HandsHands

Homework 2• Design a simulator of two Braitenberg Vehicle in

an environment

• The environment may be an arbitrary maze, sports field or battlefield. It can be a plan of a house.

• The robots can turn right 90 degree, left 90 degree and rotate. They can move one step forward or one step backwards. These are the all basic moves from which other moves are composed.

Homework 2 cont• Each vehicle has a minimum of two sensors. You design and locate

the servos. They can see no more than 3 cells from the robot cell in any direction.

• Each robot may have weapons that shoot one cell in any direction.• There may be a ball or other item for play and interaction.• The vehicles can have some friendly or unfriendly relation, to be

defined by you.• The environment (space) for robots is a square with external walls

North, East, West and South. If one robot escapes to one of these external walls then the robot is safe from shooting but he cannot shoot.

• The space is a grid of cells. The walls are marked by number X. The empty cells are empty. All other symbols may be used to denote the position, orientation and internal state of each robot.

• Your program should either make printouts or display the snapshots of robot behavior with written explanation what happens (possibly what are their internal states), collisions, intentions, etc.

Example of space encoding

X

X

X >

X

X

X X X X X X X X

X X

X X X

X X

^ X

X X

North

South

West East

Examples of programming of simple standard Braitenberg

Vehicles in JavaWe used Basic, LISP, Pascal, C, Robot C, etc

MotorTest.javaimport josx.platform.rcx.*;

class MotorTest {

static final int STOP = 0;static final int RUN = 1;static final int FLOAT = 2;

static int mode = STOP;static int power = 0;

public static void main(String [] args) {

setupButtonListeners();

while (true) {if (mode == RUN) {

Motor.A.setPower( power ); // power in range [0, 7]. incremented with each press of View button.

Motor.A.forward();} else if (mode == STOP) {

Motor.A.stop();} else if (mode == FLOAT) {

Motor.A.flt();}

}}

... (button listener code not shown)

LightTest.javaimport josx.platform.rcx.*;

class LightTest implements SensorConstants {

public static void main(String [] args) throws InterruptedException{

Sensor.S1.setTypeAndMode (SENSOR_TYPE_LIGHT, SENSOR_MODE_PCT);

Sensor.S1.activate();

while (true) {int lightReading;

if (Button.VIEW.isPressed()) {lightReading = Sensor.S1.readRawValue();

} else {lightReading = Sensor.S1.readValue();

}

LCD.showNumber( lightReading );}

}

}

Complete Example: Complete Example: “Aggressive.java”“Aggressive.java”

import josx.platform.rcx.*;

class aggressive implements SensorConstants {

public static void main(String [] args) {

int minBrightness = 100;final int gain = 12;

Sensor.S1.setTypeAndMode (SENSOR_TYPE_LIGHT, SENSOR_MODE_PCT);Sensor.S1.activate();Sensor.S3.setTypeAndMode (SENSOR_TYPE_LIGHT, SENSOR_MODE_PCT);Sensor.S3.activate();

for (int i = 0; i < 100; i++) {if (Sensor.S1.readValue() < minBrightness) {

minBrightness = Sensor.S1.readValue();} else if (Sensor.S3.readValue() < minBrightness) {

minBrightness = Sensor.S3.readValue();}Thread.sleep(20);

}

Motor.A.forward();Motor.C.forward();

while (true) {int motorASpeed = (Sensor.S3.readValue() - minBrightness) / gain;int motorCSpeed = (Sensor.S1.readValue() - minBrightness) / gain;

setMotorSpeed(Motor.A, motorASpeed);setMotorSpeed(Motor.C, motorCSpeed);

}}

Aggressive.java (continued)protected static void setMotorSpeed(Motor m, int motorSpeed){

if (motorSpeed < 1) {m.flt(); // importantLCD.showNumber(-1);

} else {if (motorSpeed > 7) {

motorSpeed = 7;}m.forward();m.setPower(motorSpeed);LCD.showNumber(motorSpeed);

}

}

}

Observations

Closed loop control; lessens importance of mechanical imperfections (e.g. pulley slip).

The map is not the territory.

Make your own—robots and observations!

Change the vehicle

behavior?• Make a subclass of

vehicle and cut-and-paste the version of doSenseLogic() that you want…

• Consult Lecture slides for overview of various behaviors

// Sensor output goes directly to wheel on same side void doSenseLogic() { setASpeed(sA.getSense()); setBSpeed(sB.getSense()); }

// Sensor output crossed to wheel on opposite side /* void doSenseLogic() { setASpeed(sB.getSense()); setBSpeed(sA.getSense()); }*/

// Each sensor goes to wheel on same side with an inhibitory connection /* void doSenseLogic() { setASpeed(sA.getInverseSense()); setBSpeed(sB.getInverseSense()); } */

// Each sensor goes to wheel on opposite side with an inhibitory connection /* void doSenseLogic() { setASpeed(sB.getInverseSense()); setBSpeed(sA.getInverseSense()); } */

// Sensors are hooked up to opposite motors, with threshhold sensing. /* void doSenseLogic() { setASpeed(sB.getNonlinearSense()); setBSpeed(sA.getNonlinearSense()); } */