Tracking Data Provider Plugin Development

The Tracking Data Provider Plugin accomodates tracking data in various formats. A user can utilize their own tracking data in any format and integrate them with ODTK.

Prerequisites

A tracking data provider plugin for the ODTK Runtime needs to be written in Python.

  • Python version 3.6 is required.
  • On Windows, the 32-bit executable version must be installed and its location is in the system path.
  • On Linux, the 64-bit version must be installed the LD_LIBRARY_PATH environment variable set to the Python lib folder.
    • Verify that the dependencies required for running a plugin are available by issuing the following command:
      ldd -r <install dir>/bin/libagodpythonpluginlib.so | grep "not found"

How to implement a plugin

Code samples are provided for plugin development.
  • On Linux, this is at <ODTK Install dir>/CodeSamples/TrackingDataProviders/Python.
  • On Windows, this is at <ODTK Install dir>CodeSamples\Extend\ODTK\TrackingDataProviders\Python.

Do the following to implement a tracking data provider plugin:

  • Make a copy of the CAgODProvideTrackingData_Template.py tracking data provider plugin template provided in the code samples folder.
  • Provide your custom implementation in functions as desired. Note: Do not rename the class; ODTK will look for the plugin class to be named 'CAgODProvideTrackingData'.

A sample plugin implementation, COBTrackingDataProvider.py is provided in the code samples folder.

ODTK Types available to a plugin

Various types are available to the plugin via the provided AgODPythonPluginLib module in the AgODPythonPluginLib.pyd file located in the ODTK bin folder. The module's docstring documentation , AgODPythonPluginLib_help.html, is provided in the code samples folder. You can also discover the types and documentation interactively from the Python console using the 'help' command. Do the following to get help on the available types:

  1. Run Python (32-bit on Windows, 64-bit on Linux).
  2. Ensure that the AgODPythonPluginLib.pyd file is in Python's system path.
  3. Import the library with an 'agi' alias by typing 'import AgODPythonPluginLib as agi' at the Python console.
  4. List the available types by typing 'help(agi)' at the Python console.
  5. Get help for a type by typing 'help(agi.<type>)' at the Python console; where <type> is the name of the type; e.g., 'help(agi.AgODObsSet)' will display help for the AgODObsSet class.

Note that the Python plugin code should be running in ODTK in order to access types in code; that is, you cannot use the types in a stand-alone script.

How to register a plugin on Linux

Register a plugin on Linux using the ODTK Cross-Platform API. A sample function is provided in the register_tracking_data_provider_plugin.py file in the code samples folder.

How to register a plugin on Windows

You can register a plugin on Windows using the ODTK Desktop application's user interface; ODTK Runtime on Windows uses the ODTK desktop configuration. Follow the steps to register the plugin:

  1. Run ODTK Desktop.
  2. Select 'Edit' > 'Preferences...' from the menu.
  3. Select 'Plugins' from the left pane of the 'Preferences' dialog.
  4. Click the 'Add...' button to add a new line to the Tracking Data Files Providers list.
  5. Click into the first field in the new line, 'Extensions', and list the file extension(s) to which the plugin will apply. If more than one extension is listed, separate them with semicolons (;).
  6. Click into the second field, 'Description', and add a brief description of the measurement file type(s).
  7. Click into the fourth field, 'PluginID', and enter 'AgODPythonPlugins6.AgODProvidePythonTrackingData.1' (with no quotes).
  8. Click the 'OK' button to exit the 'Preferences' dialog.
  9. Go back into the 'Preferences' dialog by selecting 'Edit' > 'Preferences...' from the menu.
  10. Select 'Plugins' from the left pane of the 'Preferences' dialog.
  11. Locate the row that you added from the previous steps and click its 'Config' field (labeled 'click to display') to display the plugin configuration dialog.
  12. Click into the 'PythonFile' field (labeled 'click to edit').
  13. Select your Python plugin file.
  14. Click the 'OK' button to exit the plugin configuration dialog.
  15. Click the 'OK' button to exit the 'Preferences' dialog.