Skip to content

Adding and Implementing New Sensors

Yeshasvi Tirupachuri edited this page Apr 5, 2019 · 1 revision

Adding and Implementing New Sensors

  • Add the name of the new sensor to the SensorType enum class

  • Add the sensor interface header file with all the member variables and methods inside the Sensor directory. Take a look at IVirtualLinkSensor to understand the interface implementation.

  • Add the interface header file of the new sensor to the IWear.h

  • Update the WearableData.thrift file that contains the data structure of the wearable message streamed by the wearable devices.

    • Add the new sensor data type under Sensor data types. Make use of already available Elementary Data Types to construct the new sensor data type. If the are not meeting your requirements, you can define new data types.
    • Add the new sensor data type under WearData structure.
  • Implement the newly added sensor in SensorImpl.h and SensorImpl.cpp

  • Update the IWearWrapper.cpp with the implementation of the new sensor.

  • Update the IWearRemapper.h with the virtual method overrided and implement the new sensor related data handling in IWearRemapper.cpp.

  • Update all the currently available wearable devices header and cpp files with the new sensor virtual methods overrider. Inside the cpp file return a nullptr if the device does not contain the new sensor.

  • If the new sensor is present in a wearable device, implement all the sensor methods and handle the sensor information correctly. For example, check VirtualJointKinSensor implementation in ICub wearable device.

NOTE: After adding a new sensor and updating the WearableData.thrift with the data of the new sensor, old data of wearable devices like XsensSuit that is saved without the updated WearableData.thrift file fail to work. This is because inside remapper, the call back methods on the wearable ports expects the new WearableData format.

Clone this wiki locally