ROBOTICS (01CFIDV,02CFICY) Lab 3 on Microsoft ... - LaDiSpe

1 downloads 46 Views 287KB Size Report
Language (VPL) of Microsoft Robotics Studio. Exercise 1: Braitenberg-like obstacle avoidance. Prerequisites: • Hardware: no special hardware is requested .
ROBOTICS (01CFIDV,02CFICY) Lab 3 on Microsoft Robotics Studio Autonomous Behavior Implementation In this laboratory you will practice how to enable a differential drive mobile robot to move freely in an area while avoiding the obstacles encountered along the path, using the Visual Programming Language (VPL) of Microsoft Robotics Studio.

Exercise 1: Braitenberg-like obstacle avoidance Prerequisites:  

Hardware: no special hardware is requested Software: only VPL, which comes with the basic installation of MSRS

Objective: Implement a VPL diagram that enables a simulated Pioneer P3-dx mobile robot to move freely in an environment where different objects (obstacles) are present, using a Braitenberg-like technique.

Preliminaries on Braitenberg Vehicles Before entering the technical details useful to successfully complete this exercise, it is worth giving some additional information on what is a Braitenberg behavior, and why it is important in Robotics. First of all, Valentino Braintenberg (1926 Bolzano) is a German neuro-scientist. He is known especially for the book 'Vehicles: Experiments in Synthetic Psychology' where he describes how hypothetical 'vehicles' (commonly known as Braitenberg Vehicles), a combination of sensors, actuators and their interconnections, while being simple in design could produce behaviors that could be likened to aggression, love, foresight and even optimism. Braitenberg vehicles are simple automatons, and illustrate the abilities of reactive agents, thus representing the simplest form of Behavior Based Artificial Life or embodied cognition, i.e. intelligent behavior that emerges purely from sensorimotor interaction between the agent and its environment, without any need for an internal memory, representation of the environment, or inference. Strictly speaking, a Braitenberg vehicle can autonomously move around. It has primitive light sensors and wheels (each driven by its own motor) that function as actuators or effectors. A sensor is directly connected to an effector, so that a sensed signal immediately produces a movement of the wheel. Depending on how sensors and wheels are connected, the vehicle exhibits different, goal-oriented behaviors. The following examples are some of Braitenberg's simplest vehicles.

1) A first agent has one light-detecting sensor that directly stimulates its single wheel, implementing the following rules:   

more light produces faster movement less light produces slower movement darkness produces standstill

This behavior can be interpreted as a creature that is afraid of the light and that moves fast to get away from it. Its goal is to find a dark spot to hide. 2) A slightly more complex agent has two light detectors (left and right) each stimulating a wheel on the same side of the body. It obeys the following rule: 

more light right → right wheel turns faster → turns towards the left, away from the light

This is more efficient as a behavior to escape from the light source, since the creature can move in different directions, and tends to orient towards the direction from which least light comes. 3) In another variation, the connections are negative or inhibitory: more light → slower movement. In this case, the agents move away from the dark and towards the light. In a complex environment with several sources of light and shadow, Braitenberg vehicles will exhibit a complex and dynamic behavior. They will describe a zigzagging trajectory with accelerations and slowdowns, moving as fast away as possible from any strong light sources while apparently exploring the surroundings, until they find a deep pocket of shadow where they can “rest”. This behavior is undoubtedly goal-directed, flexible and adaptive. We might even see it as intelligent, the way we attribute some minimal intelligence to a cockroach. Yet, the functioning of the agent is purely mechanical, without any information processing or other apparently cognitive processes.

Technical Tips The purpose of the previous section was to give you the flavor of some research interests in cognitive robotics, which indeed are opening a new era for applications in Robotics. In this exercise the idea is to exploit Breitenberg’s experiences to enable a mobile robot to perform an obstacle avoidance task. The simulated mobile robot Pioneer P3-dx available for the exercise is endowed with a simulated SICK Laser Rangefinder (LRF). This device is able to measure distances over an angular range of 180° with an angular step of 0.5°. The maximum distance perceived by the LRF is equal to 8 meters. In VPL, the service that has to be used to simulate the LRF is the Simulated Laser Range Finder, and the property that has to be taken into consideration is DistanceMeasurements. It is a vector containing the measured distances at different angular positions. For example DistanceMeasurements[0] contains the distance measured using the laser ray at 0°, while DistanceMeasurements[1] contains the distance measured using the laser ray at 0.5°.

Other properties give the Angular Range, the Angular Step, the Units used for distance measurements. In order to implement an obstacle avoidance behavior, the first thing to do is to read the distance measurements from the LRF with a proper clock. For this purpose a Timer service has to be properly used. Then, to obtain a reactive behavior following a Braitenberg-like paradigm, the signals coming from the LRF have to be connected properly to the motors. For instance, different distance measurements can be multiplied by a weight and then summed. The result can become the input of a motor. There is no general rule explaining how to do this to obtain exactly a certain behavior, apart from what can be learned by Braitenberg experiments. If one wants to do more, then more complicated approaches have to be considered. For example there are several techniques used to learn how to connect signals coming from sensors to the motors and how to calculate mixing weights. For example there exist experiments where neural networks, fuzzy networks, neuro-fuzzy networks are trained to learn optimal weights satisfying a given fitness function for a task. Here we are not interested in doing this, since it may be too difficult at the moment, but we are only interested in experiencing how to implement “by hand” an obstacle-avoidance like behavior.

Note: In order to be able to handle the LRF, the same file manifest has to be set for the Generic Differential Drive service and the Simulated Laser Range Finder service. The file manifest is called MobileRbots.P3DX.Simulation.Manifest.xml