 |
oTracker Object
|
|
|
Description: |
| | The oTracker Object is a Hardware Object that tracks the position of a line and calculates a URCP Heading based on that position.
The oTracker Object can be configured with either 3 or 4 line sensors. It can report the position of the line, if it sees a line, which direction the line moved and if the line has moved out from under it, which side the line is now on. The lynxmotion Tracker Sensor (as shown at right) uses 3 sensors. |
| | The following table lists the size and availability of the oTracker Object.
| | Object | Size | Description | A1 | A2 | B1 | B2 | C1 |
 | oTracker | 5 Bytes | An Object that tracks the position of a line. | x | x | x |
|
Operation: |
| | The oTracker Object monitors the 4 I/O lines specified by the IOPack property. It is expecting that the 4 I/O lines are connected to an array of 3 or 4 optical sensors that are placed on the bottom of a robot to detect when a line is under them. It then takes the data read from these I/O lines and calculates a URCP Heading based on that position and stores it in the Position property. Before the URCP Value is stored in the Position property, it is compared to the previous value and the Direction property is set based on the direction that the line moved. If the line was in the middle of the sensor array, then the Centered property is set to 1, otherwise the Centered property is set to 0. If the line was not found by the sensor, then the OutOfRange property is set to 1 and the Position property is set based on the value of the Mode property. If the Mode property is 0, then the oTracker Object assumes that the line has moved to the right or left of the sensor array and the Position property is set to 32 or -32 depending on the current value of the Direction property. If the Mode property is 1, then the oTracker assumes that the line is between the two middle sensors and the Position property is set to 0 and the Centered property is set to 1. The DIO property is an instance of the oCenterSwitch4 object which is created when the oTracker Object is. The oTracker Object uses this object to do that actual evaluation of the sensors. Most properties of the oCenterSwitch4 instance can be adjusted and will affect the oTracker object's operation. See oCenterSwitch4 for more detail on how oCenterSwitch4 determines the lines position. |
Properties: |
| The following table lists the properties of the oTracker Object:
|
Examples: |
| | In the following example, the oTracker Object is used.
| Visual Basic Syntax | C and Java Syntax |
' This program creates a Virtual
' Circuit that uses an oTracker
' object to track a line and
' position a servo via an oServo
' object for a line following robot.
Dim l As New oTracker
Dim S As New oServoX
Dim W As New oBus
Sub Main()
ooPIC.PullUp = cvTrue
l.IOPack = 1
l.Operate = cvTrue
S.IOLine = 1
S.Operate = cvTrue
W.Input.Link(l.Position)
W.Output.Link(S)
W.Operate = cvTrue
End Sub | // This program creates a Virtual
// Circuit that uses an oTracker
// object to track a line and
// position a servo via an oServo
// object for a line following robot.
oTracker l = New oTracker;
oServoX S = New oServoX;
oBus W = New oBus;
Void Main(Void){
ooPIC.PullUp = cvTrue;
l.IOPack = 1;
l.Operate = cvTrue;
S.IOLine = 1;
S.Operate = cvTrue;
W.Input.Link(l.Position);
W.Output.Link(S);
W.Operate = cvTrue;
} |
| Basic Syntax |
' This program creates a Virtual
' Circuit that uses an oTracker
' object to track a line and
' position a servo via an oServo
' object for a line following robot.
l Var oTracker(1,,,,cvOn)
S Var oServoX(7,,,,,,,cvOn)
W Var oBus(l.Position,,S.Position,cvTrue) |
|
Connections: |
| The Lynxmotion Tracker uses 3 I/O lines.
| Lynxmotion IRPD |
 |
|
Related Items:
|
| | The following table lists objects with related functions
| | Object | Description | A1 | A2 | B1 | B2 | C1 |
 | oBumper4 | Reads a 4-contact bumper. | x | x | x |
 | oBumper8 | Reads an 8-contact bumper. | x | x |
|
Version History and Bug List: |
| | Firmware Ver B1: Introduced. Bugs: No known bugs. |
|