ami-iit / yarp-openmct

Repo for YARP and OpenMCT integration.
BSD 3-Clause "New" or "Revised" License
6 stars 1 forks source link

fix IMU telemetry data sample format #3

Closed nunoguedelha closed 3 years ago

nunoguedelha commented 3 years ago

The initial IMU measurements telemetry sample used to be a compact number array format (Javascript Array) converted from a Yarp bottle (bottle.toArray()). Because of some limitations on the Open MCT framework side, we had to expand and explicit the fields of the composite measurements. Refer to https://github.com/dic-iit/element_software-engineering/issues/42#issuecomment-871062612 for more details, and to the commit comments). We defined the IMU measurement sample as a JSON object with nested properties lists:

iCubTelemetry.state = {
    "sens.imu": {
      "ori": {"roll": 0, "pitch": 0, "yaw": 0},
      "acc": {"x": 0, "y": 0, "z": 0},
      "gyr": {"x": 0, "y": 0, "z": 0},
      "mag": {"x": 0, "y": 0, "z": 0}
    }
};

We gathered all the sensor measurements (orientation, accelerometer, gyroscope) into a single telemetry sample in order to have them associated to a single timestamp.