Core API Architecture
Overview
The SenseGlove API consists of two parts: A “connection library”, called SGConnect, whose main function is to detect SenseGlove devices and exchange raw data, and a “core library”, called SGCore, which takes this raw data from shared memory and transforms it into useable variables. SGConnect is integrated into an executable, called SenseCom. This program provides a user interface to show the connection status of your devices, and in the future, will be used to handle calibration and firmware updates.
The SenseGlove Core API follows an Object Oriented Programming paradigm: Each device is represented as an object from which to retrieve data and/or send commands.
Several (data) objects are passed as arguments into (static) functions that perform kinematic calculations.
All functions and classes written by SenseGlove developers are part of the SGCore namespace.
Each class that represents a SenseGlove device derives from an abstract SGDevice class. This superclass contains some basic functionality related to connection and device info.
The DeviceList class is used as the main interface to the SenseCom program. Use this class to check is the program is running and to get all SGDevices connected to the system.
There exists a static list of SGDevices in the DeviceList class. Whenever one requests access to new devices, that’s when shared memory is checked.
Objects returned through DeviceList (or via class-specific methods, such as SenseGlove.GetSenseGloves() ) are passed by reference; meaning that a device is only parsed once and not copied. You’re free to either cache this object or request it every time you need it.
All SenseGlove Device classes inherit from an abstract SGDevice class.