Extending the Data Model

This article was written for version 2.0.9 of Core. Click here for the most recent version of the help center.

PolySync provides a set of data model modules that are commonly used to develop autonomous vehicles. The modules can be modified and extended to include new data types, custom messages, and trouble codes.

Provided data model modules include:

  • Control
  • Diagnostic Trouble Code (DTC)
  • Navigation
  • Sensor

Defined in these modules are the messages used to pass around sensor and high level data: the types, constants, enums, and parameters required to describe how the data is connected to each other.

Data model modules

Modules are defined using IDL files to describe C data structures and constants. Each module must follow a naming convention and define certain macros, such as the module major, minor, and subminor version digits.

Data Model Example

Once a module has been defined or modified, the data model libraries (.so) must be recompiled using the PolySync Data Model generator (pdm-gen) tool.

The PDM tool outputs a C and C++ API data model library:

  • libpolysync_data_model.so
  • libpolysync_cpp_message_support.so

To see all files that are generated, andwhere they need to be copied run the comand:

$ pdm-gen -h
...
output files (copied by user)
directory: 
    <file>                  -> <system-location>
    libpolysync_data_model.so       -> /lib
    libpolysync_cpp_message_support.so  -> /lib
    psync.h                 -> /pdm
    psyncDcps.h             -> /pdm
    psyncSacDcps.h              -> /pdm
    psyncSplDcps.h              -> /pdm
    psync.idl               -> used to generate libpolysync_data_model.so
    psyncSacDcps.c              -> symbols in libpolysync_data_model.so
    PolySyncDataModel.hpp           -> /pdm