vb.net barcode scan event FIGURE 3.8 The robot can feel objects without touching them using ve infrared sensors. in Software

Creation QR Code in Software FIGURE 3.8 The robot can feel objects without touching them using ve infrared sensors.

FIGURE 3.8 The robot can feel objects without touching them using ve infrared sensors.
QR Code Decoder In None
Using Barcode Control SDK for Software Control to generate, create, read, scan barcode image in Software applications.
Encoding QR Code In None
Using Barcode printer for Software Control to generate, create QR Code ISO/IEC18004 image in Software applications.
rLocate 400,300 while rFeel() = 0 rForward 1 wend End
Recognizing QR Code 2d Barcode In None
Using Barcode scanner for Software Control to read, scan read, scan image in Software applications.
Making Denso QR Bar Code In Visual C#.NET
Using Barcode printer for .NET framework Control to generate, create QR Code 2d barcode image in .NET applications.
FIGURE 3.9 This program uses rFeel() to detect an obstacle.
Paint QR Code 2d Barcode In .NET Framework
Using Barcode drawer for ASP.NET Control to generate, create QR Code image in ASP.NET applications.
QR Code ISO/IEC18004 Generation In .NET Framework
Using Barcode maker for .NET Control to generate, create QR Code image in .NET framework applications.
ROBOTBASIC SENSORS
QR Code Generation In Visual Basic .NET
Using Barcode creation for VS .NET Control to generate, create QR Code ISO/IEC18004 image in .NET framework applications.
Drawing Barcode In None
Using Barcode generator for Software Control to generate, create bar code image in Software applications.
sensors is that it is possible for a small object (or perhaps the corner of a large object) to slip between the sensors and cause a collision (refer to Fig. 3.8). For this reason it is recommended that you analyze the data from both the infrared sensors and the bumpers when trying to avoid a collision. This principle will be discussed in detail in later chapters. 3.3.2 ULTRASONIC AND INFRARED RANGING One limitation of the infrared and bumper sensors is that they only detect objects that are very close to the robot. It may be advantageous for the robot to detect distant objects along its path so it could take action before it becomes too late to act. You can buy sensors that report not only the presence of objects in the path, but also the distance to the objects. Some of these sensors use ultrasonic technology (sound waves) and others use infrared or laser. Our robot has a single ranging sensor mounted so that it faces in the same direction as the robot. You can get the data from that sensor using the function rRange(). If, for example, rRange() returns a value of 27 it is telling you there is some object 27 pixels away. The rRange() function simulates laser technology, which makes it very directional. The program in Fig. 3.10 makes the robot approach the north wall stopping 20 pixels away from it. 3.3.3 ROBOT VISION Another sensor that the robot can use to detect objects at a distance is a camera pointed in the direction the robot is facing. This camera is not intended to provide full pictures to analyze, which is the subject of an interesting eld in robotics called robotic vision. Rather, the RobotBASIC camera returns a number to indicate what color it is seeing. The function for the camera is rLook(). The program in Fig. 3.11 shows how the robot can use the camera to determine when it is facing an object of a particular color. In this case, the robot will turn until it sees the red circle.
ECC200 Creator In None
Using Barcode printer for Software Control to generate, create DataMatrix image in Software applications.
UPCA Creation In None
Using Barcode generator for Software Control to generate, create GS1 - 12 image in Software applications.
rLocate 400,300 while rRange() > 20 rForward 1 wend End
Generate USS Code 39 In None
Using Barcode printer for Software Control to generate, create Code39 image in Software applications.
Code128 Encoder In None
Using Barcode generation for Software Control to generate, create ANSI/AIM Code 128 image in Software applications.
FIGURE 3.10 The function rRange() allows the robot to determine how far objects are in front of it.
Postnet 3 Of 5 Creation In None
Using Barcode printer for Software Control to generate, create Postnet image in Software applications.
Code 39 Full ASCII Printer In Java
Using Barcode creation for Android Control to generate, create Code 3/9 image in Android applications.
Circle 600,500,620,520,red,red // draw a red circle rLocate 400,300 while rLook() < > RED // turn until red is seen rTurn 1 wend End
Data Matrix Drawer In Java
Using Barcode creator for Android Control to generate, create Data Matrix image in Android applications.
Painting Data Matrix In None
Using Barcode drawer for Word Control to generate, create DataMatrix image in Word applications.
FIGURE 3.11 The function rLook() allows the robot to determine what color is seen straight ahead.
Generate EAN / UCC - 13 In Visual C#.NET
Using Barcode drawer for Visual Studio .NET Control to generate, create USS-128 image in .NET applications.
Printing Linear In Java
Using Barcode creator for Java Control to generate, create 1D image in Java applications.
BUILDING BLOCKS
Barcode Reader In Java
Using Barcode scanner for Java Control to read, scan read, scan image in Java applications.
Create EAN128 In Objective-C
Using Barcode encoder for iPad Control to generate, create GS1-128 image in iPad applications.
Circle 600,500,620,520,red,red // draw a red circle rLocate 400,300 while rBeacon(RED) = false //while the beacon is not seen rTurn 1 wend End
FIGURE 3.12 The function rBeacon (Color) allows the robot to determine when a speci ed beacon is ahead, even if the path is blocked.
3.3.4 BEACON DETECTION One way of locating a desired location is to hang a sign above it indicating the location below the sign. Before electronic compasses and global positioning systems (GPS) were available at affordable prices lighthouses served as beacons for ships at sea and radio automatic direction nder (ADF) beacons provided navigational data to aircrafts. These systems are still in use today, though they are being gradually replaced by newer technologies. If we want the robot to nd a location in a room, we could hang a ashing light (either visible or infrared) above the location. Since this ashing beacon is high in the room it can be seen at all times even if other objects are in the way between the robot and the location. Like the camera and ranger sensors, the beacon detection sensor faces directly ahead of the robot. The function rBeacon (Color) returns a non-zero value (true) which indicates that the robot is facing a beacon of that color, or zero (false) which indicates that the robot is not facing the beacon. If the number returned by the function is not zero then there is a beacon ahead of the robot but this number is actually the distance in pixels to the beacon. This functionality simulates more complex beacon detection. If you do not wish to use the distance data then just use the returned number as a true or false indicator. The program in Fig. 3.12 shows how the robot can turn to face a beacon. We must tell the function what color beacon to search for by passing it the color of the beacon. This function is very similar to the camera function, but the beacon function can see over objects that might be in the way (because the beacon is assumed to be hanging high in the air). 3.3.5 CUSTOMIZABLE SENSORS There are several other sensors available on the robot, some of which can be customized so that you can create the exact type and con guration of sensors you need to allow your robot to achieve a desired behavior. Some of the sensors described above can be con gured in other ways that will be discussed in subsequent chapters. Additionally, there are alternate ways of interrogating the sensory data as will be described in Chap. 5. Refer to Sec. C.9 for more information.
Copyright © OnBarcode.com . All rights reserved.