Heading policy specifications

This page has been updated on the 4 April 2011.

You can download this document in PDF here

What is this document about?

The heading policy is a different way to record tracking data. By default the device records tracking data periodically or on event. With this feature you will be able to record tracking data when the vehicle makes a turn or when it has travelled a certain distance.

Setting up the Policy on the C4D.

To enable this policy, the following parameter must be set up with the right policy name :

dataRecorder fieldPeriod 3 -4

Once the policy is enabled, each DB Field whose fieldPeriod is set with -4 will be recorded and included in the next data packet to be sent.

Policy Diagram

Policy Parameters

Name Type (default value) Limit
minHeadingAngle Integer (40) (0 = angle is not used, >= 180 angle is not tested)
Minimum value of angle (in degrees) requested to send a position.
If <0, default value is used.
minHeadingDistanceAngle Integer (20)
Minimum distance (in meters) required since last record in case of angle test.
If <0, default value is used.
minHeadingDistance Integer (250)
Minimum distance (in meters) required since last record. (no angle test)
If <0, default value is used.
minHeadingFreq Integer (90000)
Minimum time (milliseconds) between 2 records (no angle test)
If <0, default value is used.
maxHeadingDistance Integer (5000)
Maximum distance (in meters) between 2 records.
If <0, default value is used.
maxHeadingFreq Entier (300000)
Maximum time (in milliseconds) between 2 records. Can be used to record points when the device is not moving.
If <0, default value is used.

Policy Description

The policy is using 4 independent conditions to define when a point must be recorded.

Last recorded position is not valid.

In the case of last GPS position not being valid, the next point will be recorded as soon as a valid position is captured.

Validity
IF ( !isValid(lastPos) && isValid(curPos)) THEN
Record
END IF

Maximum Distance

Distance (Allows periodic record based on the distance)
IF (Distance(lastPos, curPos) >= maxHeadingDistance) THEN
Record
END IF

It’s possible to disable the record by setting a very high maxHeadingDistance value.

Example: maxHeadingDistance=5000000. (Records each 5000 Kms)

Maximum Time

Time (Allows record when the vehicle is not moving)
IF (Time (lastPos, curPos) >= maxHeadingFreq) THEN
Record
END IF

It’s possible to disable this mode by setting a very high maxHeadingFreq value.

Example: maxHeadingFreq=100000

Heading Change

Heading (Allows recorded based on the GPS Direction)
IF (MinHeadingAngle != 0 &&
Angle (lastPos, curPos) >= minHeadingAngle &&
Distance(lastPos, curPos) >= minHeadingDistanceAngle) THEN
Record
END IF

Minimum Distance and Time

Time and Distance (allows record when the vehicle moved enough)
IF (Time (lastPos, curPos) >= minHeadingFreq) THEN
IF (Distance(lastPos, curPos) >= minHeadingDistance) THEN
Record
END IF
IF ((isMvt (lastPos) != isMvt (curPos)) THEN
IF (PreviousStoppedPosition IS EMPTY “or” Distance (lastPos, curPos) >= minHeadingDistance) THEN
Record
END IF
END IF
END IF

WARNING : Distance and Angle

Distance and Angle functions only work on valid positions (GPS FIX with 3 satellites or more). In the case of invalid GPS information, these functions will return a negative value and this mode won’t be effective. It is therefore recommended to always set up the Maximum Time Mode.

Examples

Heading Change (with default values)

  • Records as soon as the heading is 40 degrees greater than the last record and the distance 20 meters greater than the last record.
  • Records if time since last point is greater than 90 seconds and the distance is greater than 250m
  • If the vehicle is not moving, records each 5 minutes. (300000ms).
  • If the vehicle is moving straight forward, records each 2kms.
minHeadingAngle=40
minHeadingDistanceAngle=20
minHeadingDistance=250
minHeadingFreq=90000
maxHeadingDistance=2000
maxHeadingFreq=300000

Maximum Distance or Maximum Time

Records each 2 minutes or when the vehicle moved by 2 kilometers.
The following configuration is :

  • Disabling heading change mode :
    → minHeadingAngle == 0
  • Disabling minimum distance/time mode.
    → minHeadingFreq = 2000000000
minHeadingAngle=0
minHeadingDistanceAngle=X
minHeadingDistance=50000
minHeadingFreq=2000000000
maxHeadingDistance=2000
maxHeadingFreq=120000