UI Plugin

The UI Plugin implements a UI that is integrated directly into the pntOS-Python implementation. While it is always possible to write a graphical user interface (GUI) that listens to outputs and interacts with it externally, this plugin allows users to write a GUI that has direct access to the mediator. This allows for low latency and high performance GUI/UIs to be generated.

Note

The UI Plugin is designed for developer or research style UIs and not production environments. A user display in a production environment is better modeled as a Platform Integration Plugin, as that is designed to represent requests from the system and not simply status updates.

API Overview

The UI Plugin inherits from CommonPlugin, with the addition of the following methods:

  1. requires_main_thread() - This is a flag that indicates whether the UI plugin is required to run on the main thread. This may be required when using certain GUI backends that will only run on the main thread.

  2. run_main_thread() - This starts the plugin on the main thread. This method should only be called from the main thread and if requires_main_thread() returns True.

Note

A UI Plugin is not required to run on the main thread unless it is necessary for the implementation or the GUI backend used. However, in a case where multiple UI plugins are used, only one may require the main thread.

UI Plugin Implementations

Currently, Cobra offers the UiLogPlottingPlugin, which is a tutorial-level UI plugin that plots the pntOS-Python PVA solution vs. ground truth from a recorded LCM or ROS log file. This plugin generates plots upon shutdown, and is included in our tutorial apps to view the pntOS-Python solution after running the app.