Class QuestNavProtocol

java.lang.Object
frc.robot.subsystems.vision.QuestNavProtocol

public final class QuestNavProtocol extends Object
The few QuestNav protobuf messages FM uses, encoded and decoded by hand.

QuestNavLib's vendordep is built for WPILib 2026 and does not load on 2027. Its wire format is small and stable (QuestNav protos/data.proto, commands.proto and WPILib's geometry3d.proto), so rather than generate quickbuf classes this reads and writes the protobuf wire format directly:

ProtobufQuestNavFrameData  { int32 frame_count = 1; double timestamp = 2;
                             ProtobufPose3d pose3d = 3; bool isTracking = 4; }
ProtobufQuestNavDeviceData { int32 tracking_lost_counter = 1; int32 battery_percent = 3; }
ProtobufQuestNavCommand    { QuestNavCommandType type = 1; uint32 command_id = 2;
                             ProtobufQuestNavPoseResetPayload pose_reset_payload = 10; }
ProtobufQuestNavPoseResetPayload { ProtobufPose3d target_pose = 1; }
ProtobufPose3d { ProtobufTranslation3d translation = 1; ProtobufRotation3d rotation = 2; }
ProtobufTranslation3d { double x = 1; double y = 2; double z = 3; }
ProtobufRotation3d { ProtobufQuaternion q = 1; }
ProtobufQuaternion { double w = 1; double x = 2; double y = 3; double z = 4; }

Check this against the QuestNav app version on the headset before the event.

  • Field Details

  • Method Details

    • decodeFrame

      public static QuestNavProtocol.Frame decodeFrame(byte[] bytes)
      Decodes ProtobufQuestNavFrameData; null if the bytes are malformed.
    • decodeDeviceData

      public static QuestNavProtocol.DeviceData decodeDeviceData(byte[] bytes)
      Decodes ProtobufQuestNavDeviceData; null if malformed.
    • encodePoseReset

      public static byte[] encodePoseReset(int commandId, Pose3d questPose)
      Encodes a pose-reset command: the Quest re-origins so that its current pose reads questPose on the field.