Follow

Head-up display integration

Introduction

You can obtain rich navigation status data from Sygic Navigation on the go and use it for you specific needs of visualization.
It can be e.g. your own Head Up Display solution, or maybe you want to broadcast the data on a car-integrated MFD device.
We commonly call this feature as Head Up Display interface.
Typically you can provide drivers with a simplified navigation turn-by-turn instructions represented by direction control visualisation together with showing the distance to the turn to be taken, and/or a time to travel or distance to travel information, etc.

In the following pictures you may see the exploitation of our component for a HUD projection through your device, or by rendering into MFD.

Concept

You need to register a BroadcastReceiver with IntentFilter "com.sygic.intent.ACTION_HUD_UPDATE".
Intent extras contains the HUD data as a bundle you can exploit.
To get a particular data from the bundle you need to know a key and the data type.

Requirements and limitations

The library is currently supported for the Android OS platforms for both Sygic 2D and Sygic 3D versions.

For navigation to open up the communication channel you need the following:

  • the navigation license file (mlm or content.info) must contain the HUD permission: extHud=yes
    (if your license does not contain the HUD permission you should contact your sales representative)

Try demo

1. Gaining access

In order to gain the access to the functionality you will need a special license. In order to obtain the license please Contact our sales.
You will obtain the trial license for navigation, which will open the API for exploiting the HUD interface.

2. Usage template

To get real-time data from Sygic navigation you can use the following class implementation.

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

public class SygicUpdatesReceiver extends BroadcastReceiver {

    public static final String INTENT_ACTION_UPDATE= "com.sygic.intent.ACTION_HUD_UPDATE";

    @Override
    public void onReceive(Context context, Intent intent) {
        Bundle hudData = intent.getExtras();
        // parse selected data & send it to your device
        String sval = getStringValue(hudData, "NextStreet");
        // send sval to your device
    }

    private string getStringValue(Bundle hudData, String key) {
      if (hudData.containsKey(key)) {
         return hudData.getString(key);
      }
      return null;
   }
}

In order to instantiate the SygicUpdateReceiver in your application context you can exploit the following pattern:

import android.app.Activity;
import android.content.IntentFilter;
...
public class MainActivity extends Activity {

    private SygicUpdatesReceiver mSygicReceiver;
    ...

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        ...
        mSygicReceiver = new SygicUpdatesReceiver();
        IntentFilter filter = new IntentFilter(SygicUpdatesReceiver.INTENT_ACTION_UPDATE);
        registerReceiver(mSygicReceiver, filter);
    }

    @Override
    protected void onDestroy() {
        unregisterReceiver(mSygicReceiver);
        ...
    }

}

Received data structure

Bundle data

This bundle data retrieved through the OnReceive callback function contains the following data structure:

typeKeyDescription
integer LengthToInstruction Distance to next instruction
integer LengthTotal Total distance to destination
integer LengthPassed Distance travelled.
integer ETA Estimated Time of Arrival.
integer SpeedLimit Speed Limit on current location.
integer TimeDelay Time delay caused by traffic on route.
integer TimeRemaining Remaining time to destination.
integer TimeToInstruction Time to next instruction.
integer VehicleSpeed Current speed of vehicle.
integer Speeding Boolean to check speed exceeding.
  • True = Speed exceeded. (1)
  • False = Speed not exceeded. (0)
integer USA is the current location USA
  • True = current location is in USA. (1)
  • False = current location is not in USA (0).
integer GPSSignal GPS signal strength enumeration.
  • 0 = No traffic on route.
  • 1 = Low traffic on route.
  • 2 = Medium traffic.
  • 3 = High traffic.
integer Traffic Traffic data enumeration.
  • 0 = No GPS signal.
  • 1 = Low GPS Signal.
  • 2 = Medium GPS Signal.
  • 3 = High GPS Signal.
integer Warning Warning enumerations, each warning is represented by a number.
  • 0 = No warnings.
  • 1 = Railway crossing.
  • 2 = Sharp left turn.
  • 3 = Sharp right turn.
  • 4 = Congestion.
  • 5 = Dangerous.
  • 6 = Police.
  • 7 = Speed camera.
  • 8 = Red light camera.
  • 9 = Average speed camera.
string City Name of the city.
string Street Name of the street.
string NextStreet Next street name.
string LeftNumber Numbers of buildings on left side of the road.
string RightNumber Numbers of buildings on right side of the road.
string RoadNumbers Unique road number.
integer LanesDistance Distance to travel in current lane.
integer LanesmapIndex Integer, for current map Index.
integer LanesCount Number of data stored about lane.
long array LaneData[n] Array of data available for current lane.
long array LaneRoadIDs Array of road IDs for particular lane.
integer DirValidPrimary Checks validity of primary command.
We do not recommend to use primary command if bDirValidPrimary is false (0), true (1).
integer DirValidSecondary Checks validity of secondary command.
We do not recommend to use secondary command if bDirValidSecondary is false (0), true (1).
integer DirCommandPrimary Upcoming instruction command, executed if bDIRValidPrimary true.
integer DirCommandSecondary Next to upcoming instruction command, executed if bDIRValidSecondary true.
integer DirDistance Distance to next instruction.
integer RBExitPrimary Determines primary exit from a roundabout.
integer RBExitSecondary Determines secondary exit from a roundabout.
integer CharsCount Number of characters stored in an array.
integer array PrimaryChars Array of characters used for the coming (next) instruction. See charset below.
integer array SecondaryChars Array of characters used for the second coming (next next) instruction. See charset below.

 

arrLaneData[n]

From each LaneData you can obtain the following information using these functions.

FunctionBodyDescription
GetLineType() return m_lData & 0x7 To get line type.
GetSymbol() return ( ( m_lData >> 4 ) & 0xfff Returns symbol for current lane.
IsExitEntrance() return ( ( m_lData >> 3 ) & 0x1 ) == 1; True - exit, False - entrance
IsHighlighted() return ( ( m_lData >> 31 ) & 0x1 ) == 1; True - lane highlighted, False - not highlighted lane
IsInverse() return ( ( m_lData >> 30 ) & 0x1 ) == 1; Whether lane is inverse.

 

Charset font

The charset codes retrieved through the bundle data define the graphical symbols as shown in the table bellow.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments