toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() => <String, Object?>{
  'sequence': sequence,
  'timestampUs': senderTimestampMicroseconds,
  'orientation': <double>[qx, qy, qz, qw],
  'angularVelocity': <double>[
    angularVelocityX,
    angularVelocityY,
    angularVelocityZ,
  ],
  'accelerometer': <double>[accelerometerX, accelerometerY, accelerometerZ],
  'buttons': buttonsBitset,
  if (touchX != null) 'touch': <double>[touchX!, touchY!],
  if (rangeMeters != null)
    'range': <String, Object?>{
      'meters': rangeMeters,
      'source': rangeSource!.name,
      if (rangeConfidence != null) 'confidence': rangeConfidence,
    },
};