mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
[wpiutil] Change C++ protobuf to nanopb (#7309)
The Google C++ protobuf implementation has issues with dynamic linkage across DLL boundaries because it uses global variables. It also has a compile-time dependency because the protoc version must exactly match the libprotobuf version. Using nanopb with a customized generator fixes both of these issues. Co-authored-by: Gold856 <117957790+Gold856@users.noreply.github.com>
This commit is contained in:
245
wpimath/src/generated/main/native/cpp/wpimath/protobuf/controller.npb.cpp
generated
Normal file
245
wpimath/src/generated/main/native/cpp/wpimath/protobuf/controller.npb.cpp
generated
Normal file
@@ -0,0 +1,245 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.9 */
|
||||
|
||||
#include "controller.npb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
static const uint8_t file_descriptor[] {
|
||||
0x0a,0x10,0x63,0x6f,0x6e,0x74,0x72,0x6f,0x6c,0x6c,
|
||||
0x65,0x72,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x12,0x09,
|
||||
0x77,0x70,0x69,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x22,
|
||||
0x68,0x0a,0x16,0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,
|
||||
0x66,0x41,0x72,0x6d,0x46,0x65,0x65,0x64,0x66,0x6f,
|
||||
0x72,0x77,0x61,0x72,0x64,0x12,0x0e,0x0a,0x02,0x6b,
|
||||
0x73,0x18,0x01,0x20,0x01,0x28,0x01,0x52,0x02,0x6b,
|
||||
0x73,0x12,0x0e,0x0a,0x02,0x6b,0x67,0x18,0x02,0x20,
|
||||
0x01,0x28,0x01,0x52,0x02,0x6b,0x67,0x12,0x0e,0x0a,
|
||||
0x02,0x6b,0x76,0x18,0x03,0x20,0x01,0x28,0x01,0x52,
|
||||
0x02,0x6b,0x76,0x12,0x0e,0x0a,0x02,0x6b,0x61,0x18,
|
||||
0x04,0x20,0x01,0x28,0x01,0x52,0x02,0x6b,0x61,0x12,
|
||||
0x0e,0x0a,0x02,0x64,0x74,0x18,0x05,0x20,0x01,0x28,
|
||||
0x01,0x52,0x02,0x64,0x74,0x22,0x9e,0x01,0x0a,0x24,
|
||||
0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x44,0x69,
|
||||
0x66,0x66,0x65,0x72,0x65,0x6e,0x74,0x69,0x61,0x6c,
|
||||
0x44,0x72,0x69,0x76,0x65,0x46,0x65,0x65,0x64,0x66,
|
||||
0x6f,0x72,0x77,0x61,0x72,0x64,0x12,0x1b,0x0a,0x09,
|
||||
0x6b,0x76,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x18,
|
||||
0x01,0x20,0x01,0x28,0x01,0x52,0x08,0x6b,0x76,0x4c,
|
||||
0x69,0x6e,0x65,0x61,0x72,0x12,0x1b,0x0a,0x09,0x6b,
|
||||
0x61,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x18,0x02,
|
||||
0x20,0x01,0x28,0x01,0x52,0x08,0x6b,0x61,0x4c,0x69,
|
||||
0x6e,0x65,0x61,0x72,0x12,0x1d,0x0a,0x0a,0x6b,0x76,
|
||||
0x5f,0x61,0x6e,0x67,0x75,0x6c,0x61,0x72,0x18,0x03,
|
||||
0x20,0x01,0x28,0x01,0x52,0x09,0x6b,0x76,0x41,0x6e,
|
||||
0x67,0x75,0x6c,0x61,0x72,0x12,0x1d,0x0a,0x0a,0x6b,
|
||||
0x61,0x5f,0x61,0x6e,0x67,0x75,0x6c,0x61,0x72,0x18,
|
||||
0x04,0x20,0x01,0x28,0x01,0x52,0x09,0x6b,0x61,0x41,
|
||||
0x6e,0x67,0x75,0x6c,0x61,0x72,0x22,0x6d,0x0a,0x1b,
|
||||
0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x45,0x6c,
|
||||
0x65,0x76,0x61,0x74,0x6f,0x72,0x46,0x65,0x65,0x64,
|
||||
0x66,0x6f,0x72,0x77,0x61,0x72,0x64,0x12,0x0e,0x0a,
|
||||
0x02,0x6b,0x73,0x18,0x01,0x20,0x01,0x28,0x01,0x52,
|
||||
0x02,0x6b,0x73,0x12,0x0e,0x0a,0x02,0x6b,0x67,0x18,
|
||||
0x02,0x20,0x01,0x28,0x01,0x52,0x02,0x6b,0x67,0x12,
|
||||
0x0e,0x0a,0x02,0x6b,0x76,0x18,0x03,0x20,0x01,0x28,
|
||||
0x01,0x52,0x02,0x6b,0x76,0x12,0x0e,0x0a,0x02,0x6b,
|
||||
0x61,0x18,0x04,0x20,0x01,0x28,0x01,0x52,0x02,0x6b,
|
||||
0x61,0x12,0x0e,0x0a,0x02,0x64,0x74,0x18,0x05,0x20,
|
||||
0x01,0x28,0x01,0x52,0x02,0x64,0x74,0x22,0x60,0x0a,
|
||||
0x1e,0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x53,
|
||||
0x69,0x6d,0x70,0x6c,0x65,0x4d,0x6f,0x74,0x6f,0x72,
|
||||
0x46,0x65,0x65,0x64,0x66,0x6f,0x72,0x77,0x61,0x72,
|
||||
0x64,0x12,0x0e,0x0a,0x02,0x6b,0x73,0x18,0x01,0x20,
|
||||
0x01,0x28,0x01,0x52,0x02,0x6b,0x73,0x12,0x0e,0x0a,
|
||||
0x02,0x6b,0x76,0x18,0x02,0x20,0x01,0x28,0x01,0x52,
|
||||
0x02,0x6b,0x76,0x12,0x0e,0x0a,0x02,0x6b,0x61,0x18,
|
||||
0x03,0x20,0x01,0x28,0x01,0x52,0x02,0x6b,0x61,0x12,
|
||||
0x0e,0x0a,0x02,0x64,0x74,0x18,0x04,0x20,0x01,0x28,
|
||||
0x01,0x52,0x02,0x64,0x74,0x22,0x52,0x0a,0x26,0x50,
|
||||
0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x44,0x69,0x66,
|
||||
0x66,0x65,0x72,0x65,0x6e,0x74,0x69,0x61,0x6c,0x44,
|
||||
0x72,0x69,0x76,0x65,0x57,0x68,0x65,0x65,0x6c,0x56,
|
||||
0x6f,0x6c,0x74,0x61,0x67,0x65,0x73,0x12,0x12,0x0a,
|
||||
0x04,0x6c,0x65,0x66,0x74,0x18,0x01,0x20,0x01,0x28,
|
||||
0x01,0x52,0x04,0x6c,0x65,0x66,0x74,0x12,0x14,0x0a,
|
||||
0x05,0x72,0x69,0x67,0x68,0x74,0x18,0x02,0x20,0x01,
|
||||
0x28,0x01,0x52,0x05,0x72,0x69,0x67,0x68,0x74,0x42,
|
||||
0x1a,0x0a,0x18,0x65,0x64,0x75,0x2e,0x77,0x70,0x69,
|
||||
0x2e,0x66,0x69,0x72,0x73,0x74,0x2e,0x6d,0x61,0x74,
|
||||
0x68,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x4a,0xf5,0x09,
|
||||
0x0a,0x06,0x12,0x04,0x00,0x00,0x27,0x01,0x0a,0x08,
|
||||
0x0a,0x01,0x0c,0x12,0x03,0x00,0x00,0x12,0x0a,0x08,
|
||||
0x0a,0x01,0x02,0x12,0x03,0x02,0x00,0x12,0x0a,0x08,
|
||||
0x0a,0x01,0x08,0x12,0x03,0x04,0x00,0x31,0x0a,0x09,
|
||||
0x0a,0x02,0x08,0x01,0x12,0x03,0x04,0x00,0x31,0x0a,
|
||||
0x0a,0x0a,0x02,0x04,0x00,0x12,0x04,0x06,0x00,0x0c,
|
||||
0x01,0x0a,0x0a,0x0a,0x03,0x04,0x00,0x01,0x12,0x03,
|
||||
0x06,0x08,0x1e,0x0a,0x0b,0x0a,0x04,0x04,0x00,0x02,
|
||||
0x00,0x12,0x03,0x07,0x02,0x10,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x00,0x02,0x00,0x05,0x12,0x03,0x07,0x02,0x08,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x00,0x01,0x12,
|
||||
0x03,0x07,0x09,0x0b,0x0a,0x0c,0x0a,0x05,0x04,0x00,
|
||||
0x02,0x00,0x03,0x12,0x03,0x07,0x0e,0x0f,0x0a,0x0b,
|
||||
0x0a,0x04,0x04,0x00,0x02,0x01,0x12,0x03,0x08,0x02,
|
||||
0x10,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x01,0x05,
|
||||
0x12,0x03,0x08,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x00,0x02,0x01,0x01,0x12,0x03,0x08,0x09,0x0b,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x00,0x02,0x01,0x03,0x12,0x03,
|
||||
0x08,0x0e,0x0f,0x0a,0x0b,0x0a,0x04,0x04,0x00,0x02,
|
||||
0x02,0x12,0x03,0x09,0x02,0x10,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x00,0x02,0x02,0x05,0x12,0x03,0x09,0x02,0x08,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x02,0x01,0x12,
|
||||
0x03,0x09,0x09,0x0b,0x0a,0x0c,0x0a,0x05,0x04,0x00,
|
||||
0x02,0x02,0x03,0x12,0x03,0x09,0x0e,0x0f,0x0a,0x0b,
|
||||
0x0a,0x04,0x04,0x00,0x02,0x03,0x12,0x03,0x0a,0x02,
|
||||
0x10,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x03,0x05,
|
||||
0x12,0x03,0x0a,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x00,0x02,0x03,0x01,0x12,0x03,0x0a,0x09,0x0b,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x00,0x02,0x03,0x03,0x12,0x03,
|
||||
0x0a,0x0e,0x0f,0x0a,0x0b,0x0a,0x04,0x04,0x00,0x02,
|
||||
0x04,0x12,0x03,0x0b,0x02,0x10,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x00,0x02,0x04,0x05,0x12,0x03,0x0b,0x02,0x08,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x04,0x01,0x12,
|
||||
0x03,0x0b,0x09,0x0b,0x0a,0x0c,0x0a,0x05,0x04,0x00,
|
||||
0x02,0x04,0x03,0x12,0x03,0x0b,0x0e,0x0f,0x0a,0x0a,
|
||||
0x0a,0x02,0x04,0x01,0x12,0x04,0x0e,0x00,0x13,0x01,
|
||||
0x0a,0x0a,0x0a,0x03,0x04,0x01,0x01,0x12,0x03,0x0e,
|
||||
0x08,0x2c,0x0a,0x0b,0x0a,0x04,0x04,0x01,0x02,0x00,
|
||||
0x12,0x03,0x0f,0x02,0x17,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x01,0x02,0x00,0x05,0x12,0x03,0x0f,0x02,0x08,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x01,0x02,0x00,0x01,0x12,0x03,
|
||||
0x0f,0x09,0x12,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,
|
||||
0x00,0x03,0x12,0x03,0x0f,0x15,0x16,0x0a,0x0b,0x0a,
|
||||
0x04,0x04,0x01,0x02,0x01,0x12,0x03,0x10,0x02,0x17,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x01,0x05,0x12,
|
||||
0x03,0x10,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x01,
|
||||
0x02,0x01,0x01,0x12,0x03,0x10,0x09,0x12,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x01,0x02,0x01,0x03,0x12,0x03,0x10,
|
||||
0x15,0x16,0x0a,0x0b,0x0a,0x04,0x04,0x01,0x02,0x02,
|
||||
0x12,0x03,0x11,0x02,0x18,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x01,0x02,0x02,0x05,0x12,0x03,0x11,0x02,0x08,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x01,0x02,0x02,0x01,0x12,0x03,
|
||||
0x11,0x09,0x13,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,
|
||||
0x02,0x03,0x12,0x03,0x11,0x16,0x17,0x0a,0x0b,0x0a,
|
||||
0x04,0x04,0x01,0x02,0x03,0x12,0x03,0x12,0x02,0x18,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x03,0x05,0x12,
|
||||
0x03,0x12,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x01,
|
||||
0x02,0x03,0x01,0x12,0x03,0x12,0x09,0x13,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x01,0x02,0x03,0x03,0x12,0x03,0x12,
|
||||
0x16,0x17,0x0a,0x0a,0x0a,0x02,0x04,0x02,0x12,0x04,
|
||||
0x15,0x00,0x1b,0x01,0x0a,0x0a,0x0a,0x03,0x04,0x02,
|
||||
0x01,0x12,0x03,0x15,0x08,0x23,0x0a,0x0b,0x0a,0x04,
|
||||
0x04,0x02,0x02,0x00,0x12,0x03,0x16,0x02,0x10,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x02,0x02,0x00,0x05,0x12,0x03,
|
||||
0x16,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x02,0x02,
|
||||
0x00,0x01,0x12,0x03,0x16,0x09,0x0b,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x02,0x02,0x00,0x03,0x12,0x03,0x16,0x0e,
|
||||
0x0f,0x0a,0x0b,0x0a,0x04,0x04,0x02,0x02,0x01,0x12,
|
||||
0x03,0x17,0x02,0x10,0x0a,0x0c,0x0a,0x05,0x04,0x02,
|
||||
0x02,0x01,0x05,0x12,0x03,0x17,0x02,0x08,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x02,0x02,0x01,0x01,0x12,0x03,0x17,
|
||||
0x09,0x0b,0x0a,0x0c,0x0a,0x05,0x04,0x02,0x02,0x01,
|
||||
0x03,0x12,0x03,0x17,0x0e,0x0f,0x0a,0x0b,0x0a,0x04,
|
||||
0x04,0x02,0x02,0x02,0x12,0x03,0x18,0x02,0x10,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x02,0x02,0x02,0x05,0x12,0x03,
|
||||
0x18,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x02,0x02,
|
||||
0x02,0x01,0x12,0x03,0x18,0x09,0x0b,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x02,0x02,0x02,0x03,0x12,0x03,0x18,0x0e,
|
||||
0x0f,0x0a,0x0b,0x0a,0x04,0x04,0x02,0x02,0x03,0x12,
|
||||
0x03,0x19,0x02,0x10,0x0a,0x0c,0x0a,0x05,0x04,0x02,
|
||||
0x02,0x03,0x05,0x12,0x03,0x19,0x02,0x08,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x02,0x02,0x03,0x01,0x12,0x03,0x19,
|
||||
0x09,0x0b,0x0a,0x0c,0x0a,0x05,0x04,0x02,0x02,0x03,
|
||||
0x03,0x12,0x03,0x19,0x0e,0x0f,0x0a,0x0b,0x0a,0x04,
|
||||
0x04,0x02,0x02,0x04,0x12,0x03,0x1a,0x02,0x10,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x02,0x02,0x04,0x05,0x12,0x03,
|
||||
0x1a,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x02,0x02,
|
||||
0x04,0x01,0x12,0x03,0x1a,0x09,0x0b,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x02,0x02,0x04,0x03,0x12,0x03,0x1a,0x0e,
|
||||
0x0f,0x0a,0x0a,0x0a,0x02,0x04,0x03,0x12,0x04,0x1d,
|
||||
0x00,0x22,0x01,0x0a,0x0a,0x0a,0x03,0x04,0x03,0x01,
|
||||
0x12,0x03,0x1d,0x08,0x26,0x0a,0x0b,0x0a,0x04,0x04,
|
||||
0x03,0x02,0x00,0x12,0x03,0x1e,0x02,0x10,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x03,0x02,0x00,0x05,0x12,0x03,0x1e,
|
||||
0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x03,0x02,0x00,
|
||||
0x01,0x12,0x03,0x1e,0x09,0x0b,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x03,0x02,0x00,0x03,0x12,0x03,0x1e,0x0e,0x0f,
|
||||
0x0a,0x0b,0x0a,0x04,0x04,0x03,0x02,0x01,0x12,0x03,
|
||||
0x1f,0x02,0x10,0x0a,0x0c,0x0a,0x05,0x04,0x03,0x02,
|
||||
0x01,0x05,0x12,0x03,0x1f,0x02,0x08,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x03,0x02,0x01,0x01,0x12,0x03,0x1f,0x09,
|
||||
0x0b,0x0a,0x0c,0x0a,0x05,0x04,0x03,0x02,0x01,0x03,
|
||||
0x12,0x03,0x1f,0x0e,0x0f,0x0a,0x0b,0x0a,0x04,0x04,
|
||||
0x03,0x02,0x02,0x12,0x03,0x20,0x02,0x10,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x03,0x02,0x02,0x05,0x12,0x03,0x20,
|
||||
0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x03,0x02,0x02,
|
||||
0x01,0x12,0x03,0x20,0x09,0x0b,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x03,0x02,0x02,0x03,0x12,0x03,0x20,0x0e,0x0f,
|
||||
0x0a,0x0b,0x0a,0x04,0x04,0x03,0x02,0x03,0x12,0x03,
|
||||
0x21,0x02,0x10,0x0a,0x0c,0x0a,0x05,0x04,0x03,0x02,
|
||||
0x03,0x05,0x12,0x03,0x21,0x02,0x08,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x03,0x02,0x03,0x01,0x12,0x03,0x21,0x09,
|
||||
0x0b,0x0a,0x0c,0x0a,0x05,0x04,0x03,0x02,0x03,0x03,
|
||||
0x12,0x03,0x21,0x0e,0x0f,0x0a,0x0a,0x0a,0x02,0x04,
|
||||
0x04,0x12,0x04,0x24,0x00,0x27,0x01,0x0a,0x0a,0x0a,
|
||||
0x03,0x04,0x04,0x01,0x12,0x03,0x24,0x08,0x2e,0x0a,
|
||||
0x0b,0x0a,0x04,0x04,0x04,0x02,0x00,0x12,0x03,0x25,
|
||||
0x02,0x12,0x0a,0x0c,0x0a,0x05,0x04,0x04,0x02,0x00,
|
||||
0x05,0x12,0x03,0x25,0x02,0x08,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x04,0x02,0x00,0x01,0x12,0x03,0x25,0x09,0x0d,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x04,0x02,0x00,0x03,0x12,
|
||||
0x03,0x25,0x10,0x11,0x0a,0x0b,0x0a,0x04,0x04,0x04,
|
||||
0x02,0x01,0x12,0x03,0x26,0x02,0x13,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x04,0x02,0x01,0x05,0x12,0x03,0x26,0x02,
|
||||
0x08,0x0a,0x0c,0x0a,0x05,0x04,0x04,0x02,0x01,0x01,
|
||||
0x12,0x03,0x26,0x09,0x0e,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x04,0x02,0x01,0x03,0x12,0x03,0x26,0x11,0x12,0x62,
|
||||
0x06,0x70,0x72,0x6f,0x74,0x6f,0x33,
|
||||
};
|
||||
static const char file_name[] = "controller.proto";
|
||||
static const char wpi_proto_ProtobufArmFeedforward_name[] = "wpi.proto.ProtobufArmFeedforward";
|
||||
std::string_view wpi_proto_ProtobufArmFeedforward::msg_name(void) noexcept { return wpi_proto_ProtobufArmFeedforward_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufArmFeedforward::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufArmFeedforward, wpi_proto_ProtobufArmFeedforward, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufDifferentialDriveFeedforward_name[] = "wpi.proto.ProtobufDifferentialDriveFeedforward";
|
||||
std::string_view wpi_proto_ProtobufDifferentialDriveFeedforward::msg_name(void) noexcept { return wpi_proto_ProtobufDifferentialDriveFeedforward_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufDifferentialDriveFeedforward::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufDifferentialDriveFeedforward, wpi_proto_ProtobufDifferentialDriveFeedforward, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufElevatorFeedforward_name[] = "wpi.proto.ProtobufElevatorFeedforward";
|
||||
std::string_view wpi_proto_ProtobufElevatorFeedforward::msg_name(void) noexcept { return wpi_proto_ProtobufElevatorFeedforward_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufElevatorFeedforward::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufElevatorFeedforward, wpi_proto_ProtobufElevatorFeedforward, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufSimpleMotorFeedforward_name[] = "wpi.proto.ProtobufSimpleMotorFeedforward";
|
||||
std::string_view wpi_proto_ProtobufSimpleMotorFeedforward::msg_name(void) noexcept { return wpi_proto_ProtobufSimpleMotorFeedforward_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufSimpleMotorFeedforward::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufSimpleMotorFeedforward, wpi_proto_ProtobufSimpleMotorFeedforward, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufDifferentialDriveWheelVoltages_name[] = "wpi.proto.ProtobufDifferentialDriveWheelVoltages";
|
||||
std::string_view wpi_proto_ProtobufDifferentialDriveWheelVoltages::msg_name(void) noexcept { return wpi_proto_ProtobufDifferentialDriveWheelVoltages_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufDifferentialDriveWheelVoltages::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufDifferentialDriveWheelVoltages, wpi_proto_ProtobufDifferentialDriveWheelVoltages, AUTO)
|
||||
|
||||
|
||||
|
||||
#ifndef PB_CONVERT_DOUBLE_FLOAT
|
||||
/* On some platforms (such as AVR), double is really float.
|
||||
* To be able to encode/decode double on these platforms, you need.
|
||||
* to define PB_CONVERT_DOUBLE_FLOAT in pb.h or compiler command line.
|
||||
*/
|
||||
PB_STATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES)
|
||||
#endif
|
||||
|
||||
158
wpimath/src/generated/main/native/cpp/wpimath/protobuf/controller.npb.h
generated
Normal file
158
wpimath/src/generated/main/native/cpp/wpimath/protobuf/controller.npb.h
generated
Normal file
@@ -0,0 +1,158 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.9 */
|
||||
|
||||
#ifndef PB_WPI_PROTO_CONTROLLER_NPB_H_INCLUDED
|
||||
#define PB_WPI_PROTO_CONTROLLER_NPB_H_INCLUDED
|
||||
#include <pb.h>
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
/* Struct definitions */
|
||||
typedef struct _wpi_proto_ProtobufArmFeedforward {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double ks;
|
||||
double kg;
|
||||
double kv;
|
||||
double ka;
|
||||
double dt;
|
||||
} wpi_proto_ProtobufArmFeedforward;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufDifferentialDriveFeedforward {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double kv_linear;
|
||||
double ka_linear;
|
||||
double kv_angular;
|
||||
double ka_angular;
|
||||
} wpi_proto_ProtobufDifferentialDriveFeedforward;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufElevatorFeedforward {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double ks;
|
||||
double kg;
|
||||
double kv;
|
||||
double ka;
|
||||
double dt;
|
||||
} wpi_proto_ProtobufElevatorFeedforward;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufSimpleMotorFeedforward {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double ks;
|
||||
double kv;
|
||||
double ka;
|
||||
double dt;
|
||||
} wpi_proto_ProtobufSimpleMotorFeedforward;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufDifferentialDriveWheelVoltages {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double left;
|
||||
double right;
|
||||
} wpi_proto_ProtobufDifferentialDriveWheelVoltages;
|
||||
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define wpi_proto_ProtobufArmFeedforward_init_default {0, 0, 0, 0, 0}
|
||||
#define wpi_proto_ProtobufDifferentialDriveFeedforward_init_default {0, 0, 0, 0}
|
||||
#define wpi_proto_ProtobufElevatorFeedforward_init_default {0, 0, 0, 0, 0}
|
||||
#define wpi_proto_ProtobufSimpleMotorFeedforward_init_default {0, 0, 0, 0}
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelVoltages_init_default {0, 0}
|
||||
#define wpi_proto_ProtobufArmFeedforward_init_zero {0, 0, 0, 0, 0}
|
||||
#define wpi_proto_ProtobufDifferentialDriveFeedforward_init_zero {0, 0, 0, 0}
|
||||
#define wpi_proto_ProtobufElevatorFeedforward_init_zero {0, 0, 0, 0, 0}
|
||||
#define wpi_proto_ProtobufSimpleMotorFeedforward_init_zero {0, 0, 0, 0}
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelVoltages_init_zero {0, 0}
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define wpi_proto_ProtobufArmFeedforward_ks_tag 1
|
||||
#define wpi_proto_ProtobufArmFeedforward_kg_tag 2
|
||||
#define wpi_proto_ProtobufArmFeedforward_kv_tag 3
|
||||
#define wpi_proto_ProtobufArmFeedforward_ka_tag 4
|
||||
#define wpi_proto_ProtobufArmFeedforward_dt_tag 5
|
||||
#define wpi_proto_ProtobufDifferentialDriveFeedforward_kv_linear_tag 1
|
||||
#define wpi_proto_ProtobufDifferentialDriveFeedforward_ka_linear_tag 2
|
||||
#define wpi_proto_ProtobufDifferentialDriveFeedforward_kv_angular_tag 3
|
||||
#define wpi_proto_ProtobufDifferentialDriveFeedforward_ka_angular_tag 4
|
||||
#define wpi_proto_ProtobufElevatorFeedforward_ks_tag 1
|
||||
#define wpi_proto_ProtobufElevatorFeedforward_kg_tag 2
|
||||
#define wpi_proto_ProtobufElevatorFeedforward_kv_tag 3
|
||||
#define wpi_proto_ProtobufElevatorFeedforward_ka_tag 4
|
||||
#define wpi_proto_ProtobufElevatorFeedforward_dt_tag 5
|
||||
#define wpi_proto_ProtobufSimpleMotorFeedforward_ks_tag 1
|
||||
#define wpi_proto_ProtobufSimpleMotorFeedforward_kv_tag 2
|
||||
#define wpi_proto_ProtobufSimpleMotorFeedforward_ka_tag 3
|
||||
#define wpi_proto_ProtobufSimpleMotorFeedforward_dt_tag 4
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelVoltages_left_tag 1
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelVoltages_right_tag 2
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define wpi_proto_ProtobufArmFeedforward_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, ks, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, kg, 2) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, kv, 3) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, ka, 4) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, dt, 5)
|
||||
#define wpi_proto_ProtobufArmFeedforward_CALLBACK NULL
|
||||
#define wpi_proto_ProtobufArmFeedforward_DEFAULT NULL
|
||||
|
||||
#define wpi_proto_ProtobufDifferentialDriveFeedforward_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, kv_linear, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, ka_linear, 2) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, kv_angular, 3) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, ka_angular, 4)
|
||||
#define wpi_proto_ProtobufDifferentialDriveFeedforward_CALLBACK NULL
|
||||
#define wpi_proto_ProtobufDifferentialDriveFeedforward_DEFAULT NULL
|
||||
|
||||
#define wpi_proto_ProtobufElevatorFeedforward_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, ks, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, kg, 2) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, kv, 3) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, ka, 4) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, dt, 5)
|
||||
#define wpi_proto_ProtobufElevatorFeedforward_CALLBACK NULL
|
||||
#define wpi_proto_ProtobufElevatorFeedforward_DEFAULT NULL
|
||||
|
||||
#define wpi_proto_ProtobufSimpleMotorFeedforward_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, ks, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, kv, 2) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, ka, 3) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, dt, 4)
|
||||
#define wpi_proto_ProtobufSimpleMotorFeedforward_CALLBACK NULL
|
||||
#define wpi_proto_ProtobufSimpleMotorFeedforward_DEFAULT NULL
|
||||
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelVoltages_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, left, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, right, 2)
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelVoltages_CALLBACK NULL
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelVoltages_DEFAULT NULL
|
||||
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
#define WPI_PROTO_CONTROLLER_NPB_H_MAX_SIZE wpi_proto_ProtobufArmFeedforward_size
|
||||
#define wpi_proto_ProtobufArmFeedforward_size 45
|
||||
#define wpi_proto_ProtobufDifferentialDriveFeedforward_size 36
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelVoltages_size 18
|
||||
#define wpi_proto_ProtobufElevatorFeedforward_size 45
|
||||
#define wpi_proto_ProtobufSimpleMotorFeedforward_size 36
|
||||
|
||||
|
||||
#endif
|
||||
256
wpimath/src/generated/main/native/cpp/wpimath/protobuf/geometry2d.npb.cpp
generated
Normal file
256
wpimath/src/generated/main/native/cpp/wpimath/protobuf/geometry2d.npb.cpp
generated
Normal file
@@ -0,0 +1,256 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.9 */
|
||||
|
||||
#include "geometry2d.npb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
static const uint8_t file_descriptor[] {
|
||||
0x0a,0x10,0x67,0x65,0x6f,0x6d,0x65,0x74,0x72,0x79,
|
||||
0x32,0x64,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x12,0x09,
|
||||
0x77,0x70,0x69,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x22,
|
||||
0x33,0x0a,0x15,0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,
|
||||
0x66,0x54,0x72,0x61,0x6e,0x73,0x6c,0x61,0x74,0x69,
|
||||
0x6f,0x6e,0x32,0x64,0x12,0x0c,0x0a,0x01,0x78,0x18,
|
||||
0x01,0x20,0x01,0x28,0x01,0x52,0x01,0x78,0x12,0x0c,
|
||||
0x0a,0x01,0x79,0x18,0x02,0x20,0x01,0x28,0x01,0x52,
|
||||
0x01,0x79,0x22,0x2a,0x0a,0x12,0x50,0x72,0x6f,0x74,
|
||||
0x6f,0x62,0x75,0x66,0x52,0x6f,0x74,0x61,0x74,0x69,
|
||||
0x6f,0x6e,0x32,0x64,0x12,0x14,0x0a,0x05,0x76,0x61,
|
||||
0x6c,0x75,0x65,0x18,0x01,0x20,0x01,0x28,0x01,0x52,
|
||||
0x05,0x76,0x61,0x6c,0x75,0x65,0x22,0x8f,0x01,0x0a,
|
||||
0x0e,0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x50,
|
||||
0x6f,0x73,0x65,0x32,0x64,0x12,0x42,0x0a,0x0b,0x74,
|
||||
0x72,0x61,0x6e,0x73,0x6c,0x61,0x74,0x69,0x6f,0x6e,
|
||||
0x18,0x01,0x20,0x01,0x28,0x0b,0x32,0x20,0x2e,0x77,
|
||||
0x70,0x69,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x2e,0x50,
|
||||
0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x54,0x72,0x61,
|
||||
0x6e,0x73,0x6c,0x61,0x74,0x69,0x6f,0x6e,0x32,0x64,
|
||||
0x52,0x0b,0x74,0x72,0x61,0x6e,0x73,0x6c,0x61,0x74,
|
||||
0x69,0x6f,0x6e,0x12,0x39,0x0a,0x08,0x72,0x6f,0x74,
|
||||
0x61,0x74,0x69,0x6f,0x6e,0x18,0x02,0x20,0x01,0x28,
|
||||
0x0b,0x32,0x1d,0x2e,0x77,0x70,0x69,0x2e,0x70,0x72,
|
||||
0x6f,0x74,0x6f,0x2e,0x50,0x72,0x6f,0x74,0x6f,0x62,
|
||||
0x75,0x66,0x52,0x6f,0x74,0x61,0x74,0x69,0x6f,0x6e,
|
||||
0x32,0x64,0x52,0x08,0x72,0x6f,0x74,0x61,0x74,0x69,
|
||||
0x6f,0x6e,0x22,0x94,0x01,0x0a,0x13,0x50,0x72,0x6f,
|
||||
0x74,0x6f,0x62,0x75,0x66,0x54,0x72,0x61,0x6e,0x73,
|
||||
0x66,0x6f,0x72,0x6d,0x32,0x64,0x12,0x42,0x0a,0x0b,
|
||||
0x74,0x72,0x61,0x6e,0x73,0x6c,0x61,0x74,0x69,0x6f,
|
||||
0x6e,0x18,0x01,0x20,0x01,0x28,0x0b,0x32,0x20,0x2e,
|
||||
0x77,0x70,0x69,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x2e,
|
||||
0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x54,0x72,
|
||||
0x61,0x6e,0x73,0x6c,0x61,0x74,0x69,0x6f,0x6e,0x32,
|
||||
0x64,0x52,0x0b,0x74,0x72,0x61,0x6e,0x73,0x6c,0x61,
|
||||
0x74,0x69,0x6f,0x6e,0x12,0x39,0x0a,0x08,0x72,0x6f,
|
||||
0x74,0x61,0x74,0x69,0x6f,0x6e,0x18,0x02,0x20,0x01,
|
||||
0x28,0x0b,0x32,0x1d,0x2e,0x77,0x70,0x69,0x2e,0x70,
|
||||
0x72,0x6f,0x74,0x6f,0x2e,0x50,0x72,0x6f,0x74,0x6f,
|
||||
0x62,0x75,0x66,0x52,0x6f,0x74,0x61,0x74,0x69,0x6f,
|
||||
0x6e,0x32,0x64,0x52,0x08,0x72,0x6f,0x74,0x61,0x74,
|
||||
0x69,0x6f,0x6e,0x22,0x49,0x0a,0x0f,0x50,0x72,0x6f,
|
||||
0x74,0x6f,0x62,0x75,0x66,0x54,0x77,0x69,0x73,0x74,
|
||||
0x32,0x64,0x12,0x0e,0x0a,0x02,0x64,0x78,0x18,0x01,
|
||||
0x20,0x01,0x28,0x01,0x52,0x02,0x64,0x78,0x12,0x0e,
|
||||
0x0a,0x02,0x64,0x79,0x18,0x02,0x20,0x01,0x28,0x01,
|
||||
0x52,0x02,0x64,0x79,0x12,0x16,0x0a,0x06,0x64,0x74,
|
||||
0x68,0x65,0x74,0x61,0x18,0x03,0x20,0x01,0x28,0x01,
|
||||
0x52,0x06,0x64,0x74,0x68,0x65,0x74,0x61,0x22,0x78,
|
||||
0x0a,0x13,0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,
|
||||
0x52,0x65,0x63,0x74,0x61,0x6e,0x67,0x6c,0x65,0x32,
|
||||
0x64,0x12,0x31,0x0a,0x06,0x63,0x65,0x6e,0x74,0x65,
|
||||
0x72,0x18,0x01,0x20,0x01,0x28,0x0b,0x32,0x19,0x2e,
|
||||
0x77,0x70,0x69,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x2e,
|
||||
0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x50,0x6f,
|
||||
0x73,0x65,0x32,0x64,0x52,0x06,0x63,0x65,0x6e,0x74,
|
||||
0x65,0x72,0x12,0x16,0x0a,0x06,0x78,0x57,0x69,0x64,
|
||||
0x74,0x68,0x18,0x02,0x20,0x01,0x28,0x01,0x52,0x06,
|
||||
0x78,0x57,0x69,0x64,0x74,0x68,0x12,0x16,0x0a,0x06,
|
||||
0x79,0x57,0x69,0x64,0x74,0x68,0x18,0x03,0x20,0x01,
|
||||
0x28,0x01,0x52,0x06,0x79,0x57,0x69,0x64,0x74,0x68,
|
||||
0x22,0x82,0x01,0x0a,0x11,0x50,0x72,0x6f,0x74,0x6f,
|
||||
0x62,0x75,0x66,0x45,0x6c,0x6c,0x69,0x70,0x73,0x65,
|
||||
0x32,0x64,0x12,0x31,0x0a,0x06,0x63,0x65,0x6e,0x74,
|
||||
0x65,0x72,0x18,0x01,0x20,0x01,0x28,0x0b,0x32,0x19,
|
||||
0x2e,0x77,0x70,0x69,0x2e,0x70,0x72,0x6f,0x74,0x6f,
|
||||
0x2e,0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x50,
|
||||
0x6f,0x73,0x65,0x32,0x64,0x52,0x06,0x63,0x65,0x6e,
|
||||
0x74,0x65,0x72,0x12,0x1c,0x0a,0x09,0x78,0x53,0x65,
|
||||
0x6d,0x69,0x41,0x78,0x69,0x73,0x18,0x02,0x20,0x01,
|
||||
0x28,0x01,0x52,0x09,0x78,0x53,0x65,0x6d,0x69,0x41,
|
||||
0x78,0x69,0x73,0x12,0x1c,0x0a,0x09,0x79,0x53,0x65,
|
||||
0x6d,0x69,0x41,0x78,0x69,0x73,0x18,0x03,0x20,0x01,
|
||||
0x28,0x01,0x52,0x09,0x79,0x53,0x65,0x6d,0x69,0x41,
|
||||
0x78,0x69,0x73,0x42,0x1a,0x0a,0x18,0x65,0x64,0x75,
|
||||
0x2e,0x77,0x70,0x69,0x2e,0x66,0x69,0x72,0x73,0x74,
|
||||
0x2e,0x6d,0x61,0x74,0x68,0x2e,0x70,0x72,0x6f,0x74,
|
||||
0x6f,0x4a,0xc9,0x08,0x0a,0x06,0x12,0x04,0x00,0x00,
|
||||
0x29,0x01,0x0a,0x08,0x0a,0x01,0x0c,0x12,0x03,0x00,
|
||||
0x00,0x12,0x0a,0x08,0x0a,0x01,0x02,0x12,0x03,0x02,
|
||||
0x00,0x12,0x0a,0x08,0x0a,0x01,0x08,0x12,0x03,0x04,
|
||||
0x00,0x31,0x0a,0x09,0x0a,0x02,0x08,0x01,0x12,0x03,
|
||||
0x04,0x00,0x31,0x0a,0x0a,0x0a,0x02,0x04,0x00,0x12,
|
||||
0x04,0x06,0x00,0x09,0x01,0x0a,0x0a,0x0a,0x03,0x04,
|
||||
0x00,0x01,0x12,0x03,0x06,0x08,0x1d,0x0a,0x0b,0x0a,
|
||||
0x04,0x04,0x00,0x02,0x00,0x12,0x03,0x07,0x02,0x0f,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x00,0x05,0x12,
|
||||
0x03,0x07,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x00,
|
||||
0x02,0x00,0x01,0x12,0x03,0x07,0x09,0x0a,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x00,0x02,0x00,0x03,0x12,0x03,0x07,
|
||||
0x0d,0x0e,0x0a,0x0b,0x0a,0x04,0x04,0x00,0x02,0x01,
|
||||
0x12,0x03,0x08,0x02,0x0f,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x00,0x02,0x01,0x05,0x12,0x03,0x08,0x02,0x08,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x00,0x02,0x01,0x01,0x12,0x03,
|
||||
0x08,0x09,0x0a,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,
|
||||
0x01,0x03,0x12,0x03,0x08,0x0d,0x0e,0x0a,0x0a,0x0a,
|
||||
0x02,0x04,0x01,0x12,0x04,0x0b,0x00,0x0d,0x01,0x0a,
|
||||
0x0a,0x0a,0x03,0x04,0x01,0x01,0x12,0x03,0x0b,0x08,
|
||||
0x1a,0x0a,0x0b,0x0a,0x04,0x04,0x01,0x02,0x00,0x12,
|
||||
0x03,0x0c,0x02,0x13,0x0a,0x0c,0x0a,0x05,0x04,0x01,
|
||||
0x02,0x00,0x05,0x12,0x03,0x0c,0x02,0x08,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x01,0x02,0x00,0x01,0x12,0x03,0x0c,
|
||||
0x09,0x0e,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x00,
|
||||
0x03,0x12,0x03,0x0c,0x11,0x12,0x0a,0x0a,0x0a,0x02,
|
||||
0x04,0x02,0x12,0x04,0x0f,0x00,0x12,0x01,0x0a,0x0a,
|
||||
0x0a,0x03,0x04,0x02,0x01,0x12,0x03,0x0f,0x08,0x16,
|
||||
0x0a,0x0b,0x0a,0x04,0x04,0x02,0x02,0x00,0x12,0x03,
|
||||
0x10,0x02,0x28,0x0a,0x0c,0x0a,0x05,0x04,0x02,0x02,
|
||||
0x00,0x06,0x12,0x03,0x10,0x02,0x17,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x02,0x02,0x00,0x01,0x12,0x03,0x10,0x18,
|
||||
0x23,0x0a,0x0c,0x0a,0x05,0x04,0x02,0x02,0x00,0x03,
|
||||
0x12,0x03,0x10,0x26,0x27,0x0a,0x0b,0x0a,0x04,0x04,
|
||||
0x02,0x02,0x01,0x12,0x03,0x11,0x02,0x22,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x02,0x02,0x01,0x06,0x12,0x03,0x11,
|
||||
0x02,0x14,0x0a,0x0c,0x0a,0x05,0x04,0x02,0x02,0x01,
|
||||
0x01,0x12,0x03,0x11,0x15,0x1d,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x02,0x02,0x01,0x03,0x12,0x03,0x11,0x20,0x21,
|
||||
0x0a,0x0a,0x0a,0x02,0x04,0x03,0x12,0x04,0x14,0x00,
|
||||
0x17,0x01,0x0a,0x0a,0x0a,0x03,0x04,0x03,0x01,0x12,
|
||||
0x03,0x14,0x08,0x1b,0x0a,0x0b,0x0a,0x04,0x04,0x03,
|
||||
0x02,0x00,0x12,0x03,0x15,0x02,0x28,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x03,0x02,0x00,0x06,0x12,0x03,0x15,0x02,
|
||||
0x17,0x0a,0x0c,0x0a,0x05,0x04,0x03,0x02,0x00,0x01,
|
||||
0x12,0x03,0x15,0x18,0x23,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x03,0x02,0x00,0x03,0x12,0x03,0x15,0x26,0x27,0x0a,
|
||||
0x0b,0x0a,0x04,0x04,0x03,0x02,0x01,0x12,0x03,0x16,
|
||||
0x02,0x22,0x0a,0x0c,0x0a,0x05,0x04,0x03,0x02,0x01,
|
||||
0x06,0x12,0x03,0x16,0x02,0x14,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x03,0x02,0x01,0x01,0x12,0x03,0x16,0x15,0x1d,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x03,0x02,0x01,0x03,0x12,
|
||||
0x03,0x16,0x20,0x21,0x0a,0x0a,0x0a,0x02,0x04,0x04,
|
||||
0x12,0x04,0x19,0x00,0x1d,0x01,0x0a,0x0a,0x0a,0x03,
|
||||
0x04,0x04,0x01,0x12,0x03,0x19,0x08,0x17,0x0a,0x0b,
|
||||
0x0a,0x04,0x04,0x04,0x02,0x00,0x12,0x03,0x1a,0x02,
|
||||
0x10,0x0a,0x0c,0x0a,0x05,0x04,0x04,0x02,0x00,0x05,
|
||||
0x12,0x03,0x1a,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x04,0x02,0x00,0x01,0x12,0x03,0x1a,0x09,0x0b,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x04,0x02,0x00,0x03,0x12,0x03,
|
||||
0x1a,0x0e,0x0f,0x0a,0x0b,0x0a,0x04,0x04,0x04,0x02,
|
||||
0x01,0x12,0x03,0x1b,0x02,0x10,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x04,0x02,0x01,0x05,0x12,0x03,0x1b,0x02,0x08,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x04,0x02,0x01,0x01,0x12,
|
||||
0x03,0x1b,0x09,0x0b,0x0a,0x0c,0x0a,0x05,0x04,0x04,
|
||||
0x02,0x01,0x03,0x12,0x03,0x1b,0x0e,0x0f,0x0a,0x0b,
|
||||
0x0a,0x04,0x04,0x04,0x02,0x02,0x12,0x03,0x1c,0x02,
|
||||
0x14,0x0a,0x0c,0x0a,0x05,0x04,0x04,0x02,0x02,0x05,
|
||||
0x12,0x03,0x1c,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x04,0x02,0x02,0x01,0x12,0x03,0x1c,0x09,0x0f,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x04,0x02,0x02,0x03,0x12,0x03,
|
||||
0x1c,0x12,0x13,0x0a,0x0a,0x0a,0x02,0x04,0x05,0x12,
|
||||
0x04,0x1f,0x00,0x23,0x01,0x0a,0x0a,0x0a,0x03,0x04,
|
||||
0x05,0x01,0x12,0x03,0x1f,0x08,0x1b,0x0a,0x0b,0x0a,
|
||||
0x04,0x04,0x05,0x02,0x00,0x12,0x03,0x20,0x02,0x1c,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x05,0x02,0x00,0x06,0x12,
|
||||
0x03,0x20,0x02,0x10,0x0a,0x0c,0x0a,0x05,0x04,0x05,
|
||||
0x02,0x00,0x01,0x12,0x03,0x20,0x11,0x17,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x05,0x02,0x00,0x03,0x12,0x03,0x20,
|
||||
0x1a,0x1b,0x0a,0x0b,0x0a,0x04,0x04,0x05,0x02,0x01,
|
||||
0x12,0x03,0x21,0x02,0x14,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x05,0x02,0x01,0x05,0x12,0x03,0x21,0x02,0x08,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x05,0x02,0x01,0x01,0x12,0x03,
|
||||
0x21,0x09,0x0f,0x0a,0x0c,0x0a,0x05,0x04,0x05,0x02,
|
||||
0x01,0x03,0x12,0x03,0x21,0x12,0x13,0x0a,0x0b,0x0a,
|
||||
0x04,0x04,0x05,0x02,0x02,0x12,0x03,0x22,0x02,0x14,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x05,0x02,0x02,0x05,0x12,
|
||||
0x03,0x22,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x05,
|
||||
0x02,0x02,0x01,0x12,0x03,0x22,0x09,0x0f,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x05,0x02,0x02,0x03,0x12,0x03,0x22,
|
||||
0x12,0x13,0x0a,0x0a,0x0a,0x02,0x04,0x06,0x12,0x04,
|
||||
0x25,0x00,0x29,0x01,0x0a,0x0a,0x0a,0x03,0x04,0x06,
|
||||
0x01,0x12,0x03,0x25,0x08,0x19,0x0a,0x0b,0x0a,0x04,
|
||||
0x04,0x06,0x02,0x00,0x12,0x03,0x26,0x02,0x1c,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x06,0x02,0x00,0x06,0x12,0x03,
|
||||
0x26,0x02,0x10,0x0a,0x0c,0x0a,0x05,0x04,0x06,0x02,
|
||||
0x00,0x01,0x12,0x03,0x26,0x11,0x17,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x06,0x02,0x00,0x03,0x12,0x03,0x26,0x1a,
|
||||
0x1b,0x0a,0x0b,0x0a,0x04,0x04,0x06,0x02,0x01,0x12,
|
||||
0x03,0x27,0x02,0x17,0x0a,0x0c,0x0a,0x05,0x04,0x06,
|
||||
0x02,0x01,0x05,0x12,0x03,0x27,0x02,0x08,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x06,0x02,0x01,0x01,0x12,0x03,0x27,
|
||||
0x09,0x12,0x0a,0x0c,0x0a,0x05,0x04,0x06,0x02,0x01,
|
||||
0x03,0x12,0x03,0x27,0x15,0x16,0x0a,0x0b,0x0a,0x04,
|
||||
0x04,0x06,0x02,0x02,0x12,0x03,0x28,0x02,0x17,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x06,0x02,0x02,0x05,0x12,0x03,
|
||||
0x28,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x06,0x02,
|
||||
0x02,0x01,0x12,0x03,0x28,0x09,0x12,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x06,0x02,0x02,0x03,0x12,0x03,0x28,0x15,
|
||||
0x16,0x62,0x06,0x70,0x72,0x6f,0x74,0x6f,0x33,
|
||||
};
|
||||
static const char file_name[] = "geometry2d.proto";
|
||||
static const char wpi_proto_ProtobufTranslation2d_name[] = "wpi.proto.ProtobufTranslation2d";
|
||||
std::string_view wpi_proto_ProtobufTranslation2d::msg_name(void) noexcept { return wpi_proto_ProtobufTranslation2d_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufTranslation2d::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufTranslation2d, wpi_proto_ProtobufTranslation2d, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufRotation2d_name[] = "wpi.proto.ProtobufRotation2d";
|
||||
std::string_view wpi_proto_ProtobufRotation2d::msg_name(void) noexcept { return wpi_proto_ProtobufRotation2d_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufRotation2d::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufRotation2d, wpi_proto_ProtobufRotation2d, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufPose2d_name[] = "wpi.proto.ProtobufPose2d";
|
||||
std::string_view wpi_proto_ProtobufPose2d::msg_name(void) noexcept { return wpi_proto_ProtobufPose2d_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufPose2d::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufPose2d, wpi_proto_ProtobufPose2d, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufTransform2d_name[] = "wpi.proto.ProtobufTransform2d";
|
||||
std::string_view wpi_proto_ProtobufTransform2d::msg_name(void) noexcept { return wpi_proto_ProtobufTransform2d_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufTransform2d::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufTransform2d, wpi_proto_ProtobufTransform2d, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufTwist2d_name[] = "wpi.proto.ProtobufTwist2d";
|
||||
std::string_view wpi_proto_ProtobufTwist2d::msg_name(void) noexcept { return wpi_proto_ProtobufTwist2d_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufTwist2d::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufTwist2d, wpi_proto_ProtobufTwist2d, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufRectangle2d_name[] = "wpi.proto.ProtobufRectangle2d";
|
||||
std::string_view wpi_proto_ProtobufRectangle2d::msg_name(void) noexcept { return wpi_proto_ProtobufRectangle2d_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufRectangle2d::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufRectangle2d, wpi_proto_ProtobufRectangle2d, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufEllipse2d_name[] = "wpi.proto.ProtobufEllipse2d";
|
||||
std::string_view wpi_proto_ProtobufEllipse2d::msg_name(void) noexcept { return wpi_proto_ProtobufEllipse2d_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufEllipse2d::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufEllipse2d, wpi_proto_ProtobufEllipse2d, AUTO)
|
||||
|
||||
|
||||
|
||||
#ifndef PB_CONVERT_DOUBLE_FLOAT
|
||||
/* On some platforms (such as AVR), double is really float.
|
||||
* To be able to encode/decode double on these platforms, you need.
|
||||
* to define PB_CONVERT_DOUBLE_FLOAT in pb.h or compiler command line.
|
||||
*/
|
||||
PB_STATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES)
|
||||
#endif
|
||||
|
||||
180
wpimath/src/generated/main/native/cpp/wpimath/protobuf/geometry2d.npb.h
generated
Normal file
180
wpimath/src/generated/main/native/cpp/wpimath/protobuf/geometry2d.npb.h
generated
Normal file
@@ -0,0 +1,180 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.9 */
|
||||
|
||||
#ifndef PB_WPI_PROTO_GEOMETRY2D_NPB_H_INCLUDED
|
||||
#define PB_WPI_PROTO_GEOMETRY2D_NPB_H_INCLUDED
|
||||
#include <pb.h>
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
/* Struct definitions */
|
||||
typedef struct _wpi_proto_ProtobufTranslation2d {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double x;
|
||||
double y;
|
||||
} wpi_proto_ProtobufTranslation2d;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufRotation2d {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double value;
|
||||
} wpi_proto_ProtobufRotation2d;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufPose2d {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
pb_callback_t translation;
|
||||
pb_callback_t rotation;
|
||||
} wpi_proto_ProtobufPose2d;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufTransform2d {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
pb_callback_t translation;
|
||||
pb_callback_t rotation;
|
||||
} wpi_proto_ProtobufTransform2d;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufTwist2d {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double dx;
|
||||
double dy;
|
||||
double dtheta;
|
||||
} wpi_proto_ProtobufTwist2d;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufRectangle2d {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
pb_callback_t center;
|
||||
double xWidth;
|
||||
double yWidth;
|
||||
} wpi_proto_ProtobufRectangle2d;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufEllipse2d {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
pb_callback_t center;
|
||||
double xSemiAxis;
|
||||
double ySemiAxis;
|
||||
} wpi_proto_ProtobufEllipse2d;
|
||||
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define wpi_proto_ProtobufTranslation2d_init_default {0, 0}
|
||||
#define wpi_proto_ProtobufRotation2d_init_default {0}
|
||||
#define wpi_proto_ProtobufPose2d_init_default {{{NULL}, NULL}, {{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufTransform2d_init_default {{{NULL}, NULL}, {{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufTwist2d_init_default {0, 0, 0}
|
||||
#define wpi_proto_ProtobufRectangle2d_init_default {{{NULL}, NULL}, 0, 0}
|
||||
#define wpi_proto_ProtobufEllipse2d_init_default {{{NULL}, NULL}, 0, 0}
|
||||
#define wpi_proto_ProtobufTranslation2d_init_zero {0, 0}
|
||||
#define wpi_proto_ProtobufRotation2d_init_zero {0}
|
||||
#define wpi_proto_ProtobufPose2d_init_zero {{{NULL}, NULL}, {{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufTransform2d_init_zero {{{NULL}, NULL}, {{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufTwist2d_init_zero {0, 0, 0}
|
||||
#define wpi_proto_ProtobufRectangle2d_init_zero {{{NULL}, NULL}, 0, 0}
|
||||
#define wpi_proto_ProtobufEllipse2d_init_zero {{{NULL}, NULL}, 0, 0}
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define wpi_proto_ProtobufTranslation2d_x_tag 1
|
||||
#define wpi_proto_ProtobufTranslation2d_y_tag 2
|
||||
#define wpi_proto_ProtobufRotation2d_value_tag 1
|
||||
#define wpi_proto_ProtobufPose2d_translation_tag 1
|
||||
#define wpi_proto_ProtobufPose2d_rotation_tag 2
|
||||
#define wpi_proto_ProtobufTransform2d_translation_tag 1
|
||||
#define wpi_proto_ProtobufTransform2d_rotation_tag 2
|
||||
#define wpi_proto_ProtobufTwist2d_dx_tag 1
|
||||
#define wpi_proto_ProtobufTwist2d_dy_tag 2
|
||||
#define wpi_proto_ProtobufTwist2d_dtheta_tag 3
|
||||
#define wpi_proto_ProtobufRectangle2d_center_tag 1
|
||||
#define wpi_proto_ProtobufRectangle2d_xWidth_tag 2
|
||||
#define wpi_proto_ProtobufRectangle2d_yWidth_tag 3
|
||||
#define wpi_proto_ProtobufEllipse2d_center_tag 1
|
||||
#define wpi_proto_ProtobufEllipse2d_xSemiAxis_tag 2
|
||||
#define wpi_proto_ProtobufEllipse2d_ySemiAxis_tag 3
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define wpi_proto_ProtobufTranslation2d_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, x, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, y, 2)
|
||||
#define wpi_proto_ProtobufTranslation2d_CALLBACK NULL
|
||||
#define wpi_proto_ProtobufTranslation2d_DEFAULT NULL
|
||||
|
||||
#define wpi_proto_ProtobufRotation2d_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, value, 1)
|
||||
#define wpi_proto_ProtobufRotation2d_CALLBACK NULL
|
||||
#define wpi_proto_ProtobufRotation2d_DEFAULT NULL
|
||||
|
||||
#define wpi_proto_ProtobufPose2d_FIELDLIST(X, a) \
|
||||
X(a, CALLBACK, OPTIONAL, MESSAGE, translation, 1) \
|
||||
X(a, CALLBACK, OPTIONAL, MESSAGE, rotation, 2)
|
||||
#define wpi_proto_ProtobufPose2d_CALLBACK pb_default_field_callback
|
||||
#define wpi_proto_ProtobufPose2d_DEFAULT NULL
|
||||
#define wpi_proto_ProtobufPose2d_translation_MSGTYPE wpi_proto_ProtobufTranslation2d
|
||||
#define wpi_proto_ProtobufPose2d_rotation_MSGTYPE wpi_proto_ProtobufRotation2d
|
||||
|
||||
#define wpi_proto_ProtobufTransform2d_FIELDLIST(X, a) \
|
||||
X(a, CALLBACK, OPTIONAL, MESSAGE, translation, 1) \
|
||||
X(a, CALLBACK, OPTIONAL, MESSAGE, rotation, 2)
|
||||
#define wpi_proto_ProtobufTransform2d_CALLBACK pb_default_field_callback
|
||||
#define wpi_proto_ProtobufTransform2d_DEFAULT NULL
|
||||
#define wpi_proto_ProtobufTransform2d_translation_MSGTYPE wpi_proto_ProtobufTranslation2d
|
||||
#define wpi_proto_ProtobufTransform2d_rotation_MSGTYPE wpi_proto_ProtobufRotation2d
|
||||
|
||||
#define wpi_proto_ProtobufTwist2d_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, dx, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, dy, 2) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, dtheta, 3)
|
||||
#define wpi_proto_ProtobufTwist2d_CALLBACK NULL
|
||||
#define wpi_proto_ProtobufTwist2d_DEFAULT NULL
|
||||
|
||||
#define wpi_proto_ProtobufRectangle2d_FIELDLIST(X, a) \
|
||||
X(a, CALLBACK, OPTIONAL, MESSAGE, center, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, xWidth, 2) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, yWidth, 3)
|
||||
#define wpi_proto_ProtobufRectangle2d_CALLBACK pb_default_field_callback
|
||||
#define wpi_proto_ProtobufRectangle2d_DEFAULT NULL
|
||||
#define wpi_proto_ProtobufRectangle2d_center_MSGTYPE wpi_proto_ProtobufPose2d
|
||||
|
||||
#define wpi_proto_ProtobufEllipse2d_FIELDLIST(X, a) \
|
||||
X(a, CALLBACK, OPTIONAL, MESSAGE, center, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, xSemiAxis, 2) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, ySemiAxis, 3)
|
||||
#define wpi_proto_ProtobufEllipse2d_CALLBACK pb_default_field_callback
|
||||
#define wpi_proto_ProtobufEllipse2d_DEFAULT NULL
|
||||
#define wpi_proto_ProtobufEllipse2d_center_MSGTYPE wpi_proto_ProtobufPose2d
|
||||
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
/* wpi_proto_ProtobufPose2d_size depends on runtime parameters */
|
||||
/* wpi_proto_ProtobufTransform2d_size depends on runtime parameters */
|
||||
/* wpi_proto_ProtobufRectangle2d_size depends on runtime parameters */
|
||||
/* wpi_proto_ProtobufEllipse2d_size depends on runtime parameters */
|
||||
#define WPI_PROTO_GEOMETRY2D_NPB_H_MAX_SIZE wpi_proto_ProtobufTwist2d_size
|
||||
#define wpi_proto_ProtobufRotation2d_size 9
|
||||
#define wpi_proto_ProtobufTranslation2d_size 18
|
||||
#define wpi_proto_ProtobufTwist2d_size 27
|
||||
|
||||
|
||||
#endif
|
||||
249
wpimath/src/generated/main/native/cpp/wpimath/protobuf/geometry3d.npb.cpp
generated
Normal file
249
wpimath/src/generated/main/native/cpp/wpimath/protobuf/geometry3d.npb.cpp
generated
Normal file
@@ -0,0 +1,249 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.9 */
|
||||
|
||||
#include "geometry3d.npb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
static const uint8_t file_descriptor[] {
|
||||
0x0a,0x10,0x67,0x65,0x6f,0x6d,0x65,0x74,0x72,0x79,
|
||||
0x33,0x64,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x12,0x09,
|
||||
0x77,0x70,0x69,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x22,
|
||||
0x41,0x0a,0x15,0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,
|
||||
0x66,0x54,0x72,0x61,0x6e,0x73,0x6c,0x61,0x74,0x69,
|
||||
0x6f,0x6e,0x33,0x64,0x12,0x0c,0x0a,0x01,0x78,0x18,
|
||||
0x01,0x20,0x01,0x28,0x01,0x52,0x01,0x78,0x12,0x0c,
|
||||
0x0a,0x01,0x79,0x18,0x02,0x20,0x01,0x28,0x01,0x52,
|
||||
0x01,0x79,0x12,0x0c,0x0a,0x01,0x7a,0x18,0x03,0x20,
|
||||
0x01,0x28,0x01,0x52,0x01,0x7a,0x22,0x4c,0x0a,0x12,
|
||||
0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x51,0x75,
|
||||
0x61,0x74,0x65,0x72,0x6e,0x69,0x6f,0x6e,0x12,0x0c,
|
||||
0x0a,0x01,0x77,0x18,0x01,0x20,0x01,0x28,0x01,0x52,
|
||||
0x01,0x77,0x12,0x0c,0x0a,0x01,0x78,0x18,0x02,0x20,
|
||||
0x01,0x28,0x01,0x52,0x01,0x78,0x12,0x0c,0x0a,0x01,
|
||||
0x79,0x18,0x03,0x20,0x01,0x28,0x01,0x52,0x01,0x79,
|
||||
0x12,0x0c,0x0a,0x01,0x7a,0x18,0x04,0x20,0x01,0x28,
|
||||
0x01,0x52,0x01,0x7a,0x22,0x41,0x0a,0x12,0x50,0x72,
|
||||
0x6f,0x74,0x6f,0x62,0x75,0x66,0x52,0x6f,0x74,0x61,
|
||||
0x74,0x69,0x6f,0x6e,0x33,0x64,0x12,0x2b,0x0a,0x01,
|
||||
0x71,0x18,0x01,0x20,0x01,0x28,0x0b,0x32,0x1d,0x2e,
|
||||
0x77,0x70,0x69,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x2e,
|
||||
0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x51,0x75,
|
||||
0x61,0x74,0x65,0x72,0x6e,0x69,0x6f,0x6e,0x52,0x01,
|
||||
0x71,0x22,0x8f,0x01,0x0a,0x0e,0x50,0x72,0x6f,0x74,
|
||||
0x6f,0x62,0x75,0x66,0x50,0x6f,0x73,0x65,0x33,0x64,
|
||||
0x12,0x42,0x0a,0x0b,0x74,0x72,0x61,0x6e,0x73,0x6c,
|
||||
0x61,0x74,0x69,0x6f,0x6e,0x18,0x01,0x20,0x01,0x28,
|
||||
0x0b,0x32,0x20,0x2e,0x77,0x70,0x69,0x2e,0x70,0x72,
|
||||
0x6f,0x74,0x6f,0x2e,0x50,0x72,0x6f,0x74,0x6f,0x62,
|
||||
0x75,0x66,0x54,0x72,0x61,0x6e,0x73,0x6c,0x61,0x74,
|
||||
0x69,0x6f,0x6e,0x33,0x64,0x52,0x0b,0x74,0x72,0x61,
|
||||
0x6e,0x73,0x6c,0x61,0x74,0x69,0x6f,0x6e,0x12,0x39,
|
||||
0x0a,0x08,0x72,0x6f,0x74,0x61,0x74,0x69,0x6f,0x6e,
|
||||
0x18,0x02,0x20,0x01,0x28,0x0b,0x32,0x1d,0x2e,0x77,
|
||||
0x70,0x69,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x2e,0x50,
|
||||
0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x52,0x6f,0x74,
|
||||
0x61,0x74,0x69,0x6f,0x6e,0x33,0x64,0x52,0x08,0x72,
|
||||
0x6f,0x74,0x61,0x74,0x69,0x6f,0x6e,0x22,0x94,0x01,
|
||||
0x0a,0x13,0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,
|
||||
0x54,0x72,0x61,0x6e,0x73,0x66,0x6f,0x72,0x6d,0x33,
|
||||
0x64,0x12,0x42,0x0a,0x0b,0x74,0x72,0x61,0x6e,0x73,
|
||||
0x6c,0x61,0x74,0x69,0x6f,0x6e,0x18,0x01,0x20,0x01,
|
||||
0x28,0x0b,0x32,0x20,0x2e,0x77,0x70,0x69,0x2e,0x70,
|
||||
0x72,0x6f,0x74,0x6f,0x2e,0x50,0x72,0x6f,0x74,0x6f,
|
||||
0x62,0x75,0x66,0x54,0x72,0x61,0x6e,0x73,0x6c,0x61,
|
||||
0x74,0x69,0x6f,0x6e,0x33,0x64,0x52,0x0b,0x74,0x72,
|
||||
0x61,0x6e,0x73,0x6c,0x61,0x74,0x69,0x6f,0x6e,0x12,
|
||||
0x39,0x0a,0x08,0x72,0x6f,0x74,0x61,0x74,0x69,0x6f,
|
||||
0x6e,0x18,0x02,0x20,0x01,0x28,0x0b,0x32,0x1d,0x2e,
|
||||
0x77,0x70,0x69,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x2e,
|
||||
0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x52,0x6f,
|
||||
0x74,0x61,0x74,0x69,0x6f,0x6e,0x33,0x64,0x52,0x08,
|
||||
0x72,0x6f,0x74,0x61,0x74,0x69,0x6f,0x6e,0x22,0x71,
|
||||
0x0a,0x0f,0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,
|
||||
0x54,0x77,0x69,0x73,0x74,0x33,0x64,0x12,0x0e,0x0a,
|
||||
0x02,0x64,0x78,0x18,0x01,0x20,0x01,0x28,0x01,0x52,
|
||||
0x02,0x64,0x78,0x12,0x0e,0x0a,0x02,0x64,0x79,0x18,
|
||||
0x02,0x20,0x01,0x28,0x01,0x52,0x02,0x64,0x79,0x12,
|
||||
0x0e,0x0a,0x02,0x64,0x7a,0x18,0x03,0x20,0x01,0x28,
|
||||
0x01,0x52,0x02,0x64,0x7a,0x12,0x0e,0x0a,0x02,0x72,
|
||||
0x78,0x18,0x04,0x20,0x01,0x28,0x01,0x52,0x02,0x72,
|
||||
0x78,0x12,0x0e,0x0a,0x02,0x72,0x79,0x18,0x05,0x20,
|
||||
0x01,0x28,0x01,0x52,0x02,0x72,0x79,0x12,0x0e,0x0a,
|
||||
0x02,0x72,0x7a,0x18,0x06,0x20,0x01,0x28,0x01,0x52,
|
||||
0x02,0x72,0x7a,0x42,0x1a,0x0a,0x18,0x65,0x64,0x75,
|
||||
0x2e,0x77,0x70,0x69,0x2e,0x66,0x69,0x72,0x73,0x74,
|
||||
0x2e,0x6d,0x61,0x74,0x68,0x2e,0x70,0x72,0x6f,0x74,
|
||||
0x6f,0x4a,0x9f,0x09,0x0a,0x06,0x12,0x04,0x00,0x00,
|
||||
0x28,0x01,0x0a,0x08,0x0a,0x01,0x0c,0x12,0x03,0x00,
|
||||
0x00,0x12,0x0a,0x08,0x0a,0x01,0x02,0x12,0x03,0x02,
|
||||
0x00,0x12,0x0a,0x08,0x0a,0x01,0x08,0x12,0x03,0x04,
|
||||
0x00,0x31,0x0a,0x09,0x0a,0x02,0x08,0x01,0x12,0x03,
|
||||
0x04,0x00,0x31,0x0a,0x0a,0x0a,0x02,0x04,0x00,0x12,
|
||||
0x04,0x06,0x00,0x0a,0x01,0x0a,0x0a,0x0a,0x03,0x04,
|
||||
0x00,0x01,0x12,0x03,0x06,0x08,0x1d,0x0a,0x0b,0x0a,
|
||||
0x04,0x04,0x00,0x02,0x00,0x12,0x03,0x07,0x02,0x0f,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x00,0x05,0x12,
|
||||
0x03,0x07,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x00,
|
||||
0x02,0x00,0x01,0x12,0x03,0x07,0x09,0x0a,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x00,0x02,0x00,0x03,0x12,0x03,0x07,
|
||||
0x0d,0x0e,0x0a,0x0b,0x0a,0x04,0x04,0x00,0x02,0x01,
|
||||
0x12,0x03,0x08,0x02,0x0f,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x00,0x02,0x01,0x05,0x12,0x03,0x08,0x02,0x08,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x00,0x02,0x01,0x01,0x12,0x03,
|
||||
0x08,0x09,0x0a,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,
|
||||
0x01,0x03,0x12,0x03,0x08,0x0d,0x0e,0x0a,0x0b,0x0a,
|
||||
0x04,0x04,0x00,0x02,0x02,0x12,0x03,0x09,0x02,0x0f,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x02,0x05,0x12,
|
||||
0x03,0x09,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x00,
|
||||
0x02,0x02,0x01,0x12,0x03,0x09,0x09,0x0a,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x00,0x02,0x02,0x03,0x12,0x03,0x09,
|
||||
0x0d,0x0e,0x0a,0x0a,0x0a,0x02,0x04,0x01,0x12,0x04,
|
||||
0x0c,0x00,0x11,0x01,0x0a,0x0a,0x0a,0x03,0x04,0x01,
|
||||
0x01,0x12,0x03,0x0c,0x08,0x1a,0x0a,0x0b,0x0a,0x04,
|
||||
0x04,0x01,0x02,0x00,0x12,0x03,0x0d,0x02,0x0f,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x01,0x02,0x00,0x05,0x12,0x03,
|
||||
0x0d,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,
|
||||
0x00,0x01,0x12,0x03,0x0d,0x09,0x0a,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x01,0x02,0x00,0x03,0x12,0x03,0x0d,0x0d,
|
||||
0x0e,0x0a,0x0b,0x0a,0x04,0x04,0x01,0x02,0x01,0x12,
|
||||
0x03,0x0e,0x02,0x0f,0x0a,0x0c,0x0a,0x05,0x04,0x01,
|
||||
0x02,0x01,0x05,0x12,0x03,0x0e,0x02,0x08,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x01,0x02,0x01,0x01,0x12,0x03,0x0e,
|
||||
0x09,0x0a,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x01,
|
||||
0x03,0x12,0x03,0x0e,0x0d,0x0e,0x0a,0x0b,0x0a,0x04,
|
||||
0x04,0x01,0x02,0x02,0x12,0x03,0x0f,0x02,0x0f,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x01,0x02,0x02,0x05,0x12,0x03,
|
||||
0x0f,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,
|
||||
0x02,0x01,0x12,0x03,0x0f,0x09,0x0a,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x01,0x02,0x02,0x03,0x12,0x03,0x0f,0x0d,
|
||||
0x0e,0x0a,0x0b,0x0a,0x04,0x04,0x01,0x02,0x03,0x12,
|
||||
0x03,0x10,0x02,0x0f,0x0a,0x0c,0x0a,0x05,0x04,0x01,
|
||||
0x02,0x03,0x05,0x12,0x03,0x10,0x02,0x08,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x01,0x02,0x03,0x01,0x12,0x03,0x10,
|
||||
0x09,0x0a,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x03,
|
||||
0x03,0x12,0x03,0x10,0x0d,0x0e,0x0a,0x0a,0x0a,0x02,
|
||||
0x04,0x02,0x12,0x04,0x13,0x00,0x15,0x01,0x0a,0x0a,
|
||||
0x0a,0x03,0x04,0x02,0x01,0x12,0x03,0x13,0x08,0x1a,
|
||||
0x0a,0x0b,0x0a,0x04,0x04,0x02,0x02,0x00,0x12,0x03,
|
||||
0x14,0x02,0x1b,0x0a,0x0c,0x0a,0x05,0x04,0x02,0x02,
|
||||
0x00,0x06,0x12,0x03,0x14,0x02,0x14,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x02,0x02,0x00,0x01,0x12,0x03,0x14,0x15,
|
||||
0x16,0x0a,0x0c,0x0a,0x05,0x04,0x02,0x02,0x00,0x03,
|
||||
0x12,0x03,0x14,0x19,0x1a,0x0a,0x0a,0x0a,0x02,0x04,
|
||||
0x03,0x12,0x04,0x17,0x00,0x1a,0x01,0x0a,0x0a,0x0a,
|
||||
0x03,0x04,0x03,0x01,0x12,0x03,0x17,0x08,0x16,0x0a,
|
||||
0x0b,0x0a,0x04,0x04,0x03,0x02,0x00,0x12,0x03,0x18,
|
||||
0x02,0x28,0x0a,0x0c,0x0a,0x05,0x04,0x03,0x02,0x00,
|
||||
0x06,0x12,0x03,0x18,0x02,0x17,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x03,0x02,0x00,0x01,0x12,0x03,0x18,0x18,0x23,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x03,0x02,0x00,0x03,0x12,
|
||||
0x03,0x18,0x26,0x27,0x0a,0x0b,0x0a,0x04,0x04,0x03,
|
||||
0x02,0x01,0x12,0x03,0x19,0x02,0x22,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x03,0x02,0x01,0x06,0x12,0x03,0x19,0x02,
|
||||
0x14,0x0a,0x0c,0x0a,0x05,0x04,0x03,0x02,0x01,0x01,
|
||||
0x12,0x03,0x19,0x15,0x1d,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x03,0x02,0x01,0x03,0x12,0x03,0x19,0x20,0x21,0x0a,
|
||||
0x0a,0x0a,0x02,0x04,0x04,0x12,0x04,0x1c,0x00,0x1f,
|
||||
0x01,0x0a,0x0a,0x0a,0x03,0x04,0x04,0x01,0x12,0x03,
|
||||
0x1c,0x08,0x1b,0x0a,0x0b,0x0a,0x04,0x04,0x04,0x02,
|
||||
0x00,0x12,0x03,0x1d,0x02,0x28,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x04,0x02,0x00,0x06,0x12,0x03,0x1d,0x02,0x17,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x04,0x02,0x00,0x01,0x12,
|
||||
0x03,0x1d,0x18,0x23,0x0a,0x0c,0x0a,0x05,0x04,0x04,
|
||||
0x02,0x00,0x03,0x12,0x03,0x1d,0x26,0x27,0x0a,0x0b,
|
||||
0x0a,0x04,0x04,0x04,0x02,0x01,0x12,0x03,0x1e,0x02,
|
||||
0x22,0x0a,0x0c,0x0a,0x05,0x04,0x04,0x02,0x01,0x06,
|
||||
0x12,0x03,0x1e,0x02,0x14,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x04,0x02,0x01,0x01,0x12,0x03,0x1e,0x15,0x1d,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x04,0x02,0x01,0x03,0x12,0x03,
|
||||
0x1e,0x20,0x21,0x0a,0x0a,0x0a,0x02,0x04,0x05,0x12,
|
||||
0x04,0x21,0x00,0x28,0x01,0x0a,0x0a,0x0a,0x03,0x04,
|
||||
0x05,0x01,0x12,0x03,0x21,0x08,0x17,0x0a,0x0b,0x0a,
|
||||
0x04,0x04,0x05,0x02,0x00,0x12,0x03,0x22,0x02,0x10,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x05,0x02,0x00,0x05,0x12,
|
||||
0x03,0x22,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x05,
|
||||
0x02,0x00,0x01,0x12,0x03,0x22,0x09,0x0b,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x05,0x02,0x00,0x03,0x12,0x03,0x22,
|
||||
0x0e,0x0f,0x0a,0x0b,0x0a,0x04,0x04,0x05,0x02,0x01,
|
||||
0x12,0x03,0x23,0x02,0x10,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x05,0x02,0x01,0x05,0x12,0x03,0x23,0x02,0x08,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x05,0x02,0x01,0x01,0x12,0x03,
|
||||
0x23,0x09,0x0b,0x0a,0x0c,0x0a,0x05,0x04,0x05,0x02,
|
||||
0x01,0x03,0x12,0x03,0x23,0x0e,0x0f,0x0a,0x0b,0x0a,
|
||||
0x04,0x04,0x05,0x02,0x02,0x12,0x03,0x24,0x02,0x10,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x05,0x02,0x02,0x05,0x12,
|
||||
0x03,0x24,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x05,
|
||||
0x02,0x02,0x01,0x12,0x03,0x24,0x09,0x0b,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x05,0x02,0x02,0x03,0x12,0x03,0x24,
|
||||
0x0e,0x0f,0x0a,0x0b,0x0a,0x04,0x04,0x05,0x02,0x03,
|
||||
0x12,0x03,0x25,0x02,0x10,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x05,0x02,0x03,0x05,0x12,0x03,0x25,0x02,0x08,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x05,0x02,0x03,0x01,0x12,0x03,
|
||||
0x25,0x09,0x0b,0x0a,0x0c,0x0a,0x05,0x04,0x05,0x02,
|
||||
0x03,0x03,0x12,0x03,0x25,0x0e,0x0f,0x0a,0x0b,0x0a,
|
||||
0x04,0x04,0x05,0x02,0x04,0x12,0x03,0x26,0x02,0x10,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x05,0x02,0x04,0x05,0x12,
|
||||
0x03,0x26,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x05,
|
||||
0x02,0x04,0x01,0x12,0x03,0x26,0x09,0x0b,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x05,0x02,0x04,0x03,0x12,0x03,0x26,
|
||||
0x0e,0x0f,0x0a,0x0b,0x0a,0x04,0x04,0x05,0x02,0x05,
|
||||
0x12,0x03,0x27,0x02,0x10,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x05,0x02,0x05,0x05,0x12,0x03,0x27,0x02,0x08,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x05,0x02,0x05,0x01,0x12,0x03,
|
||||
0x27,0x09,0x0b,0x0a,0x0c,0x0a,0x05,0x04,0x05,0x02,
|
||||
0x05,0x03,0x12,0x03,0x27,0x0e,0x0f,0x62,0x06,0x70,
|
||||
0x72,0x6f,0x74,0x6f,0x33,
|
||||
};
|
||||
static const char file_name[] = "geometry3d.proto";
|
||||
static const char wpi_proto_ProtobufTranslation3d_name[] = "wpi.proto.ProtobufTranslation3d";
|
||||
std::string_view wpi_proto_ProtobufTranslation3d::msg_name(void) noexcept { return wpi_proto_ProtobufTranslation3d_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufTranslation3d::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufTranslation3d, wpi_proto_ProtobufTranslation3d, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufQuaternion_name[] = "wpi.proto.ProtobufQuaternion";
|
||||
std::string_view wpi_proto_ProtobufQuaternion::msg_name(void) noexcept { return wpi_proto_ProtobufQuaternion_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufQuaternion::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufQuaternion, wpi_proto_ProtobufQuaternion, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufRotation3d_name[] = "wpi.proto.ProtobufRotation3d";
|
||||
std::string_view wpi_proto_ProtobufRotation3d::msg_name(void) noexcept { return wpi_proto_ProtobufRotation3d_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufRotation3d::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufRotation3d, wpi_proto_ProtobufRotation3d, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufPose3d_name[] = "wpi.proto.ProtobufPose3d";
|
||||
std::string_view wpi_proto_ProtobufPose3d::msg_name(void) noexcept { return wpi_proto_ProtobufPose3d_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufPose3d::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufPose3d, wpi_proto_ProtobufPose3d, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufTransform3d_name[] = "wpi.proto.ProtobufTransform3d";
|
||||
std::string_view wpi_proto_ProtobufTransform3d::msg_name(void) noexcept { return wpi_proto_ProtobufTransform3d_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufTransform3d::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufTransform3d, wpi_proto_ProtobufTransform3d, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufTwist3d_name[] = "wpi.proto.ProtobufTwist3d";
|
||||
std::string_view wpi_proto_ProtobufTwist3d::msg_name(void) noexcept { return wpi_proto_ProtobufTwist3d_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufTwist3d::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufTwist3d, wpi_proto_ProtobufTwist3d, AUTO)
|
||||
|
||||
|
||||
|
||||
#ifndef PB_CONVERT_DOUBLE_FLOAT
|
||||
/* On some platforms (such as AVR), double is really float.
|
||||
* To be able to encode/decode double on these platforms, you need.
|
||||
* to define PB_CONVERT_DOUBLE_FLOAT in pb.h or compiler command line.
|
||||
*/
|
||||
PB_STATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES)
|
||||
#endif
|
||||
|
||||
171
wpimath/src/generated/main/native/cpp/wpimath/protobuf/geometry3d.npb.h
generated
Normal file
171
wpimath/src/generated/main/native/cpp/wpimath/protobuf/geometry3d.npb.h
generated
Normal file
@@ -0,0 +1,171 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.9 */
|
||||
|
||||
#ifndef PB_WPI_PROTO_GEOMETRY3D_NPB_H_INCLUDED
|
||||
#define PB_WPI_PROTO_GEOMETRY3D_NPB_H_INCLUDED
|
||||
#include <pb.h>
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
/* Struct definitions */
|
||||
typedef struct _wpi_proto_ProtobufTranslation3d {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double x;
|
||||
double y;
|
||||
double z;
|
||||
} wpi_proto_ProtobufTranslation3d;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufQuaternion {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double w;
|
||||
double x;
|
||||
double y;
|
||||
double z;
|
||||
} wpi_proto_ProtobufQuaternion;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufRotation3d {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
pb_callback_t q;
|
||||
} wpi_proto_ProtobufRotation3d;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufPose3d {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
pb_callback_t translation;
|
||||
pb_callback_t rotation;
|
||||
} wpi_proto_ProtobufPose3d;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufTransform3d {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
pb_callback_t translation;
|
||||
pb_callback_t rotation;
|
||||
} wpi_proto_ProtobufTransform3d;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufTwist3d {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double dx;
|
||||
double dy;
|
||||
double dz;
|
||||
double rx;
|
||||
double ry;
|
||||
double rz;
|
||||
} wpi_proto_ProtobufTwist3d;
|
||||
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define wpi_proto_ProtobufTranslation3d_init_default {0, 0, 0}
|
||||
#define wpi_proto_ProtobufQuaternion_init_default {0, 0, 0, 0}
|
||||
#define wpi_proto_ProtobufRotation3d_init_default {{{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufPose3d_init_default {{{NULL}, NULL}, {{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufTransform3d_init_default {{{NULL}, NULL}, {{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufTwist3d_init_default {0, 0, 0, 0, 0, 0}
|
||||
#define wpi_proto_ProtobufTranslation3d_init_zero {0, 0, 0}
|
||||
#define wpi_proto_ProtobufQuaternion_init_zero {0, 0, 0, 0}
|
||||
#define wpi_proto_ProtobufRotation3d_init_zero {{{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufPose3d_init_zero {{{NULL}, NULL}, {{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufTransform3d_init_zero {{{NULL}, NULL}, {{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufTwist3d_init_zero {0, 0, 0, 0, 0, 0}
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define wpi_proto_ProtobufTranslation3d_x_tag 1
|
||||
#define wpi_proto_ProtobufTranslation3d_y_tag 2
|
||||
#define wpi_proto_ProtobufTranslation3d_z_tag 3
|
||||
#define wpi_proto_ProtobufQuaternion_w_tag 1
|
||||
#define wpi_proto_ProtobufQuaternion_x_tag 2
|
||||
#define wpi_proto_ProtobufQuaternion_y_tag 3
|
||||
#define wpi_proto_ProtobufQuaternion_z_tag 4
|
||||
#define wpi_proto_ProtobufRotation3d_q_tag 1
|
||||
#define wpi_proto_ProtobufPose3d_translation_tag 1
|
||||
#define wpi_proto_ProtobufPose3d_rotation_tag 2
|
||||
#define wpi_proto_ProtobufTransform3d_translation_tag 1
|
||||
#define wpi_proto_ProtobufTransform3d_rotation_tag 2
|
||||
#define wpi_proto_ProtobufTwist3d_dx_tag 1
|
||||
#define wpi_proto_ProtobufTwist3d_dy_tag 2
|
||||
#define wpi_proto_ProtobufTwist3d_dz_tag 3
|
||||
#define wpi_proto_ProtobufTwist3d_rx_tag 4
|
||||
#define wpi_proto_ProtobufTwist3d_ry_tag 5
|
||||
#define wpi_proto_ProtobufTwist3d_rz_tag 6
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define wpi_proto_ProtobufTranslation3d_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, x, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, y, 2) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, z, 3)
|
||||
#define wpi_proto_ProtobufTranslation3d_CALLBACK NULL
|
||||
#define wpi_proto_ProtobufTranslation3d_DEFAULT NULL
|
||||
|
||||
#define wpi_proto_ProtobufQuaternion_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, w, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, x, 2) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, y, 3) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, z, 4)
|
||||
#define wpi_proto_ProtobufQuaternion_CALLBACK NULL
|
||||
#define wpi_proto_ProtobufQuaternion_DEFAULT NULL
|
||||
|
||||
#define wpi_proto_ProtobufRotation3d_FIELDLIST(X, a) \
|
||||
X(a, CALLBACK, OPTIONAL, MESSAGE, q, 1)
|
||||
#define wpi_proto_ProtobufRotation3d_CALLBACK pb_default_field_callback
|
||||
#define wpi_proto_ProtobufRotation3d_DEFAULT NULL
|
||||
#define wpi_proto_ProtobufRotation3d_q_MSGTYPE wpi_proto_ProtobufQuaternion
|
||||
|
||||
#define wpi_proto_ProtobufPose3d_FIELDLIST(X, a) \
|
||||
X(a, CALLBACK, OPTIONAL, MESSAGE, translation, 1) \
|
||||
X(a, CALLBACK, OPTIONAL, MESSAGE, rotation, 2)
|
||||
#define wpi_proto_ProtobufPose3d_CALLBACK pb_default_field_callback
|
||||
#define wpi_proto_ProtobufPose3d_DEFAULT NULL
|
||||
#define wpi_proto_ProtobufPose3d_translation_MSGTYPE wpi_proto_ProtobufTranslation3d
|
||||
#define wpi_proto_ProtobufPose3d_rotation_MSGTYPE wpi_proto_ProtobufRotation3d
|
||||
|
||||
#define wpi_proto_ProtobufTransform3d_FIELDLIST(X, a) \
|
||||
X(a, CALLBACK, OPTIONAL, MESSAGE, translation, 1) \
|
||||
X(a, CALLBACK, OPTIONAL, MESSAGE, rotation, 2)
|
||||
#define wpi_proto_ProtobufTransform3d_CALLBACK pb_default_field_callback
|
||||
#define wpi_proto_ProtobufTransform3d_DEFAULT NULL
|
||||
#define wpi_proto_ProtobufTransform3d_translation_MSGTYPE wpi_proto_ProtobufTranslation3d
|
||||
#define wpi_proto_ProtobufTransform3d_rotation_MSGTYPE wpi_proto_ProtobufRotation3d
|
||||
|
||||
#define wpi_proto_ProtobufTwist3d_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, dx, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, dy, 2) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, dz, 3) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, rx, 4) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, ry, 5) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, rz, 6)
|
||||
#define wpi_proto_ProtobufTwist3d_CALLBACK NULL
|
||||
#define wpi_proto_ProtobufTwist3d_DEFAULT NULL
|
||||
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
/* wpi_proto_ProtobufRotation3d_size depends on runtime parameters */
|
||||
/* wpi_proto_ProtobufPose3d_size depends on runtime parameters */
|
||||
/* wpi_proto_ProtobufTransform3d_size depends on runtime parameters */
|
||||
#define WPI_PROTO_GEOMETRY3D_NPB_H_MAX_SIZE wpi_proto_ProtobufTwist3d_size
|
||||
#define wpi_proto_ProtobufQuaternion_size 36
|
||||
#define wpi_proto_ProtobufTranslation3d_size 27
|
||||
#define wpi_proto_ProtobufTwist3d_size 54
|
||||
|
||||
|
||||
#endif
|
||||
434
wpimath/src/generated/main/native/cpp/wpimath/protobuf/kinematics.npb.cpp
generated
Normal file
434
wpimath/src/generated/main/native/cpp/wpimath/protobuf/kinematics.npb.cpp
generated
Normal file
@@ -0,0 +1,434 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.9 */
|
||||
|
||||
#include "kinematics.npb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
static const uint8_t file_descriptor[] {
|
||||
0x0a,0x10,0x6b,0x69,0x6e,0x65,0x6d,0x61,0x74,0x69,
|
||||
0x63,0x73,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x12,0x09,
|
||||
0x77,0x70,0x69,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x1a,
|
||||
0x10,0x67,0x65,0x6f,0x6d,0x65,0x74,0x72,0x79,0x32,
|
||||
0x64,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x22,0x4d,0x0a,
|
||||
0x15,0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x43,
|
||||
0x68,0x61,0x73,0x73,0x69,0x73,0x53,0x70,0x65,0x65,
|
||||
0x64,0x73,0x12,0x0e,0x0a,0x02,0x76,0x78,0x18,0x01,
|
||||
0x20,0x01,0x28,0x01,0x52,0x02,0x76,0x78,0x12,0x0e,
|
||||
0x0a,0x02,0x76,0x79,0x18,0x02,0x20,0x01,0x28,0x01,
|
||||
0x52,0x02,0x76,0x79,0x12,0x14,0x0a,0x05,0x6f,0x6d,
|
||||
0x65,0x67,0x61,0x18,0x03,0x20,0x01,0x28,0x01,0x52,
|
||||
0x05,0x6f,0x6d,0x65,0x67,0x61,0x22,0x46,0x0a,0x23,
|
||||
0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x44,0x69,
|
||||
0x66,0x66,0x65,0x72,0x65,0x6e,0x74,0x69,0x61,0x6c,
|
||||
0x44,0x72,0x69,0x76,0x65,0x4b,0x69,0x6e,0x65,0x6d,
|
||||
0x61,0x74,0x69,0x63,0x73,0x12,0x1f,0x0a,0x0b,0x74,
|
||||
0x72,0x61,0x63,0x6b,0x5f,0x77,0x69,0x64,0x74,0x68,
|
||||
0x18,0x01,0x20,0x01,0x28,0x01,0x52,0x0a,0x74,0x72,
|
||||
0x61,0x63,0x6b,0x57,0x69,0x64,0x74,0x68,0x22,0x50,
|
||||
0x0a,0x24,0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,
|
||||
0x44,0x69,0x66,0x66,0x65,0x72,0x65,0x6e,0x74,0x69,
|
||||
0x61,0x6c,0x44,0x72,0x69,0x76,0x65,0x57,0x68,0x65,
|
||||
0x65,0x6c,0x53,0x70,0x65,0x65,0x64,0x73,0x12,0x12,
|
||||
0x0a,0x04,0x6c,0x65,0x66,0x74,0x18,0x01,0x20,0x01,
|
||||
0x28,0x01,0x52,0x04,0x6c,0x65,0x66,0x74,0x12,0x14,
|
||||
0x0a,0x05,0x72,0x69,0x67,0x68,0x74,0x18,0x02,0x20,
|
||||
0x01,0x28,0x01,0x52,0x05,0x72,0x69,0x67,0x68,0x74,
|
||||
0x22,0x53,0x0a,0x27,0x50,0x72,0x6f,0x74,0x6f,0x62,
|
||||
0x75,0x66,0x44,0x69,0x66,0x66,0x65,0x72,0x65,0x6e,
|
||||
0x74,0x69,0x61,0x6c,0x44,0x72,0x69,0x76,0x65,0x57,
|
||||
0x68,0x65,0x65,0x6c,0x50,0x6f,0x73,0x69,0x74,0x69,
|
||||
0x6f,0x6e,0x73,0x12,0x12,0x0a,0x04,0x6c,0x65,0x66,
|
||||
0x74,0x18,0x01,0x20,0x01,0x28,0x01,0x52,0x04,0x6c,
|
||||
0x65,0x66,0x74,0x12,0x14,0x0a,0x05,0x72,0x69,0x67,
|
||||
0x68,0x74,0x18,0x02,0x20,0x01,0x28,0x01,0x52,0x05,
|
||||
0x72,0x69,0x67,0x68,0x74,0x22,0xa4,0x02,0x0a,0x1e,
|
||||
0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x4d,0x65,
|
||||
0x63,0x61,0x6e,0x75,0x6d,0x44,0x72,0x69,0x76,0x65,
|
||||
0x4b,0x69,0x6e,0x65,0x6d,0x61,0x74,0x69,0x63,0x73,
|
||||
0x12,0x3f,0x0a,0x0a,0x66,0x72,0x6f,0x6e,0x74,0x5f,
|
||||
0x6c,0x65,0x66,0x74,0x18,0x01,0x20,0x01,0x28,0x0b,
|
||||
0x32,0x20,0x2e,0x77,0x70,0x69,0x2e,0x70,0x72,0x6f,
|
||||
0x74,0x6f,0x2e,0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,
|
||||
0x66,0x54,0x72,0x61,0x6e,0x73,0x6c,0x61,0x74,0x69,
|
||||
0x6f,0x6e,0x32,0x64,0x52,0x09,0x66,0x72,0x6f,0x6e,
|
||||
0x74,0x4c,0x65,0x66,0x74,0x12,0x41,0x0a,0x0b,0x66,
|
||||
0x72,0x6f,0x6e,0x74,0x5f,0x72,0x69,0x67,0x68,0x74,
|
||||
0x18,0x02,0x20,0x01,0x28,0x0b,0x32,0x20,0x2e,0x77,
|
||||
0x70,0x69,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x2e,0x50,
|
||||
0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x54,0x72,0x61,
|
||||
0x6e,0x73,0x6c,0x61,0x74,0x69,0x6f,0x6e,0x32,0x64,
|
||||
0x52,0x0a,0x66,0x72,0x6f,0x6e,0x74,0x52,0x69,0x67,
|
||||
0x68,0x74,0x12,0x3d,0x0a,0x09,0x72,0x65,0x61,0x72,
|
||||
0x5f,0x6c,0x65,0x66,0x74,0x18,0x03,0x20,0x01,0x28,
|
||||
0x0b,0x32,0x20,0x2e,0x77,0x70,0x69,0x2e,0x70,0x72,
|
||||
0x6f,0x74,0x6f,0x2e,0x50,0x72,0x6f,0x74,0x6f,0x62,
|
||||
0x75,0x66,0x54,0x72,0x61,0x6e,0x73,0x6c,0x61,0x74,
|
||||
0x69,0x6f,0x6e,0x32,0x64,0x52,0x08,0x72,0x65,0x61,
|
||||
0x72,0x4c,0x65,0x66,0x74,0x12,0x3f,0x0a,0x0a,0x72,
|
||||
0x65,0x61,0x72,0x5f,0x72,0x69,0x67,0x68,0x74,0x18,
|
||||
0x04,0x20,0x01,0x28,0x0b,0x32,0x20,0x2e,0x77,0x70,
|
||||
0x69,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x2e,0x50,0x72,
|
||||
0x6f,0x74,0x6f,0x62,0x75,0x66,0x54,0x72,0x61,0x6e,
|
||||
0x73,0x6c,0x61,0x74,0x69,0x6f,0x6e,0x32,0x64,0x52,
|
||||
0x09,0x72,0x65,0x61,0x72,0x52,0x69,0x67,0x68,0x74,
|
||||
0x22,0x9f,0x01,0x0a,0x21,0x50,0x72,0x6f,0x74,0x6f,
|
||||
0x62,0x75,0x66,0x4d,0x65,0x63,0x61,0x6e,0x75,0x6d,
|
||||
0x44,0x72,0x69,0x76,0x65,0x4d,0x6f,0x74,0x6f,0x72,
|
||||
0x56,0x6f,0x6c,0x74,0x61,0x67,0x65,0x73,0x12,0x1d,
|
||||
0x0a,0x0a,0x66,0x72,0x6f,0x6e,0x74,0x5f,0x6c,0x65,
|
||||
0x66,0x74,0x18,0x01,0x20,0x01,0x28,0x01,0x52,0x09,
|
||||
0x66,0x72,0x6f,0x6e,0x74,0x4c,0x65,0x66,0x74,0x12,
|
||||
0x1f,0x0a,0x0b,0x66,0x72,0x6f,0x6e,0x74,0x5f,0x72,
|
||||
0x69,0x67,0x68,0x74,0x18,0x02,0x20,0x01,0x28,0x01,
|
||||
0x52,0x0a,0x66,0x72,0x6f,0x6e,0x74,0x52,0x69,0x67,
|
||||
0x68,0x74,0x12,0x1b,0x0a,0x09,0x72,0x65,0x61,0x72,
|
||||
0x5f,0x6c,0x65,0x66,0x74,0x18,0x03,0x20,0x01,0x28,
|
||||
0x01,0x52,0x08,0x72,0x65,0x61,0x72,0x4c,0x65,0x66,
|
||||
0x74,0x12,0x1d,0x0a,0x0a,0x72,0x65,0x61,0x72,0x5f,
|
||||
0x72,0x69,0x67,0x68,0x74,0x18,0x04,0x20,0x01,0x28,
|
||||
0x01,0x52,0x09,0x72,0x65,0x61,0x72,0x52,0x69,0x67,
|
||||
0x68,0x74,0x22,0xa0,0x01,0x0a,0x22,0x50,0x72,0x6f,
|
||||
0x74,0x6f,0x62,0x75,0x66,0x4d,0x65,0x63,0x61,0x6e,
|
||||
0x75,0x6d,0x44,0x72,0x69,0x76,0x65,0x57,0x68,0x65,
|
||||
0x65,0x6c,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
|
||||
0x73,0x12,0x1d,0x0a,0x0a,0x66,0x72,0x6f,0x6e,0x74,
|
||||
0x5f,0x6c,0x65,0x66,0x74,0x18,0x01,0x20,0x01,0x28,
|
||||
0x01,0x52,0x09,0x66,0x72,0x6f,0x6e,0x74,0x4c,0x65,
|
||||
0x66,0x74,0x12,0x1f,0x0a,0x0b,0x66,0x72,0x6f,0x6e,
|
||||
0x74,0x5f,0x72,0x69,0x67,0x68,0x74,0x18,0x02,0x20,
|
||||
0x01,0x28,0x01,0x52,0x0a,0x66,0x72,0x6f,0x6e,0x74,
|
||||
0x52,0x69,0x67,0x68,0x74,0x12,0x1b,0x0a,0x09,0x72,
|
||||
0x65,0x61,0x72,0x5f,0x6c,0x65,0x66,0x74,0x18,0x03,
|
||||
0x20,0x01,0x28,0x01,0x52,0x08,0x72,0x65,0x61,0x72,
|
||||
0x4c,0x65,0x66,0x74,0x12,0x1d,0x0a,0x0a,0x72,0x65,
|
||||
0x61,0x72,0x5f,0x72,0x69,0x67,0x68,0x74,0x18,0x04,
|
||||
0x20,0x01,0x28,0x01,0x52,0x09,0x72,0x65,0x61,0x72,
|
||||
0x52,0x69,0x67,0x68,0x74,0x22,0x9d,0x01,0x0a,0x1f,
|
||||
0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x4d,0x65,
|
||||
0x63,0x61,0x6e,0x75,0x6d,0x44,0x72,0x69,0x76,0x65,
|
||||
0x57,0x68,0x65,0x65,0x6c,0x53,0x70,0x65,0x65,0x64,
|
||||
0x73,0x12,0x1d,0x0a,0x0a,0x66,0x72,0x6f,0x6e,0x74,
|
||||
0x5f,0x6c,0x65,0x66,0x74,0x18,0x01,0x20,0x01,0x28,
|
||||
0x01,0x52,0x09,0x66,0x72,0x6f,0x6e,0x74,0x4c,0x65,
|
||||
0x66,0x74,0x12,0x1f,0x0a,0x0b,0x66,0x72,0x6f,0x6e,
|
||||
0x74,0x5f,0x72,0x69,0x67,0x68,0x74,0x18,0x02,0x20,
|
||||
0x01,0x28,0x01,0x52,0x0a,0x66,0x72,0x6f,0x6e,0x74,
|
||||
0x52,0x69,0x67,0x68,0x74,0x12,0x1b,0x0a,0x09,0x72,
|
||||
0x65,0x61,0x72,0x5f,0x6c,0x65,0x66,0x74,0x18,0x03,
|
||||
0x20,0x01,0x28,0x01,0x52,0x08,0x72,0x65,0x61,0x72,
|
||||
0x4c,0x65,0x66,0x74,0x12,0x1d,0x0a,0x0a,0x72,0x65,
|
||||
0x61,0x72,0x5f,0x72,0x69,0x67,0x68,0x74,0x18,0x04,
|
||||
0x20,0x01,0x28,0x01,0x52,0x09,0x72,0x65,0x61,0x72,
|
||||
0x52,0x69,0x67,0x68,0x74,0x22,0x5b,0x0a,0x1d,0x50,
|
||||
0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x53,0x77,0x65,
|
||||
0x72,0x76,0x65,0x44,0x72,0x69,0x76,0x65,0x4b,0x69,
|
||||
0x6e,0x65,0x6d,0x61,0x74,0x69,0x63,0x73,0x12,0x3a,
|
||||
0x0a,0x07,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x73,0x18,
|
||||
0x01,0x20,0x03,0x28,0x0b,0x32,0x20,0x2e,0x77,0x70,
|
||||
0x69,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x2e,0x50,0x72,
|
||||
0x6f,0x74,0x6f,0x62,0x75,0x66,0x54,0x72,0x61,0x6e,
|
||||
0x73,0x6c,0x61,0x74,0x69,0x6f,0x6e,0x32,0x64,0x52,
|
||||
0x07,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x73,0x22,0x6f,
|
||||
0x0a,0x1c,0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,
|
||||
0x53,0x77,0x65,0x72,0x76,0x65,0x4d,0x6f,0x64,0x75,
|
||||
0x6c,0x65,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
|
||||
0x12,0x1a,0x0a,0x08,0x64,0x69,0x73,0x74,0x61,0x6e,
|
||||
0x63,0x65,0x18,0x01,0x20,0x01,0x28,0x01,0x52,0x08,
|
||||
0x64,0x69,0x73,0x74,0x61,0x6e,0x63,0x65,0x12,0x33,
|
||||
0x0a,0x05,0x61,0x6e,0x67,0x6c,0x65,0x18,0x02,0x20,
|
||||
0x01,0x28,0x0b,0x32,0x1d,0x2e,0x77,0x70,0x69,0x2e,
|
||||
0x70,0x72,0x6f,0x74,0x6f,0x2e,0x50,0x72,0x6f,0x74,
|
||||
0x6f,0x62,0x75,0x66,0x52,0x6f,0x74,0x61,0x74,0x69,
|
||||
0x6f,0x6e,0x32,0x64,0x52,0x05,0x61,0x6e,0x67,0x6c,
|
||||
0x65,0x22,0x66,0x0a,0x19,0x50,0x72,0x6f,0x74,0x6f,
|
||||
0x62,0x75,0x66,0x53,0x77,0x65,0x72,0x76,0x65,0x4d,
|
||||
0x6f,0x64,0x75,0x6c,0x65,0x53,0x74,0x61,0x74,0x65,
|
||||
0x12,0x14,0x0a,0x05,0x73,0x70,0x65,0x65,0x64,0x18,
|
||||
0x01,0x20,0x01,0x28,0x01,0x52,0x05,0x73,0x70,0x65,
|
||||
0x65,0x64,0x12,0x33,0x0a,0x05,0x61,0x6e,0x67,0x6c,
|
||||
0x65,0x18,0x02,0x20,0x01,0x28,0x0b,0x32,0x1d,0x2e,
|
||||
0x77,0x70,0x69,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x2e,
|
||||
0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x52,0x6f,
|
||||
0x74,0x61,0x74,0x69,0x6f,0x6e,0x32,0x64,0x52,0x05,
|
||||
0x61,0x6e,0x67,0x6c,0x65,0x42,0x1a,0x0a,0x18,0x65,
|
||||
0x64,0x75,0x2e,0x77,0x70,0x69,0x2e,0x66,0x69,0x72,
|
||||
0x73,0x74,0x2e,0x6d,0x61,0x74,0x68,0x2e,0x70,0x72,
|
||||
0x6f,0x74,0x6f,0x4a,0x8d,0x0f,0x0a,0x06,0x12,0x04,
|
||||
0x00,0x00,0x44,0x01,0x0a,0x08,0x0a,0x01,0x0c,0x12,
|
||||
0x03,0x00,0x00,0x12,0x0a,0x08,0x0a,0x01,0x02,0x12,
|
||||
0x03,0x02,0x00,0x12,0x0a,0x09,0x0a,0x02,0x03,0x00,
|
||||
0x12,0x03,0x04,0x00,0x1a,0x0a,0x08,0x0a,0x01,0x08,
|
||||
0x12,0x03,0x06,0x00,0x31,0x0a,0x09,0x0a,0x02,0x08,
|
||||
0x01,0x12,0x03,0x06,0x00,0x31,0x0a,0x0a,0x0a,0x02,
|
||||
0x04,0x00,0x12,0x04,0x08,0x00,0x0c,0x01,0x0a,0x0a,
|
||||
0x0a,0x03,0x04,0x00,0x01,0x12,0x03,0x08,0x08,0x1d,
|
||||
0x0a,0x0b,0x0a,0x04,0x04,0x00,0x02,0x00,0x12,0x03,
|
||||
0x09,0x02,0x10,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,
|
||||
0x00,0x05,0x12,0x03,0x09,0x02,0x08,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x00,0x02,0x00,0x01,0x12,0x03,0x09,0x09,
|
||||
0x0b,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x00,0x03,
|
||||
0x12,0x03,0x09,0x0e,0x0f,0x0a,0x0b,0x0a,0x04,0x04,
|
||||
0x00,0x02,0x01,0x12,0x03,0x0a,0x02,0x10,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x00,0x02,0x01,0x05,0x12,0x03,0x0a,
|
||||
0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x01,
|
||||
0x01,0x12,0x03,0x0a,0x09,0x0b,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x00,0x02,0x01,0x03,0x12,0x03,0x0a,0x0e,0x0f,
|
||||
0x0a,0x0b,0x0a,0x04,0x04,0x00,0x02,0x02,0x12,0x03,
|
||||
0x0b,0x02,0x13,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,
|
||||
0x02,0x05,0x12,0x03,0x0b,0x02,0x08,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x00,0x02,0x02,0x01,0x12,0x03,0x0b,0x09,
|
||||
0x0e,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x02,0x03,
|
||||
0x12,0x03,0x0b,0x11,0x12,0x0a,0x0a,0x0a,0x02,0x04,
|
||||
0x01,0x12,0x04,0x0e,0x00,0x10,0x01,0x0a,0x0a,0x0a,
|
||||
0x03,0x04,0x01,0x01,0x12,0x03,0x0e,0x08,0x2b,0x0a,
|
||||
0x0b,0x0a,0x04,0x04,0x01,0x02,0x00,0x12,0x03,0x0f,
|
||||
0x02,0x19,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x00,
|
||||
0x05,0x12,0x03,0x0f,0x02,0x08,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x01,0x02,0x00,0x01,0x12,0x03,0x0f,0x09,0x14,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x00,0x03,0x12,
|
||||
0x03,0x0f,0x17,0x18,0x0a,0x0a,0x0a,0x02,0x04,0x02,
|
||||
0x12,0x04,0x12,0x00,0x15,0x01,0x0a,0x0a,0x0a,0x03,
|
||||
0x04,0x02,0x01,0x12,0x03,0x12,0x08,0x2c,0x0a,0x0b,
|
||||
0x0a,0x04,0x04,0x02,0x02,0x00,0x12,0x03,0x13,0x02,
|
||||
0x12,0x0a,0x0c,0x0a,0x05,0x04,0x02,0x02,0x00,0x05,
|
||||
0x12,0x03,0x13,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x02,0x02,0x00,0x01,0x12,0x03,0x13,0x09,0x0d,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x02,0x02,0x00,0x03,0x12,0x03,
|
||||
0x13,0x10,0x11,0x0a,0x0b,0x0a,0x04,0x04,0x02,0x02,
|
||||
0x01,0x12,0x03,0x14,0x02,0x13,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x02,0x02,0x01,0x05,0x12,0x03,0x14,0x02,0x08,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x02,0x02,0x01,0x01,0x12,
|
||||
0x03,0x14,0x09,0x0e,0x0a,0x0c,0x0a,0x05,0x04,0x02,
|
||||
0x02,0x01,0x03,0x12,0x03,0x14,0x11,0x12,0x0a,0x0a,
|
||||
0x0a,0x02,0x04,0x03,0x12,0x04,0x17,0x00,0x1a,0x01,
|
||||
0x0a,0x0a,0x0a,0x03,0x04,0x03,0x01,0x12,0x03,0x17,
|
||||
0x08,0x2f,0x0a,0x0b,0x0a,0x04,0x04,0x03,0x02,0x00,
|
||||
0x12,0x03,0x18,0x02,0x12,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x03,0x02,0x00,0x05,0x12,0x03,0x18,0x02,0x08,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x03,0x02,0x00,0x01,0x12,0x03,
|
||||
0x18,0x09,0x0d,0x0a,0x0c,0x0a,0x05,0x04,0x03,0x02,
|
||||
0x00,0x03,0x12,0x03,0x18,0x10,0x11,0x0a,0x0b,0x0a,
|
||||
0x04,0x04,0x03,0x02,0x01,0x12,0x03,0x19,0x02,0x13,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x03,0x02,0x01,0x05,0x12,
|
||||
0x03,0x19,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x03,
|
||||
0x02,0x01,0x01,0x12,0x03,0x19,0x09,0x0e,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x03,0x02,0x01,0x03,0x12,0x03,0x19,
|
||||
0x11,0x12,0x0a,0x0a,0x0a,0x02,0x04,0x04,0x12,0x04,
|
||||
0x1c,0x00,0x21,0x01,0x0a,0x0a,0x0a,0x03,0x04,0x04,
|
||||
0x01,0x12,0x03,0x1c,0x08,0x26,0x0a,0x0b,0x0a,0x04,
|
||||
0x04,0x04,0x02,0x00,0x12,0x03,0x1d,0x02,0x27,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x04,0x02,0x00,0x06,0x12,0x03,
|
||||
0x1d,0x02,0x17,0x0a,0x0c,0x0a,0x05,0x04,0x04,0x02,
|
||||
0x00,0x01,0x12,0x03,0x1d,0x18,0x22,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x04,0x02,0x00,0x03,0x12,0x03,0x1d,0x25,
|
||||
0x26,0x0a,0x0b,0x0a,0x04,0x04,0x04,0x02,0x01,0x12,
|
||||
0x03,0x1e,0x02,0x28,0x0a,0x0c,0x0a,0x05,0x04,0x04,
|
||||
0x02,0x01,0x06,0x12,0x03,0x1e,0x02,0x17,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x04,0x02,0x01,0x01,0x12,0x03,0x1e,
|
||||
0x18,0x23,0x0a,0x0c,0x0a,0x05,0x04,0x04,0x02,0x01,
|
||||
0x03,0x12,0x03,0x1e,0x26,0x27,0x0a,0x0b,0x0a,0x04,
|
||||
0x04,0x04,0x02,0x02,0x12,0x03,0x1f,0x02,0x26,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x04,0x02,0x02,0x06,0x12,0x03,
|
||||
0x1f,0x02,0x17,0x0a,0x0c,0x0a,0x05,0x04,0x04,0x02,
|
||||
0x02,0x01,0x12,0x03,0x1f,0x18,0x21,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x04,0x02,0x02,0x03,0x12,0x03,0x1f,0x24,
|
||||
0x25,0x0a,0x0b,0x0a,0x04,0x04,0x04,0x02,0x03,0x12,
|
||||
0x03,0x20,0x02,0x27,0x0a,0x0c,0x0a,0x05,0x04,0x04,
|
||||
0x02,0x03,0x06,0x12,0x03,0x20,0x02,0x17,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x04,0x02,0x03,0x01,0x12,0x03,0x20,
|
||||
0x18,0x22,0x0a,0x0c,0x0a,0x05,0x04,0x04,0x02,0x03,
|
||||
0x03,0x12,0x03,0x20,0x25,0x26,0x0a,0x0a,0x0a,0x02,
|
||||
0x04,0x05,0x12,0x04,0x23,0x00,0x28,0x01,0x0a,0x0a,
|
||||
0x0a,0x03,0x04,0x05,0x01,0x12,0x03,0x23,0x08,0x29,
|
||||
0x0a,0x0b,0x0a,0x04,0x04,0x05,0x02,0x00,0x12,0x03,
|
||||
0x24,0x02,0x18,0x0a,0x0c,0x0a,0x05,0x04,0x05,0x02,
|
||||
0x00,0x05,0x12,0x03,0x24,0x02,0x08,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x05,0x02,0x00,0x01,0x12,0x03,0x24,0x09,
|
||||
0x13,0x0a,0x0c,0x0a,0x05,0x04,0x05,0x02,0x00,0x03,
|
||||
0x12,0x03,0x24,0x16,0x17,0x0a,0x0b,0x0a,0x04,0x04,
|
||||
0x05,0x02,0x01,0x12,0x03,0x25,0x02,0x19,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x05,0x02,0x01,0x05,0x12,0x03,0x25,
|
||||
0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x05,0x02,0x01,
|
||||
0x01,0x12,0x03,0x25,0x09,0x14,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x05,0x02,0x01,0x03,0x12,0x03,0x25,0x17,0x18,
|
||||
0x0a,0x0b,0x0a,0x04,0x04,0x05,0x02,0x02,0x12,0x03,
|
||||
0x26,0x02,0x17,0x0a,0x0c,0x0a,0x05,0x04,0x05,0x02,
|
||||
0x02,0x05,0x12,0x03,0x26,0x02,0x08,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x05,0x02,0x02,0x01,0x12,0x03,0x26,0x09,
|
||||
0x12,0x0a,0x0c,0x0a,0x05,0x04,0x05,0x02,0x02,0x03,
|
||||
0x12,0x03,0x26,0x15,0x16,0x0a,0x0b,0x0a,0x04,0x04,
|
||||
0x05,0x02,0x03,0x12,0x03,0x27,0x02,0x18,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x05,0x02,0x03,0x05,0x12,0x03,0x27,
|
||||
0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x05,0x02,0x03,
|
||||
0x01,0x12,0x03,0x27,0x09,0x13,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x05,0x02,0x03,0x03,0x12,0x03,0x27,0x16,0x17,
|
||||
0x0a,0x0a,0x0a,0x02,0x04,0x06,0x12,0x04,0x2a,0x00,
|
||||
0x2f,0x01,0x0a,0x0a,0x0a,0x03,0x04,0x06,0x01,0x12,
|
||||
0x03,0x2a,0x08,0x2a,0x0a,0x0b,0x0a,0x04,0x04,0x06,
|
||||
0x02,0x00,0x12,0x03,0x2b,0x02,0x18,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x06,0x02,0x00,0x05,0x12,0x03,0x2b,0x02,
|
||||
0x08,0x0a,0x0c,0x0a,0x05,0x04,0x06,0x02,0x00,0x01,
|
||||
0x12,0x03,0x2b,0x09,0x13,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x06,0x02,0x00,0x03,0x12,0x03,0x2b,0x16,0x17,0x0a,
|
||||
0x0b,0x0a,0x04,0x04,0x06,0x02,0x01,0x12,0x03,0x2c,
|
||||
0x02,0x19,0x0a,0x0c,0x0a,0x05,0x04,0x06,0x02,0x01,
|
||||
0x05,0x12,0x03,0x2c,0x02,0x08,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x06,0x02,0x01,0x01,0x12,0x03,0x2c,0x09,0x14,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x06,0x02,0x01,0x03,0x12,
|
||||
0x03,0x2c,0x17,0x18,0x0a,0x0b,0x0a,0x04,0x04,0x06,
|
||||
0x02,0x02,0x12,0x03,0x2d,0x02,0x17,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x06,0x02,0x02,0x05,0x12,0x03,0x2d,0x02,
|
||||
0x08,0x0a,0x0c,0x0a,0x05,0x04,0x06,0x02,0x02,0x01,
|
||||
0x12,0x03,0x2d,0x09,0x12,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x06,0x02,0x02,0x03,0x12,0x03,0x2d,0x15,0x16,0x0a,
|
||||
0x0b,0x0a,0x04,0x04,0x06,0x02,0x03,0x12,0x03,0x2e,
|
||||
0x02,0x18,0x0a,0x0c,0x0a,0x05,0x04,0x06,0x02,0x03,
|
||||
0x05,0x12,0x03,0x2e,0x02,0x08,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x06,0x02,0x03,0x01,0x12,0x03,0x2e,0x09,0x13,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x06,0x02,0x03,0x03,0x12,
|
||||
0x03,0x2e,0x16,0x17,0x0a,0x0a,0x0a,0x02,0x04,0x07,
|
||||
0x12,0x04,0x31,0x00,0x36,0x01,0x0a,0x0a,0x0a,0x03,
|
||||
0x04,0x07,0x01,0x12,0x03,0x31,0x08,0x27,0x0a,0x0b,
|
||||
0x0a,0x04,0x04,0x07,0x02,0x00,0x12,0x03,0x32,0x02,
|
||||
0x18,0x0a,0x0c,0x0a,0x05,0x04,0x07,0x02,0x00,0x05,
|
||||
0x12,0x03,0x32,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x07,0x02,0x00,0x01,0x12,0x03,0x32,0x09,0x13,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x07,0x02,0x00,0x03,0x12,0x03,
|
||||
0x32,0x16,0x17,0x0a,0x0b,0x0a,0x04,0x04,0x07,0x02,
|
||||
0x01,0x12,0x03,0x33,0x02,0x19,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x07,0x02,0x01,0x05,0x12,0x03,0x33,0x02,0x08,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x07,0x02,0x01,0x01,0x12,
|
||||
0x03,0x33,0x09,0x14,0x0a,0x0c,0x0a,0x05,0x04,0x07,
|
||||
0x02,0x01,0x03,0x12,0x03,0x33,0x17,0x18,0x0a,0x0b,
|
||||
0x0a,0x04,0x04,0x07,0x02,0x02,0x12,0x03,0x34,0x02,
|
||||
0x17,0x0a,0x0c,0x0a,0x05,0x04,0x07,0x02,0x02,0x05,
|
||||
0x12,0x03,0x34,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x07,0x02,0x02,0x01,0x12,0x03,0x34,0x09,0x12,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x07,0x02,0x02,0x03,0x12,0x03,
|
||||
0x34,0x15,0x16,0x0a,0x0b,0x0a,0x04,0x04,0x07,0x02,
|
||||
0x03,0x12,0x03,0x35,0x02,0x18,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x07,0x02,0x03,0x05,0x12,0x03,0x35,0x02,0x08,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x07,0x02,0x03,0x01,0x12,
|
||||
0x03,0x35,0x09,0x13,0x0a,0x0c,0x0a,0x05,0x04,0x07,
|
||||
0x02,0x03,0x03,0x12,0x03,0x35,0x16,0x17,0x0a,0x0a,
|
||||
0x0a,0x02,0x04,0x08,0x12,0x04,0x38,0x00,0x3a,0x01,
|
||||
0x0a,0x0a,0x0a,0x03,0x04,0x08,0x01,0x12,0x03,0x38,
|
||||
0x08,0x25,0x0a,0x0b,0x0a,0x04,0x04,0x08,0x02,0x00,
|
||||
0x12,0x03,0x39,0x02,0x2d,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x08,0x02,0x00,0x04,0x12,0x03,0x39,0x02,0x0a,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x08,0x02,0x00,0x06,0x12,0x03,
|
||||
0x39,0x0b,0x20,0x0a,0x0c,0x0a,0x05,0x04,0x08,0x02,
|
||||
0x00,0x01,0x12,0x03,0x39,0x21,0x28,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x08,0x02,0x00,0x03,0x12,0x03,0x39,0x2b,
|
||||
0x2c,0x0a,0x0a,0x0a,0x02,0x04,0x09,0x12,0x04,0x3c,
|
||||
0x00,0x3f,0x01,0x0a,0x0a,0x0a,0x03,0x04,0x09,0x01,
|
||||
0x12,0x03,0x3c,0x08,0x24,0x0a,0x0b,0x0a,0x04,0x04,
|
||||
0x09,0x02,0x00,0x12,0x03,0x3d,0x02,0x16,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x09,0x02,0x00,0x05,0x12,0x03,0x3d,
|
||||
0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x09,0x02,0x00,
|
||||
0x01,0x12,0x03,0x3d,0x09,0x11,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x09,0x02,0x00,0x03,0x12,0x03,0x3d,0x14,0x15,
|
||||
0x0a,0x0b,0x0a,0x04,0x04,0x09,0x02,0x01,0x12,0x03,
|
||||
0x3e,0x02,0x1f,0x0a,0x0c,0x0a,0x05,0x04,0x09,0x02,
|
||||
0x01,0x06,0x12,0x03,0x3e,0x02,0x14,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x09,0x02,0x01,0x01,0x12,0x03,0x3e,0x15,
|
||||
0x1a,0x0a,0x0c,0x0a,0x05,0x04,0x09,0x02,0x01,0x03,
|
||||
0x12,0x03,0x3e,0x1d,0x1e,0x0a,0x0a,0x0a,0x02,0x04,
|
||||
0x0a,0x12,0x04,0x41,0x00,0x44,0x01,0x0a,0x0a,0x0a,
|
||||
0x03,0x04,0x0a,0x01,0x12,0x03,0x41,0x08,0x21,0x0a,
|
||||
0x0b,0x0a,0x04,0x04,0x0a,0x02,0x00,0x12,0x03,0x42,
|
||||
0x02,0x13,0x0a,0x0c,0x0a,0x05,0x04,0x0a,0x02,0x00,
|
||||
0x05,0x12,0x03,0x42,0x02,0x08,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x0a,0x02,0x00,0x01,0x12,0x03,0x42,0x09,0x0e,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x0a,0x02,0x00,0x03,0x12,
|
||||
0x03,0x42,0x11,0x12,0x0a,0x0b,0x0a,0x04,0x04,0x0a,
|
||||
0x02,0x01,0x12,0x03,0x43,0x02,0x1f,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x0a,0x02,0x01,0x06,0x12,0x03,0x43,0x02,
|
||||
0x14,0x0a,0x0c,0x0a,0x05,0x04,0x0a,0x02,0x01,0x01,
|
||||
0x12,0x03,0x43,0x15,0x1a,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x0a,0x02,0x01,0x03,0x12,0x03,0x43,0x1d,0x1e,0x62,
|
||||
0x06,0x70,0x72,0x6f,0x74,0x6f,0x33,
|
||||
};
|
||||
static const char file_name[] = "kinematics.proto";
|
||||
static const char wpi_proto_ProtobufChassisSpeeds_name[] = "wpi.proto.ProtobufChassisSpeeds";
|
||||
std::string_view wpi_proto_ProtobufChassisSpeeds::msg_name(void) noexcept { return wpi_proto_ProtobufChassisSpeeds_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufChassisSpeeds::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufChassisSpeeds, wpi_proto_ProtobufChassisSpeeds, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufDifferentialDriveKinematics_name[] = "wpi.proto.ProtobufDifferentialDriveKinematics";
|
||||
std::string_view wpi_proto_ProtobufDifferentialDriveKinematics::msg_name(void) noexcept { return wpi_proto_ProtobufDifferentialDriveKinematics_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufDifferentialDriveKinematics::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufDifferentialDriveKinematics, wpi_proto_ProtobufDifferentialDriveKinematics, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufDifferentialDriveWheelSpeeds_name[] = "wpi.proto.ProtobufDifferentialDriveWheelSpeeds";
|
||||
std::string_view wpi_proto_ProtobufDifferentialDriveWheelSpeeds::msg_name(void) noexcept { return wpi_proto_ProtobufDifferentialDriveWheelSpeeds_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufDifferentialDriveWheelSpeeds::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufDifferentialDriveWheelSpeeds, wpi_proto_ProtobufDifferentialDriveWheelSpeeds, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufDifferentialDriveWheelPositions_name[] = "wpi.proto.ProtobufDifferentialDriveWheelPositions";
|
||||
std::string_view wpi_proto_ProtobufDifferentialDriveWheelPositions::msg_name(void) noexcept { return wpi_proto_ProtobufDifferentialDriveWheelPositions_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufDifferentialDriveWheelPositions::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufDifferentialDriveWheelPositions, wpi_proto_ProtobufDifferentialDriveWheelPositions, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufMecanumDriveKinematics_name[] = "wpi.proto.ProtobufMecanumDriveKinematics";
|
||||
std::string_view wpi_proto_ProtobufMecanumDriveKinematics::msg_name(void) noexcept { return wpi_proto_ProtobufMecanumDriveKinematics_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufMecanumDriveKinematics::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufMecanumDriveKinematics, wpi_proto_ProtobufMecanumDriveKinematics, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufMecanumDriveMotorVoltages_name[] = "wpi.proto.ProtobufMecanumDriveMotorVoltages";
|
||||
std::string_view wpi_proto_ProtobufMecanumDriveMotorVoltages::msg_name(void) noexcept { return wpi_proto_ProtobufMecanumDriveMotorVoltages_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufMecanumDriveMotorVoltages::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufMecanumDriveMotorVoltages, wpi_proto_ProtobufMecanumDriveMotorVoltages, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufMecanumDriveWheelPositions_name[] = "wpi.proto.ProtobufMecanumDriveWheelPositions";
|
||||
std::string_view wpi_proto_ProtobufMecanumDriveWheelPositions::msg_name(void) noexcept { return wpi_proto_ProtobufMecanumDriveWheelPositions_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufMecanumDriveWheelPositions::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufMecanumDriveWheelPositions, wpi_proto_ProtobufMecanumDriveWheelPositions, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufMecanumDriveWheelSpeeds_name[] = "wpi.proto.ProtobufMecanumDriveWheelSpeeds";
|
||||
std::string_view wpi_proto_ProtobufMecanumDriveWheelSpeeds::msg_name(void) noexcept { return wpi_proto_ProtobufMecanumDriveWheelSpeeds_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufMecanumDriveWheelSpeeds::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufMecanumDriveWheelSpeeds, wpi_proto_ProtobufMecanumDriveWheelSpeeds, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufSwerveDriveKinematics_name[] = "wpi.proto.ProtobufSwerveDriveKinematics";
|
||||
std::string_view wpi_proto_ProtobufSwerveDriveKinematics::msg_name(void) noexcept { return wpi_proto_ProtobufSwerveDriveKinematics_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufSwerveDriveKinematics::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufSwerveDriveKinematics, wpi_proto_ProtobufSwerveDriveKinematics, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufSwerveModulePosition_name[] = "wpi.proto.ProtobufSwerveModulePosition";
|
||||
std::string_view wpi_proto_ProtobufSwerveModulePosition::msg_name(void) noexcept { return wpi_proto_ProtobufSwerveModulePosition_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufSwerveModulePosition::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufSwerveModulePosition, wpi_proto_ProtobufSwerveModulePosition, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufSwerveModuleState_name[] = "wpi.proto.ProtobufSwerveModuleState";
|
||||
std::string_view wpi_proto_ProtobufSwerveModuleState::msg_name(void) noexcept { return wpi_proto_ProtobufSwerveModuleState_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufSwerveModuleState::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufSwerveModuleState, wpi_proto_ProtobufSwerveModuleState, AUTO)
|
||||
|
||||
|
||||
|
||||
#ifndef PB_CONVERT_DOUBLE_FLOAT
|
||||
/* On some platforms (such as AVR), double is really float.
|
||||
* To be able to encode/decode double on these platforms, you need.
|
||||
* to define PB_CONVERT_DOUBLE_FLOAT in pb.h or compiler command line.
|
||||
*/
|
||||
PB_STATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES)
|
||||
#endif
|
||||
|
||||
277
wpimath/src/generated/main/native/cpp/wpimath/protobuf/kinematics.npb.h
generated
Normal file
277
wpimath/src/generated/main/native/cpp/wpimath/protobuf/kinematics.npb.h
generated
Normal file
@@ -0,0 +1,277 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.9 */
|
||||
|
||||
#ifndef PB_WPI_PROTO_KINEMATICS_NPB_H_INCLUDED
|
||||
#define PB_WPI_PROTO_KINEMATICS_NPB_H_INCLUDED
|
||||
#include <pb.h>
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
#include "geometry2d.npb.h"
|
||||
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
/* Struct definitions */
|
||||
typedef struct _wpi_proto_ProtobufChassisSpeeds {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double vx;
|
||||
double vy;
|
||||
double omega;
|
||||
} wpi_proto_ProtobufChassisSpeeds;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufDifferentialDriveKinematics {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double track_width;
|
||||
} wpi_proto_ProtobufDifferentialDriveKinematics;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufDifferentialDriveWheelSpeeds {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double left;
|
||||
double right;
|
||||
} wpi_proto_ProtobufDifferentialDriveWheelSpeeds;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufDifferentialDriveWheelPositions {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double left;
|
||||
double right;
|
||||
} wpi_proto_ProtobufDifferentialDriveWheelPositions;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufMecanumDriveKinematics {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
pb_callback_t front_left;
|
||||
pb_callback_t front_right;
|
||||
pb_callback_t rear_left;
|
||||
pb_callback_t rear_right;
|
||||
} wpi_proto_ProtobufMecanumDriveKinematics;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufMecanumDriveMotorVoltages {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double front_left;
|
||||
double front_right;
|
||||
double rear_left;
|
||||
double rear_right;
|
||||
} wpi_proto_ProtobufMecanumDriveMotorVoltages;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufMecanumDriveWheelPositions {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double front_left;
|
||||
double front_right;
|
||||
double rear_left;
|
||||
double rear_right;
|
||||
} wpi_proto_ProtobufMecanumDriveWheelPositions;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufMecanumDriveWheelSpeeds {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double front_left;
|
||||
double front_right;
|
||||
double rear_left;
|
||||
double rear_right;
|
||||
} wpi_proto_ProtobufMecanumDriveWheelSpeeds;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufSwerveDriveKinematics {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
pb_callback_t modules;
|
||||
} wpi_proto_ProtobufSwerveDriveKinematics;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufSwerveModulePosition {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double distance;
|
||||
pb_callback_t angle;
|
||||
} wpi_proto_ProtobufSwerveModulePosition;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufSwerveModuleState {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double speed;
|
||||
pb_callback_t angle;
|
||||
} wpi_proto_ProtobufSwerveModuleState;
|
||||
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define wpi_proto_ProtobufChassisSpeeds_init_default {0, 0, 0}
|
||||
#define wpi_proto_ProtobufDifferentialDriveKinematics_init_default {0}
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelSpeeds_init_default {0, 0}
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelPositions_init_default {0, 0}
|
||||
#define wpi_proto_ProtobufMecanumDriveKinematics_init_default {{{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufMecanumDriveMotorVoltages_init_default {0, 0, 0, 0}
|
||||
#define wpi_proto_ProtobufMecanumDriveWheelPositions_init_default {0, 0, 0, 0}
|
||||
#define wpi_proto_ProtobufMecanumDriveWheelSpeeds_init_default {0, 0, 0, 0}
|
||||
#define wpi_proto_ProtobufSwerveDriveKinematics_init_default {{{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufSwerveModulePosition_init_default {0, {{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufSwerveModuleState_init_default {0, {{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufChassisSpeeds_init_zero {0, 0, 0}
|
||||
#define wpi_proto_ProtobufDifferentialDriveKinematics_init_zero {0}
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelSpeeds_init_zero {0, 0}
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelPositions_init_zero {0, 0}
|
||||
#define wpi_proto_ProtobufMecanumDriveKinematics_init_zero {{{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufMecanumDriveMotorVoltages_init_zero {0, 0, 0, 0}
|
||||
#define wpi_proto_ProtobufMecanumDriveWheelPositions_init_zero {0, 0, 0, 0}
|
||||
#define wpi_proto_ProtobufMecanumDriveWheelSpeeds_init_zero {0, 0, 0, 0}
|
||||
#define wpi_proto_ProtobufSwerveDriveKinematics_init_zero {{{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufSwerveModulePosition_init_zero {0, {{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufSwerveModuleState_init_zero {0, {{NULL}, NULL}}
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define wpi_proto_ProtobufChassisSpeeds_vx_tag 1
|
||||
#define wpi_proto_ProtobufChassisSpeeds_vy_tag 2
|
||||
#define wpi_proto_ProtobufChassisSpeeds_omega_tag 3
|
||||
#define wpi_proto_ProtobufDifferentialDriveKinematics_track_width_tag 1
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelSpeeds_left_tag 1
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelSpeeds_right_tag 2
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelPositions_left_tag 1
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelPositions_right_tag 2
|
||||
#define wpi_proto_ProtobufMecanumDriveKinematics_front_left_tag 1
|
||||
#define wpi_proto_ProtobufMecanumDriveKinematics_front_right_tag 2
|
||||
#define wpi_proto_ProtobufMecanumDriveKinematics_rear_left_tag 3
|
||||
#define wpi_proto_ProtobufMecanumDriveKinematics_rear_right_tag 4
|
||||
#define wpi_proto_ProtobufMecanumDriveMotorVoltages_front_left_tag 1
|
||||
#define wpi_proto_ProtobufMecanumDriveMotorVoltages_front_right_tag 2
|
||||
#define wpi_proto_ProtobufMecanumDriveMotorVoltages_rear_left_tag 3
|
||||
#define wpi_proto_ProtobufMecanumDriveMotorVoltages_rear_right_tag 4
|
||||
#define wpi_proto_ProtobufMecanumDriveWheelPositions_front_left_tag 1
|
||||
#define wpi_proto_ProtobufMecanumDriveWheelPositions_front_right_tag 2
|
||||
#define wpi_proto_ProtobufMecanumDriveWheelPositions_rear_left_tag 3
|
||||
#define wpi_proto_ProtobufMecanumDriveWheelPositions_rear_right_tag 4
|
||||
#define wpi_proto_ProtobufMecanumDriveWheelSpeeds_front_left_tag 1
|
||||
#define wpi_proto_ProtobufMecanumDriveWheelSpeeds_front_right_tag 2
|
||||
#define wpi_proto_ProtobufMecanumDriveWheelSpeeds_rear_left_tag 3
|
||||
#define wpi_proto_ProtobufMecanumDriveWheelSpeeds_rear_right_tag 4
|
||||
#define wpi_proto_ProtobufSwerveDriveKinematics_modules_tag 1
|
||||
#define wpi_proto_ProtobufSwerveModulePosition_distance_tag 1
|
||||
#define wpi_proto_ProtobufSwerveModulePosition_angle_tag 2
|
||||
#define wpi_proto_ProtobufSwerveModuleState_speed_tag 1
|
||||
#define wpi_proto_ProtobufSwerveModuleState_angle_tag 2
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define wpi_proto_ProtobufChassisSpeeds_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, vx, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, vy, 2) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, omega, 3)
|
||||
#define wpi_proto_ProtobufChassisSpeeds_CALLBACK NULL
|
||||
#define wpi_proto_ProtobufChassisSpeeds_DEFAULT NULL
|
||||
|
||||
#define wpi_proto_ProtobufDifferentialDriveKinematics_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, track_width, 1)
|
||||
#define wpi_proto_ProtobufDifferentialDriveKinematics_CALLBACK NULL
|
||||
#define wpi_proto_ProtobufDifferentialDriveKinematics_DEFAULT NULL
|
||||
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelSpeeds_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, left, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, right, 2)
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelSpeeds_CALLBACK NULL
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelSpeeds_DEFAULT NULL
|
||||
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelPositions_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, left, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, right, 2)
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelPositions_CALLBACK NULL
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelPositions_DEFAULT NULL
|
||||
|
||||
#define wpi_proto_ProtobufMecanumDriveKinematics_FIELDLIST(X, a) \
|
||||
X(a, CALLBACK, OPTIONAL, MESSAGE, front_left, 1) \
|
||||
X(a, CALLBACK, OPTIONAL, MESSAGE, front_right, 2) \
|
||||
X(a, CALLBACK, OPTIONAL, MESSAGE, rear_left, 3) \
|
||||
X(a, CALLBACK, OPTIONAL, MESSAGE, rear_right, 4)
|
||||
#define wpi_proto_ProtobufMecanumDriveKinematics_CALLBACK pb_default_field_callback
|
||||
#define wpi_proto_ProtobufMecanumDriveKinematics_DEFAULT NULL
|
||||
#define wpi_proto_ProtobufMecanumDriveKinematics_front_left_MSGTYPE wpi_proto_ProtobufTranslation2d
|
||||
#define wpi_proto_ProtobufMecanumDriveKinematics_front_right_MSGTYPE wpi_proto_ProtobufTranslation2d
|
||||
#define wpi_proto_ProtobufMecanumDriveKinematics_rear_left_MSGTYPE wpi_proto_ProtobufTranslation2d
|
||||
#define wpi_proto_ProtobufMecanumDriveKinematics_rear_right_MSGTYPE wpi_proto_ProtobufTranslation2d
|
||||
|
||||
#define wpi_proto_ProtobufMecanumDriveMotorVoltages_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, front_left, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, front_right, 2) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, rear_left, 3) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, rear_right, 4)
|
||||
#define wpi_proto_ProtobufMecanumDriveMotorVoltages_CALLBACK NULL
|
||||
#define wpi_proto_ProtobufMecanumDriveMotorVoltages_DEFAULT NULL
|
||||
|
||||
#define wpi_proto_ProtobufMecanumDriveWheelPositions_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, front_left, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, front_right, 2) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, rear_left, 3) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, rear_right, 4)
|
||||
#define wpi_proto_ProtobufMecanumDriveWheelPositions_CALLBACK NULL
|
||||
#define wpi_proto_ProtobufMecanumDriveWheelPositions_DEFAULT NULL
|
||||
|
||||
#define wpi_proto_ProtobufMecanumDriveWheelSpeeds_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, front_left, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, front_right, 2) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, rear_left, 3) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, rear_right, 4)
|
||||
#define wpi_proto_ProtobufMecanumDriveWheelSpeeds_CALLBACK NULL
|
||||
#define wpi_proto_ProtobufMecanumDriveWheelSpeeds_DEFAULT NULL
|
||||
|
||||
#define wpi_proto_ProtobufSwerveDriveKinematics_FIELDLIST(X, a) \
|
||||
X(a, CALLBACK, REPEATED, MESSAGE, modules, 1)
|
||||
#define wpi_proto_ProtobufSwerveDriveKinematics_CALLBACK pb_default_field_callback
|
||||
#define wpi_proto_ProtobufSwerveDriveKinematics_DEFAULT NULL
|
||||
#define wpi_proto_ProtobufSwerveDriveKinematics_modules_MSGTYPE wpi_proto_ProtobufTranslation2d
|
||||
|
||||
#define wpi_proto_ProtobufSwerveModulePosition_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, distance, 1) \
|
||||
X(a, CALLBACK, OPTIONAL, MESSAGE, angle, 2)
|
||||
#define wpi_proto_ProtobufSwerveModulePosition_CALLBACK pb_default_field_callback
|
||||
#define wpi_proto_ProtobufSwerveModulePosition_DEFAULT NULL
|
||||
#define wpi_proto_ProtobufSwerveModulePosition_angle_MSGTYPE wpi_proto_ProtobufRotation2d
|
||||
|
||||
#define wpi_proto_ProtobufSwerveModuleState_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, speed, 1) \
|
||||
X(a, CALLBACK, OPTIONAL, MESSAGE, angle, 2)
|
||||
#define wpi_proto_ProtobufSwerveModuleState_CALLBACK pb_default_field_callback
|
||||
#define wpi_proto_ProtobufSwerveModuleState_DEFAULT NULL
|
||||
#define wpi_proto_ProtobufSwerveModuleState_angle_MSGTYPE wpi_proto_ProtobufRotation2d
|
||||
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
/* wpi_proto_ProtobufMecanumDriveKinematics_size depends on runtime parameters */
|
||||
/* wpi_proto_ProtobufSwerveDriveKinematics_size depends on runtime parameters */
|
||||
/* wpi_proto_ProtobufSwerveModulePosition_size depends on runtime parameters */
|
||||
/* wpi_proto_ProtobufSwerveModuleState_size depends on runtime parameters */
|
||||
#define WPI_PROTO_KINEMATICS_NPB_H_MAX_SIZE wpi_proto_ProtobufMecanumDriveMotorVoltages_size
|
||||
#define wpi_proto_ProtobufChassisSpeeds_size 27
|
||||
#define wpi_proto_ProtobufDifferentialDriveKinematics_size 9
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelPositions_size 18
|
||||
#define wpi_proto_ProtobufDifferentialDriveWheelSpeeds_size 18
|
||||
#define wpi_proto_ProtobufMecanumDriveMotorVoltages_size 36
|
||||
#define wpi_proto_ProtobufMecanumDriveWheelPositions_size 36
|
||||
#define wpi_proto_ProtobufMecanumDriveWheelSpeeds_size 36
|
||||
|
||||
|
||||
#endif
|
||||
93
wpimath/src/generated/main/native/cpp/wpimath/protobuf/plant.npb.cpp
generated
Normal file
93
wpimath/src/generated/main/native/cpp/wpimath/protobuf/plant.npb.cpp
generated
Normal file
@@ -0,0 +1,93 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.9 */
|
||||
|
||||
#include "plant.npb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
static const uint8_t file_descriptor[] {
|
||||
0x0a,0x0b,0x70,0x6c,0x61,0x6e,0x74,0x2e,0x70,0x72,
|
||||
0x6f,0x74,0x6f,0x12,0x09,0x77,0x70,0x69,0x2e,0x70,
|
||||
0x72,0x6f,0x74,0x6f,0x22,0xc4,0x01,0x0a,0x0f,0x50,
|
||||
0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x44,0x43,0x4d,
|
||||
0x6f,0x74,0x6f,0x72,0x12,0x27,0x0a,0x0f,0x6e,0x6f,
|
||||
0x6d,0x69,0x6e,0x61,0x6c,0x5f,0x76,0x6f,0x6c,0x74,
|
||||
0x61,0x67,0x65,0x18,0x01,0x20,0x01,0x28,0x01,0x52,
|
||||
0x0e,0x6e,0x6f,0x6d,0x69,0x6e,0x61,0x6c,0x56,0x6f,
|
||||
0x6c,0x74,0x61,0x67,0x65,0x12,0x21,0x0a,0x0c,0x73,
|
||||
0x74,0x61,0x6c,0x6c,0x5f,0x74,0x6f,0x72,0x71,0x75,
|
||||
0x65,0x18,0x02,0x20,0x01,0x28,0x01,0x52,0x0b,0x73,
|
||||
0x74,0x61,0x6c,0x6c,0x54,0x6f,0x72,0x71,0x75,0x65,
|
||||
0x12,0x23,0x0a,0x0d,0x73,0x74,0x61,0x6c,0x6c,0x5f,
|
||||
0x63,0x75,0x72,0x72,0x65,0x6e,0x74,0x18,0x03,0x20,
|
||||
0x01,0x28,0x01,0x52,0x0c,0x73,0x74,0x61,0x6c,0x6c,
|
||||
0x43,0x75,0x72,0x72,0x65,0x6e,0x74,0x12,0x21,0x0a,
|
||||
0x0c,0x66,0x72,0x65,0x65,0x5f,0x63,0x75,0x72,0x72,
|
||||
0x65,0x6e,0x74,0x18,0x04,0x20,0x01,0x28,0x01,0x52,
|
||||
0x0b,0x66,0x72,0x65,0x65,0x43,0x75,0x72,0x72,0x65,
|
||||
0x6e,0x74,0x12,0x1d,0x0a,0x0a,0x66,0x72,0x65,0x65,
|
||||
0x5f,0x73,0x70,0x65,0x65,0x64,0x18,0x05,0x20,0x01,
|
||||
0x28,0x01,0x52,0x09,0x66,0x72,0x65,0x65,0x53,0x70,
|
||||
0x65,0x65,0x64,0x42,0x1a,0x0a,0x18,0x65,0x64,0x75,
|
||||
0x2e,0x77,0x70,0x69,0x2e,0x66,0x69,0x72,0x73,0x74,
|
||||
0x2e,0x6d,0x61,0x74,0x68,0x2e,0x70,0x72,0x6f,0x74,
|
||||
0x6f,0x4a,0xdc,0x02,0x0a,0x06,0x12,0x04,0x00,0x00,
|
||||
0x0c,0x01,0x0a,0x08,0x0a,0x01,0x0c,0x12,0x03,0x00,
|
||||
0x00,0x12,0x0a,0x08,0x0a,0x01,0x02,0x12,0x03,0x02,
|
||||
0x00,0x12,0x0a,0x08,0x0a,0x01,0x08,0x12,0x03,0x04,
|
||||
0x00,0x31,0x0a,0x09,0x0a,0x02,0x08,0x01,0x12,0x03,
|
||||
0x04,0x00,0x31,0x0a,0x0a,0x0a,0x02,0x04,0x00,0x12,
|
||||
0x04,0x06,0x00,0x0c,0x01,0x0a,0x0a,0x0a,0x03,0x04,
|
||||
0x00,0x01,0x12,0x03,0x06,0x08,0x17,0x0a,0x0b,0x0a,
|
||||
0x04,0x04,0x00,0x02,0x00,0x12,0x03,0x07,0x02,0x1d,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x00,0x05,0x12,
|
||||
0x03,0x07,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x00,
|
||||
0x02,0x00,0x01,0x12,0x03,0x07,0x09,0x18,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x00,0x02,0x00,0x03,0x12,0x03,0x07,
|
||||
0x1b,0x1c,0x0a,0x0b,0x0a,0x04,0x04,0x00,0x02,0x01,
|
||||
0x12,0x03,0x08,0x02,0x1a,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x00,0x02,0x01,0x05,0x12,0x03,0x08,0x02,0x08,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x00,0x02,0x01,0x01,0x12,0x03,
|
||||
0x08,0x09,0x15,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,
|
||||
0x01,0x03,0x12,0x03,0x08,0x18,0x19,0x0a,0x0b,0x0a,
|
||||
0x04,0x04,0x00,0x02,0x02,0x12,0x03,0x09,0x02,0x1b,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x02,0x05,0x12,
|
||||
0x03,0x09,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x00,
|
||||
0x02,0x02,0x01,0x12,0x03,0x09,0x09,0x16,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x00,0x02,0x02,0x03,0x12,0x03,0x09,
|
||||
0x19,0x1a,0x0a,0x0b,0x0a,0x04,0x04,0x00,0x02,0x03,
|
||||
0x12,0x03,0x0a,0x02,0x1a,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x00,0x02,0x03,0x05,0x12,0x03,0x0a,0x02,0x08,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x00,0x02,0x03,0x01,0x12,0x03,
|
||||
0x0a,0x09,0x15,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,
|
||||
0x03,0x03,0x12,0x03,0x0a,0x18,0x19,0x0a,0x0b,0x0a,
|
||||
0x04,0x04,0x00,0x02,0x04,0x12,0x03,0x0b,0x02,0x18,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x04,0x05,0x12,
|
||||
0x03,0x0b,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x00,
|
||||
0x02,0x04,0x01,0x12,0x03,0x0b,0x09,0x13,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x00,0x02,0x04,0x03,0x12,0x03,0x0b,
|
||||
0x16,0x17,0x62,0x06,0x70,0x72,0x6f,0x74,0x6f,0x33,
|
||||
|
||||
};
|
||||
static const char file_name[] = "plant.proto";
|
||||
static const char wpi_proto_ProtobufDCMotor_name[] = "wpi.proto.ProtobufDCMotor";
|
||||
std::string_view wpi_proto_ProtobufDCMotor::msg_name(void) noexcept { return wpi_proto_ProtobufDCMotor_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufDCMotor::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufDCMotor, wpi_proto_ProtobufDCMotor, AUTO)
|
||||
|
||||
|
||||
|
||||
#ifndef PB_CONVERT_DOUBLE_FLOAT
|
||||
/* On some platforms (such as AVR), double is really float.
|
||||
* To be able to encode/decode double on these platforms, you need.
|
||||
* to define PB_CONVERT_DOUBLE_FLOAT in pb.h or compiler command line.
|
||||
*/
|
||||
PB_STATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES)
|
||||
#endif
|
||||
|
||||
57
wpimath/src/generated/main/native/cpp/wpimath/protobuf/plant.npb.h
generated
Normal file
57
wpimath/src/generated/main/native/cpp/wpimath/protobuf/plant.npb.h
generated
Normal file
@@ -0,0 +1,57 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.9 */
|
||||
|
||||
#ifndef PB_WPI_PROTO_PLANT_NPB_H_INCLUDED
|
||||
#define PB_WPI_PROTO_PLANT_NPB_H_INCLUDED
|
||||
#include <pb.h>
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
/* Struct definitions */
|
||||
typedef struct _wpi_proto_ProtobufDCMotor {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double nominal_voltage;
|
||||
double stall_torque;
|
||||
double stall_current;
|
||||
double free_current;
|
||||
double free_speed;
|
||||
} wpi_proto_ProtobufDCMotor;
|
||||
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define wpi_proto_ProtobufDCMotor_init_default {0, 0, 0, 0, 0}
|
||||
#define wpi_proto_ProtobufDCMotor_init_zero {0, 0, 0, 0, 0}
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define wpi_proto_ProtobufDCMotor_nominal_voltage_tag 1
|
||||
#define wpi_proto_ProtobufDCMotor_stall_torque_tag 2
|
||||
#define wpi_proto_ProtobufDCMotor_stall_current_tag 3
|
||||
#define wpi_proto_ProtobufDCMotor_free_current_tag 4
|
||||
#define wpi_proto_ProtobufDCMotor_free_speed_tag 5
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define wpi_proto_ProtobufDCMotor_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, nominal_voltage, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, stall_torque, 2) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, stall_current, 3) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, free_current, 4) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, free_speed, 5)
|
||||
#define wpi_proto_ProtobufDCMotor_CALLBACK NULL
|
||||
#define wpi_proto_ProtobufDCMotor_DEFAULT NULL
|
||||
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
#define WPI_PROTO_PLANT_NPB_H_MAX_SIZE wpi_proto_ProtobufDCMotor_size
|
||||
#define wpi_proto_ProtobufDCMotor_size 45
|
||||
|
||||
|
||||
#endif
|
||||
137
wpimath/src/generated/main/native/cpp/wpimath/protobuf/spline.npb.cpp
generated
Normal file
137
wpimath/src/generated/main/native/cpp/wpimath/protobuf/spline.npb.cpp
generated
Normal file
@@ -0,0 +1,137 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.9 */
|
||||
|
||||
#include "spline.npb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
static const uint8_t file_descriptor[] {
|
||||
0x0a,0x0c,0x73,0x70,0x6c,0x69,0x6e,0x65,0x2e,0x70,
|
||||
0x72,0x6f,0x74,0x6f,0x12,0x09,0x77,0x70,0x69,0x2e,
|
||||
0x70,0x72,0x6f,0x74,0x6f,0x22,0x88,0x01,0x0a,0x1a,
|
||||
0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x43,0x75,
|
||||
0x62,0x69,0x63,0x48,0x65,0x72,0x6d,0x69,0x74,0x65,
|
||||
0x53,0x70,0x6c,0x69,0x6e,0x65,0x12,0x1b,0x0a,0x09,
|
||||
0x78,0x5f,0x69,0x6e,0x69,0x74,0x69,0x61,0x6c,0x18,
|
||||
0x01,0x20,0x03,0x28,0x01,0x52,0x08,0x78,0x49,0x6e,
|
||||
0x69,0x74,0x69,0x61,0x6c,0x12,0x17,0x0a,0x07,0x78,
|
||||
0x5f,0x66,0x69,0x6e,0x61,0x6c,0x18,0x02,0x20,0x03,
|
||||
0x28,0x01,0x52,0x06,0x78,0x46,0x69,0x6e,0x61,0x6c,
|
||||
0x12,0x1b,0x0a,0x09,0x79,0x5f,0x69,0x6e,0x69,0x74,
|
||||
0x69,0x61,0x6c,0x18,0x03,0x20,0x03,0x28,0x01,0x52,
|
||||
0x08,0x79,0x49,0x6e,0x69,0x74,0x69,0x61,0x6c,0x12,
|
||||
0x17,0x0a,0x07,0x79,0x5f,0x66,0x69,0x6e,0x61,0x6c,
|
||||
0x18,0x04,0x20,0x03,0x28,0x01,0x52,0x06,0x79,0x46,
|
||||
0x69,0x6e,0x61,0x6c,0x22,0x8a,0x01,0x0a,0x1c,0x50,
|
||||
0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x51,0x75,0x69,
|
||||
0x6e,0x74,0x69,0x63,0x48,0x65,0x72,0x6d,0x69,0x74,
|
||||
0x65,0x53,0x70,0x6c,0x69,0x6e,0x65,0x12,0x1b,0x0a,
|
||||
0x09,0x78,0x5f,0x69,0x6e,0x69,0x74,0x69,0x61,0x6c,
|
||||
0x18,0x01,0x20,0x03,0x28,0x01,0x52,0x08,0x78,0x49,
|
||||
0x6e,0x69,0x74,0x69,0x61,0x6c,0x12,0x17,0x0a,0x07,
|
||||
0x78,0x5f,0x66,0x69,0x6e,0x61,0x6c,0x18,0x02,0x20,
|
||||
0x03,0x28,0x01,0x52,0x06,0x78,0x46,0x69,0x6e,0x61,
|
||||
0x6c,0x12,0x1b,0x0a,0x09,0x79,0x5f,0x69,0x6e,0x69,
|
||||
0x74,0x69,0x61,0x6c,0x18,0x03,0x20,0x03,0x28,0x01,
|
||||
0x52,0x08,0x79,0x49,0x6e,0x69,0x74,0x69,0x61,0x6c,
|
||||
0x12,0x17,0x0a,0x07,0x79,0x5f,0x66,0x69,0x6e,0x61,
|
||||
0x6c,0x18,0x04,0x20,0x03,0x28,0x01,0x52,0x06,0x79,
|
||||
0x46,0x69,0x6e,0x61,0x6c,0x42,0x1a,0x0a,0x18,0x65,
|
||||
0x64,0x75,0x2e,0x77,0x70,0x69,0x2e,0x66,0x69,0x72,
|
||||
0x73,0x74,0x2e,0x6d,0x61,0x74,0x68,0x2e,0x70,0x72,
|
||||
0x6f,0x74,0x6f,0x4a,0x89,0x05,0x0a,0x06,0x12,0x04,
|
||||
0x00,0x00,0x12,0x01,0x0a,0x08,0x0a,0x01,0x0c,0x12,
|
||||
0x03,0x00,0x00,0x12,0x0a,0x08,0x0a,0x01,0x02,0x12,
|
||||
0x03,0x02,0x00,0x12,0x0a,0x08,0x0a,0x01,0x08,0x12,
|
||||
0x03,0x04,0x00,0x31,0x0a,0x09,0x0a,0x02,0x08,0x01,
|
||||
0x12,0x03,0x04,0x00,0x31,0x0a,0x0a,0x0a,0x02,0x04,
|
||||
0x00,0x12,0x04,0x06,0x00,0x0b,0x01,0x0a,0x0a,0x0a,
|
||||
0x03,0x04,0x00,0x01,0x12,0x03,0x06,0x08,0x22,0x0a,
|
||||
0x0b,0x0a,0x04,0x04,0x00,0x02,0x00,0x12,0x03,0x07,
|
||||
0x02,0x20,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x00,
|
||||
0x04,0x12,0x03,0x07,0x02,0x0a,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x00,0x02,0x00,0x05,0x12,0x03,0x07,0x0b,0x11,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x00,0x01,0x12,
|
||||
0x03,0x07,0x12,0x1b,0x0a,0x0c,0x0a,0x05,0x04,0x00,
|
||||
0x02,0x00,0x03,0x12,0x03,0x07,0x1e,0x1f,0x0a,0x0b,
|
||||
0x0a,0x04,0x04,0x00,0x02,0x01,0x12,0x03,0x08,0x02,
|
||||
0x1e,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x01,0x04,
|
||||
0x12,0x03,0x08,0x02,0x0a,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x00,0x02,0x01,0x05,0x12,0x03,0x08,0x0b,0x11,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x00,0x02,0x01,0x01,0x12,0x03,
|
||||
0x08,0x12,0x19,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,
|
||||
0x01,0x03,0x12,0x03,0x08,0x1c,0x1d,0x0a,0x0b,0x0a,
|
||||
0x04,0x04,0x00,0x02,0x02,0x12,0x03,0x09,0x02,0x20,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x02,0x04,0x12,
|
||||
0x03,0x09,0x02,0x0a,0x0a,0x0c,0x0a,0x05,0x04,0x00,
|
||||
0x02,0x02,0x05,0x12,0x03,0x09,0x0b,0x11,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x00,0x02,0x02,0x01,0x12,0x03,0x09,
|
||||
0x12,0x1b,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x02,
|
||||
0x03,0x12,0x03,0x09,0x1e,0x1f,0x0a,0x0b,0x0a,0x04,
|
||||
0x04,0x00,0x02,0x03,0x12,0x03,0x0a,0x02,0x1e,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x00,0x02,0x03,0x04,0x12,0x03,
|
||||
0x0a,0x02,0x0a,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,
|
||||
0x03,0x05,0x12,0x03,0x0a,0x0b,0x11,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x00,0x02,0x03,0x01,0x12,0x03,0x0a,0x12,
|
||||
0x19,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x03,0x03,
|
||||
0x12,0x03,0x0a,0x1c,0x1d,0x0a,0x0a,0x0a,0x02,0x04,
|
||||
0x01,0x12,0x04,0x0d,0x00,0x12,0x01,0x0a,0x0a,0x0a,
|
||||
0x03,0x04,0x01,0x01,0x12,0x03,0x0d,0x08,0x24,0x0a,
|
||||
0x0b,0x0a,0x04,0x04,0x01,0x02,0x00,0x12,0x03,0x0e,
|
||||
0x02,0x20,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x00,
|
||||
0x04,0x12,0x03,0x0e,0x02,0x0a,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x01,0x02,0x00,0x05,0x12,0x03,0x0e,0x0b,0x11,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x00,0x01,0x12,
|
||||
0x03,0x0e,0x12,0x1b,0x0a,0x0c,0x0a,0x05,0x04,0x01,
|
||||
0x02,0x00,0x03,0x12,0x03,0x0e,0x1e,0x1f,0x0a,0x0b,
|
||||
0x0a,0x04,0x04,0x01,0x02,0x01,0x12,0x03,0x0f,0x02,
|
||||
0x1e,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x01,0x04,
|
||||
0x12,0x03,0x0f,0x02,0x0a,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x01,0x02,0x01,0x05,0x12,0x03,0x0f,0x0b,0x11,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x01,0x02,0x01,0x01,0x12,0x03,
|
||||
0x0f,0x12,0x19,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,
|
||||
0x01,0x03,0x12,0x03,0x0f,0x1c,0x1d,0x0a,0x0b,0x0a,
|
||||
0x04,0x04,0x01,0x02,0x02,0x12,0x03,0x10,0x02,0x20,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x02,0x04,0x12,
|
||||
0x03,0x10,0x02,0x0a,0x0a,0x0c,0x0a,0x05,0x04,0x01,
|
||||
0x02,0x02,0x05,0x12,0x03,0x10,0x0b,0x11,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x01,0x02,0x02,0x01,0x12,0x03,0x10,
|
||||
0x12,0x1b,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x02,
|
||||
0x03,0x12,0x03,0x10,0x1e,0x1f,0x0a,0x0b,0x0a,0x04,
|
||||
0x04,0x01,0x02,0x03,0x12,0x03,0x11,0x02,0x1e,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x01,0x02,0x03,0x04,0x12,0x03,
|
||||
0x11,0x02,0x0a,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,
|
||||
0x03,0x05,0x12,0x03,0x11,0x0b,0x11,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x01,0x02,0x03,0x01,0x12,0x03,0x11,0x12,
|
||||
0x19,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x03,0x03,
|
||||
0x12,0x03,0x11,0x1c,0x1d,0x62,0x06,0x70,0x72,0x6f,
|
||||
0x74,0x6f,0x33,
|
||||
};
|
||||
static const char file_name[] = "spline.proto";
|
||||
static const char wpi_proto_ProtobufCubicHermiteSpline_name[] = "wpi.proto.ProtobufCubicHermiteSpline";
|
||||
std::string_view wpi_proto_ProtobufCubicHermiteSpline::msg_name(void) noexcept { return wpi_proto_ProtobufCubicHermiteSpline_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufCubicHermiteSpline::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufCubicHermiteSpline, wpi_proto_ProtobufCubicHermiteSpline, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufQuinticHermiteSpline_name[] = "wpi.proto.ProtobufQuinticHermiteSpline";
|
||||
std::string_view wpi_proto_ProtobufQuinticHermiteSpline::msg_name(void) noexcept { return wpi_proto_ProtobufQuinticHermiteSpline_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufQuinticHermiteSpline::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufQuinticHermiteSpline, wpi_proto_ProtobufQuinticHermiteSpline, AUTO)
|
||||
|
||||
|
||||
|
||||
#ifndef PB_CONVERT_DOUBLE_FLOAT
|
||||
/* On some platforms (such as AVR), double is really float.
|
||||
* To be able to encode/decode double on these platforms, you need.
|
||||
* to define PB_CONVERT_DOUBLE_FLOAT in pb.h or compiler command line.
|
||||
*/
|
||||
PB_STATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES)
|
||||
#endif
|
||||
|
||||
79
wpimath/src/generated/main/native/cpp/wpimath/protobuf/spline.npb.h
generated
Normal file
79
wpimath/src/generated/main/native/cpp/wpimath/protobuf/spline.npb.h
generated
Normal file
@@ -0,0 +1,79 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.9 */
|
||||
|
||||
#ifndef PB_WPI_PROTO_SPLINE_NPB_H_INCLUDED
|
||||
#define PB_WPI_PROTO_SPLINE_NPB_H_INCLUDED
|
||||
#include <pb.h>
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
/* Struct definitions */
|
||||
typedef struct _wpi_proto_ProtobufCubicHermiteSpline {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
pb_callback_t x_initial;
|
||||
pb_callback_t x_final;
|
||||
pb_callback_t y_initial;
|
||||
pb_callback_t y_final;
|
||||
} wpi_proto_ProtobufCubicHermiteSpline;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufQuinticHermiteSpline {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
pb_callback_t x_initial;
|
||||
pb_callback_t x_final;
|
||||
pb_callback_t y_initial;
|
||||
pb_callback_t y_final;
|
||||
} wpi_proto_ProtobufQuinticHermiteSpline;
|
||||
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define wpi_proto_ProtobufCubicHermiteSpline_init_default {{{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufQuinticHermiteSpline_init_default {{{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufCubicHermiteSpline_init_zero {{{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufQuinticHermiteSpline_init_zero {{{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}}
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define wpi_proto_ProtobufCubicHermiteSpline_x_initial_tag 1
|
||||
#define wpi_proto_ProtobufCubicHermiteSpline_x_final_tag 2
|
||||
#define wpi_proto_ProtobufCubicHermiteSpline_y_initial_tag 3
|
||||
#define wpi_proto_ProtobufCubicHermiteSpline_y_final_tag 4
|
||||
#define wpi_proto_ProtobufQuinticHermiteSpline_x_initial_tag 1
|
||||
#define wpi_proto_ProtobufQuinticHermiteSpline_x_final_tag 2
|
||||
#define wpi_proto_ProtobufQuinticHermiteSpline_y_initial_tag 3
|
||||
#define wpi_proto_ProtobufQuinticHermiteSpline_y_final_tag 4
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define wpi_proto_ProtobufCubicHermiteSpline_FIELDLIST(X, a) \
|
||||
X(a, CALLBACK, REPEATED, DOUBLE, x_initial, 1) \
|
||||
X(a, CALLBACK, REPEATED, DOUBLE, x_final, 2) \
|
||||
X(a, CALLBACK, REPEATED, DOUBLE, y_initial, 3) \
|
||||
X(a, CALLBACK, REPEATED, DOUBLE, y_final, 4)
|
||||
#define wpi_proto_ProtobufCubicHermiteSpline_CALLBACK pb_default_field_callback
|
||||
#define wpi_proto_ProtobufCubicHermiteSpline_DEFAULT NULL
|
||||
|
||||
#define wpi_proto_ProtobufQuinticHermiteSpline_FIELDLIST(X, a) \
|
||||
X(a, CALLBACK, REPEATED, DOUBLE, x_initial, 1) \
|
||||
X(a, CALLBACK, REPEATED, DOUBLE, x_final, 2) \
|
||||
X(a, CALLBACK, REPEATED, DOUBLE, y_initial, 3) \
|
||||
X(a, CALLBACK, REPEATED, DOUBLE, y_final, 4)
|
||||
#define wpi_proto_ProtobufQuinticHermiteSpline_CALLBACK pb_default_field_callback
|
||||
#define wpi_proto_ProtobufQuinticHermiteSpline_DEFAULT NULL
|
||||
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
/* wpi_proto_ProtobufCubicHermiteSpline_size depends on runtime parameters */
|
||||
/* wpi_proto_ProtobufQuinticHermiteSpline_size depends on runtime parameters */
|
||||
|
||||
|
||||
#endif
|
||||
107
wpimath/src/generated/main/native/cpp/wpimath/protobuf/system.npb.cpp
generated
Normal file
107
wpimath/src/generated/main/native/cpp/wpimath/protobuf/system.npb.cpp
generated
Normal file
@@ -0,0 +1,107 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.9 */
|
||||
|
||||
#include "system.npb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
static const uint8_t file_descriptor[] {
|
||||
0x0a,0x0c,0x73,0x79,0x73,0x74,0x65,0x6d,0x2e,0x70,
|
||||
0x72,0x6f,0x74,0x6f,0x12,0x09,0x77,0x70,0x69,0x2e,
|
||||
0x70,0x72,0x6f,0x74,0x6f,0x1a,0x0d,0x77,0x70,0x69,
|
||||
0x6d,0x61,0x74,0x68,0x2e,0x70,0x72,0x6f,0x74,0x6f,
|
||||
0x22,0x99,0x02,0x0a,0x14,0x50,0x72,0x6f,0x74,0x6f,
|
||||
0x62,0x75,0x66,0x4c,0x69,0x6e,0x65,0x61,0x72,0x53,
|
||||
0x79,0x73,0x74,0x65,0x6d,0x12,0x1d,0x0a,0x0a,0x6e,
|
||||
0x75,0x6d,0x5f,0x73,0x74,0x61,0x74,0x65,0x73,0x18,
|
||||
0x01,0x20,0x01,0x28,0x0d,0x52,0x09,0x6e,0x75,0x6d,
|
||||
0x53,0x74,0x61,0x74,0x65,0x73,0x12,0x1d,0x0a,0x0a,
|
||||
0x6e,0x75,0x6d,0x5f,0x69,0x6e,0x70,0x75,0x74,0x73,
|
||||
0x18,0x02,0x20,0x01,0x28,0x0d,0x52,0x09,0x6e,0x75,
|
||||
0x6d,0x49,0x6e,0x70,0x75,0x74,0x73,0x12,0x1f,0x0a,
|
||||
0x0b,0x6e,0x75,0x6d,0x5f,0x6f,0x75,0x74,0x70,0x75,
|
||||
0x74,0x73,0x18,0x03,0x20,0x01,0x28,0x0d,0x52,0x0a,
|
||||
0x6e,0x75,0x6d,0x4f,0x75,0x74,0x70,0x75,0x74,0x73,
|
||||
0x12,0x27,0x0a,0x01,0x61,0x18,0x04,0x20,0x01,0x28,
|
||||
0x0b,0x32,0x19,0x2e,0x77,0x70,0x69,0x2e,0x70,0x72,
|
||||
0x6f,0x74,0x6f,0x2e,0x50,0x72,0x6f,0x74,0x6f,0x62,
|
||||
0x75,0x66,0x4d,0x61,0x74,0x72,0x69,0x78,0x52,0x01,
|
||||
0x61,0x12,0x27,0x0a,0x01,0x62,0x18,0x05,0x20,0x01,
|
||||
0x28,0x0b,0x32,0x19,0x2e,0x77,0x70,0x69,0x2e,0x70,
|
||||
0x72,0x6f,0x74,0x6f,0x2e,0x50,0x72,0x6f,0x74,0x6f,
|
||||
0x62,0x75,0x66,0x4d,0x61,0x74,0x72,0x69,0x78,0x52,
|
||||
0x01,0x62,0x12,0x27,0x0a,0x01,0x63,0x18,0x06,0x20,
|
||||
0x01,0x28,0x0b,0x32,0x19,0x2e,0x77,0x70,0x69,0x2e,
|
||||
0x70,0x72,0x6f,0x74,0x6f,0x2e,0x50,0x72,0x6f,0x74,
|
||||
0x6f,0x62,0x75,0x66,0x4d,0x61,0x74,0x72,0x69,0x78,
|
||||
0x52,0x01,0x63,0x12,0x27,0x0a,0x01,0x64,0x18,0x07,
|
||||
0x20,0x01,0x28,0x0b,0x32,0x19,0x2e,0x77,0x70,0x69,
|
||||
0x2e,0x70,0x72,0x6f,0x74,0x6f,0x2e,0x50,0x72,0x6f,
|
||||
0x74,0x6f,0x62,0x75,0x66,0x4d,0x61,0x74,0x72,0x69,
|
||||
0x78,0x52,0x01,0x64,0x42,0x1a,0x0a,0x18,0x65,0x64,
|
||||
0x75,0x2e,0x77,0x70,0x69,0x2e,0x66,0x69,0x72,0x73,
|
||||
0x74,0x2e,0x6d,0x61,0x74,0x68,0x2e,0x70,0x72,0x6f,
|
||||
0x74,0x6f,0x4a,0xd5,0x03,0x0a,0x06,0x12,0x04,0x00,
|
||||
0x00,0x10,0x01,0x0a,0x08,0x0a,0x01,0x0c,0x12,0x03,
|
||||
0x00,0x00,0x12,0x0a,0x08,0x0a,0x01,0x02,0x12,0x03,
|
||||
0x02,0x00,0x12,0x0a,0x09,0x0a,0x02,0x03,0x00,0x12,
|
||||
0x03,0x04,0x00,0x17,0x0a,0x08,0x0a,0x01,0x08,0x12,
|
||||
0x03,0x06,0x00,0x31,0x0a,0x09,0x0a,0x02,0x08,0x01,
|
||||
0x12,0x03,0x06,0x00,0x31,0x0a,0x0a,0x0a,0x02,0x04,
|
||||
0x00,0x12,0x04,0x08,0x00,0x10,0x01,0x0a,0x0a,0x0a,
|
||||
0x03,0x04,0x00,0x01,0x12,0x03,0x08,0x08,0x1c,0x0a,
|
||||
0x0b,0x0a,0x04,0x04,0x00,0x02,0x00,0x12,0x03,0x09,
|
||||
0x02,0x18,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x00,
|
||||
0x05,0x12,0x03,0x09,0x02,0x08,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x00,0x02,0x00,0x01,0x12,0x03,0x09,0x09,0x13,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x00,0x03,0x12,
|
||||
0x03,0x09,0x16,0x17,0x0a,0x0b,0x0a,0x04,0x04,0x00,
|
||||
0x02,0x01,0x12,0x03,0x0a,0x02,0x18,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x00,0x02,0x01,0x05,0x12,0x03,0x0a,0x02,
|
||||
0x08,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x01,0x01,
|
||||
0x12,0x03,0x0a,0x09,0x13,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x00,0x02,0x01,0x03,0x12,0x03,0x0a,0x16,0x17,0x0a,
|
||||
0x0b,0x0a,0x04,0x04,0x00,0x02,0x02,0x12,0x03,0x0b,
|
||||
0x02,0x19,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x02,
|
||||
0x05,0x12,0x03,0x0b,0x02,0x08,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x00,0x02,0x02,0x01,0x12,0x03,0x0b,0x09,0x14,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x02,0x03,0x12,
|
||||
0x03,0x0b,0x17,0x18,0x0a,0x0b,0x0a,0x04,0x04,0x00,
|
||||
0x02,0x03,0x12,0x03,0x0c,0x02,0x17,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x00,0x02,0x03,0x06,0x12,0x03,0x0c,0x02,
|
||||
0x10,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x03,0x01,
|
||||
0x12,0x03,0x0c,0x11,0x12,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x00,0x02,0x03,0x03,0x12,0x03,0x0c,0x15,0x16,0x0a,
|
||||
0x0b,0x0a,0x04,0x04,0x00,0x02,0x04,0x12,0x03,0x0d,
|
||||
0x02,0x17,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x04,
|
||||
0x06,0x12,0x03,0x0d,0x02,0x10,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x00,0x02,0x04,0x01,0x12,0x03,0x0d,0x11,0x12,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x04,0x03,0x12,
|
||||
0x03,0x0d,0x15,0x16,0x0a,0x0b,0x0a,0x04,0x04,0x00,
|
||||
0x02,0x05,0x12,0x03,0x0e,0x02,0x17,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x00,0x02,0x05,0x06,0x12,0x03,0x0e,0x02,
|
||||
0x10,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x05,0x01,
|
||||
0x12,0x03,0x0e,0x11,0x12,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x00,0x02,0x05,0x03,0x12,0x03,0x0e,0x15,0x16,0x0a,
|
||||
0x0b,0x0a,0x04,0x04,0x00,0x02,0x06,0x12,0x03,0x0f,
|
||||
0x02,0x17,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x06,
|
||||
0x06,0x12,0x03,0x0f,0x02,0x10,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x00,0x02,0x06,0x01,0x12,0x03,0x0f,0x11,0x12,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x06,0x03,0x12,
|
||||
0x03,0x0f,0x15,0x16,0x62,0x06,0x70,0x72,0x6f,0x74,
|
||||
0x6f,0x33,
|
||||
};
|
||||
static const char file_name[] = "system.proto";
|
||||
static const char wpi_proto_ProtobufLinearSystem_name[] = "wpi.proto.ProtobufLinearSystem";
|
||||
std::string_view wpi_proto_ProtobufLinearSystem::msg_name(void) noexcept { return wpi_proto_ProtobufLinearSystem_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufLinearSystem::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufLinearSystem, wpi_proto_ProtobufLinearSystem, AUTO)
|
||||
|
||||
|
||||
|
||||
67
wpimath/src/generated/main/native/cpp/wpimath/protobuf/system.npb.h
generated
Normal file
67
wpimath/src/generated/main/native/cpp/wpimath/protobuf/system.npb.h
generated
Normal file
@@ -0,0 +1,67 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.9 */
|
||||
|
||||
#ifndef PB_WPI_PROTO_SYSTEM_NPB_H_INCLUDED
|
||||
#define PB_WPI_PROTO_SYSTEM_NPB_H_INCLUDED
|
||||
#include <pb.h>
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
#include "wpimath.npb.h"
|
||||
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
/* Struct definitions */
|
||||
typedef struct _wpi_proto_ProtobufLinearSystem {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
uint32_t num_states;
|
||||
uint32_t num_inputs;
|
||||
uint32_t num_outputs;
|
||||
pb_callback_t a;
|
||||
pb_callback_t b;
|
||||
pb_callback_t c;
|
||||
pb_callback_t d;
|
||||
} wpi_proto_ProtobufLinearSystem;
|
||||
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define wpi_proto_ProtobufLinearSystem_init_default {0, 0, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufLinearSystem_init_zero {0, 0, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}}
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define wpi_proto_ProtobufLinearSystem_num_states_tag 1
|
||||
#define wpi_proto_ProtobufLinearSystem_num_inputs_tag 2
|
||||
#define wpi_proto_ProtobufLinearSystem_num_outputs_tag 3
|
||||
#define wpi_proto_ProtobufLinearSystem_a_tag 4
|
||||
#define wpi_proto_ProtobufLinearSystem_b_tag 5
|
||||
#define wpi_proto_ProtobufLinearSystem_c_tag 6
|
||||
#define wpi_proto_ProtobufLinearSystem_d_tag 7
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define wpi_proto_ProtobufLinearSystem_FIELDLIST(X, a_) \
|
||||
X(a_, STATIC, SINGULAR, UINT32, num_states, 1) \
|
||||
X(a_, STATIC, SINGULAR, UINT32, num_inputs, 2) \
|
||||
X(a_, STATIC, SINGULAR, UINT32, num_outputs, 3) \
|
||||
X(a_, CALLBACK, OPTIONAL, MESSAGE, a, 4) \
|
||||
X(a_, CALLBACK, OPTIONAL, MESSAGE, b, 5) \
|
||||
X(a_, CALLBACK, OPTIONAL, MESSAGE, c, 6) \
|
||||
X(a_, CALLBACK, OPTIONAL, MESSAGE, d, 7)
|
||||
#define wpi_proto_ProtobufLinearSystem_CALLBACK pb_default_field_callback
|
||||
#define wpi_proto_ProtobufLinearSystem_DEFAULT NULL
|
||||
#define wpi_proto_ProtobufLinearSystem_a_MSGTYPE wpi_proto_ProtobufMatrix
|
||||
#define wpi_proto_ProtobufLinearSystem_b_MSGTYPE wpi_proto_ProtobufMatrix
|
||||
#define wpi_proto_ProtobufLinearSystem_c_MSGTYPE wpi_proto_ProtobufMatrix
|
||||
#define wpi_proto_ProtobufLinearSystem_d_MSGTYPE wpi_proto_ProtobufMatrix
|
||||
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
/* wpi_proto_ProtobufLinearSystem_size depends on runtime parameters */
|
||||
|
||||
|
||||
#endif
|
||||
118
wpimath/src/generated/main/native/cpp/wpimath/protobuf/trajectory.npb.cpp
generated
Normal file
118
wpimath/src/generated/main/native/cpp/wpimath/protobuf/trajectory.npb.cpp
generated
Normal file
@@ -0,0 +1,118 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.9 */
|
||||
|
||||
#include "trajectory.npb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
static const uint8_t file_descriptor[] {
|
||||
0x0a,0x10,0x74,0x72,0x61,0x6a,0x65,0x63,0x74,0x6f,
|
||||
0x72,0x79,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x12,0x09,
|
||||
0x77,0x70,0x69,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x1a,
|
||||
0x10,0x67,0x65,0x6f,0x6d,0x65,0x74,0x72,0x79,0x32,
|
||||
0x64,0x2e,0x70,0x72,0x6f,0x74,0x6f,0x22,0xba,0x01,
|
||||
0x0a,0x17,0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,
|
||||
0x54,0x72,0x61,0x6a,0x65,0x63,0x74,0x6f,0x72,0x79,
|
||||
0x53,0x74,0x61,0x74,0x65,0x12,0x12,0x0a,0x04,0x74,
|
||||
0x69,0x6d,0x65,0x18,0x01,0x20,0x01,0x28,0x01,0x52,
|
||||
0x04,0x74,0x69,0x6d,0x65,0x12,0x1a,0x0a,0x08,0x76,
|
||||
0x65,0x6c,0x6f,0x63,0x69,0x74,0x79,0x18,0x02,0x20,
|
||||
0x01,0x28,0x01,0x52,0x08,0x76,0x65,0x6c,0x6f,0x63,
|
||||
0x69,0x74,0x79,0x12,0x22,0x0a,0x0c,0x61,0x63,0x63,
|
||||
0x65,0x6c,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e,0x18,
|
||||
0x03,0x20,0x01,0x28,0x01,0x52,0x0c,0x61,0x63,0x63,
|
||||
0x65,0x6c,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e,0x12,
|
||||
0x2d,0x0a,0x04,0x70,0x6f,0x73,0x65,0x18,0x04,0x20,
|
||||
0x01,0x28,0x0b,0x32,0x19,0x2e,0x77,0x70,0x69,0x2e,
|
||||
0x70,0x72,0x6f,0x74,0x6f,0x2e,0x50,0x72,0x6f,0x74,
|
||||
0x6f,0x62,0x75,0x66,0x50,0x6f,0x73,0x65,0x32,0x64,
|
||||
0x52,0x04,0x70,0x6f,0x73,0x65,0x12,0x1c,0x0a,0x09,
|
||||
0x63,0x75,0x72,0x76,0x61,0x74,0x75,0x72,0x65,0x18,
|
||||
0x05,0x20,0x01,0x28,0x01,0x52,0x09,0x63,0x75,0x72,
|
||||
0x76,0x61,0x74,0x75,0x72,0x65,0x22,0x50,0x0a,0x12,
|
||||
0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x54,0x72,
|
||||
0x61,0x6a,0x65,0x63,0x74,0x6f,0x72,0x79,0x12,0x3a,
|
||||
0x0a,0x06,0x73,0x74,0x61,0x74,0x65,0x73,0x18,0x02,
|
||||
0x20,0x03,0x28,0x0b,0x32,0x22,0x2e,0x77,0x70,0x69,
|
||||
0x2e,0x70,0x72,0x6f,0x74,0x6f,0x2e,0x50,0x72,0x6f,
|
||||
0x74,0x6f,0x62,0x75,0x66,0x54,0x72,0x61,0x6a,0x65,
|
||||
0x63,0x74,0x6f,0x72,0x79,0x53,0x74,0x61,0x74,0x65,
|
||||
0x52,0x06,0x73,0x74,0x61,0x74,0x65,0x73,0x42,0x1a,
|
||||
0x0a,0x18,0x65,0x64,0x75,0x2e,0x77,0x70,0x69,0x2e,
|
||||
0x66,0x69,0x72,0x73,0x74,0x2e,0x6d,0x61,0x74,0x68,
|
||||
0x2e,0x70,0x72,0x6f,0x74,0x6f,0x4a,0xc4,0x03,0x0a,
|
||||
0x06,0x12,0x04,0x00,0x00,0x12,0x01,0x0a,0x08,0x0a,
|
||||
0x01,0x0c,0x12,0x03,0x00,0x00,0x12,0x0a,0x08,0x0a,
|
||||
0x01,0x02,0x12,0x03,0x02,0x00,0x12,0x0a,0x09,0x0a,
|
||||
0x02,0x03,0x00,0x12,0x03,0x04,0x00,0x1a,0x0a,0x08,
|
||||
0x0a,0x01,0x08,0x12,0x03,0x06,0x00,0x31,0x0a,0x09,
|
||||
0x0a,0x02,0x08,0x01,0x12,0x03,0x06,0x00,0x31,0x0a,
|
||||
0x0a,0x0a,0x02,0x04,0x00,0x12,0x04,0x08,0x00,0x0e,
|
||||
0x01,0x0a,0x0a,0x0a,0x03,0x04,0x00,0x01,0x12,0x03,
|
||||
0x08,0x08,0x1f,0x0a,0x0b,0x0a,0x04,0x04,0x00,0x02,
|
||||
0x00,0x12,0x03,0x09,0x02,0x12,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x00,0x02,0x00,0x05,0x12,0x03,0x09,0x02,0x08,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x00,0x01,0x12,
|
||||
0x03,0x09,0x09,0x0d,0x0a,0x0c,0x0a,0x05,0x04,0x00,
|
||||
0x02,0x00,0x03,0x12,0x03,0x09,0x10,0x11,0x0a,0x0b,
|
||||
0x0a,0x04,0x04,0x00,0x02,0x01,0x12,0x03,0x0a,0x02,
|
||||
0x16,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x01,0x05,
|
||||
0x12,0x03,0x0a,0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x00,0x02,0x01,0x01,0x12,0x03,0x0a,0x09,0x11,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x00,0x02,0x01,0x03,0x12,0x03,
|
||||
0x0a,0x14,0x15,0x0a,0x0b,0x0a,0x04,0x04,0x00,0x02,
|
||||
0x02,0x12,0x03,0x0b,0x02,0x1a,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x00,0x02,0x02,0x05,0x12,0x03,0x0b,0x02,0x08,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x02,0x01,0x12,
|
||||
0x03,0x0b,0x09,0x15,0x0a,0x0c,0x0a,0x05,0x04,0x00,
|
||||
0x02,0x02,0x03,0x12,0x03,0x0b,0x18,0x19,0x0a,0x0b,
|
||||
0x0a,0x04,0x04,0x00,0x02,0x03,0x12,0x03,0x0c,0x02,
|
||||
0x1a,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x03,0x06,
|
||||
0x12,0x03,0x0c,0x02,0x10,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x00,0x02,0x03,0x01,0x12,0x03,0x0c,0x11,0x15,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x00,0x02,0x03,0x03,0x12,0x03,
|
||||
0x0c,0x18,0x19,0x0a,0x0b,0x0a,0x04,0x04,0x00,0x02,
|
||||
0x04,0x12,0x03,0x0d,0x02,0x17,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x00,0x02,0x04,0x05,0x12,0x03,0x0d,0x02,0x08,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x04,0x01,0x12,
|
||||
0x03,0x0d,0x09,0x12,0x0a,0x0c,0x0a,0x05,0x04,0x00,
|
||||
0x02,0x04,0x03,0x12,0x03,0x0d,0x15,0x16,0x0a,0x0a,
|
||||
0x0a,0x02,0x04,0x01,0x12,0x04,0x10,0x00,0x12,0x01,
|
||||
0x0a,0x0a,0x0a,0x03,0x04,0x01,0x01,0x12,0x03,0x10,
|
||||
0x08,0x1a,0x0a,0x0b,0x0a,0x04,0x04,0x01,0x02,0x00,
|
||||
0x12,0x03,0x11,0x02,0x2e,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x01,0x02,0x00,0x04,0x12,0x03,0x11,0x02,0x0a,0x0a,
|
||||
0x0c,0x0a,0x05,0x04,0x01,0x02,0x00,0x06,0x12,0x03,
|
||||
0x11,0x0b,0x22,0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,
|
||||
0x00,0x01,0x12,0x03,0x11,0x23,0x29,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x01,0x02,0x00,0x03,0x12,0x03,0x11,0x2c,
|
||||
0x2d,0x62,0x06,0x70,0x72,0x6f,0x74,0x6f,0x33,
|
||||
};
|
||||
static const char file_name[] = "trajectory.proto";
|
||||
static const char wpi_proto_ProtobufTrajectoryState_name[] = "wpi.proto.ProtobufTrajectoryState";
|
||||
std::string_view wpi_proto_ProtobufTrajectoryState::msg_name(void) noexcept { return wpi_proto_ProtobufTrajectoryState_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufTrajectoryState::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufTrajectoryState, wpi_proto_ProtobufTrajectoryState, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufTrajectory_name[] = "wpi.proto.ProtobufTrajectory";
|
||||
std::string_view wpi_proto_ProtobufTrajectory::msg_name(void) noexcept { return wpi_proto_ProtobufTrajectory_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufTrajectory::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufTrajectory, wpi_proto_ProtobufTrajectory, AUTO)
|
||||
|
||||
|
||||
|
||||
#ifndef PB_CONVERT_DOUBLE_FLOAT
|
||||
/* On some platforms (such as AVR), double is really float.
|
||||
* To be able to encode/decode double on these platforms, you need.
|
||||
* to define PB_CONVERT_DOUBLE_FLOAT in pb.h or compiler command line.
|
||||
*/
|
||||
PB_STATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES)
|
||||
#endif
|
||||
|
||||
76
wpimath/src/generated/main/native/cpp/wpimath/protobuf/trajectory.npb.h
generated
Normal file
76
wpimath/src/generated/main/native/cpp/wpimath/protobuf/trajectory.npb.h
generated
Normal file
@@ -0,0 +1,76 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.9 */
|
||||
|
||||
#ifndef PB_WPI_PROTO_TRAJECTORY_NPB_H_INCLUDED
|
||||
#define PB_WPI_PROTO_TRAJECTORY_NPB_H_INCLUDED
|
||||
#include <pb.h>
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
#include "geometry2d.npb.h"
|
||||
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
/* Struct definitions */
|
||||
typedef struct _wpi_proto_ProtobufTrajectoryState {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
double time;
|
||||
double velocity;
|
||||
double acceleration;
|
||||
pb_callback_t pose;
|
||||
double curvature;
|
||||
} wpi_proto_ProtobufTrajectoryState;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufTrajectory {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
pb_callback_t states;
|
||||
} wpi_proto_ProtobufTrajectory;
|
||||
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define wpi_proto_ProtobufTrajectoryState_init_default {0, 0, 0, {{NULL}, NULL}, 0}
|
||||
#define wpi_proto_ProtobufTrajectory_init_default {{{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufTrajectoryState_init_zero {0, 0, 0, {{NULL}, NULL}, 0}
|
||||
#define wpi_proto_ProtobufTrajectory_init_zero {{{NULL}, NULL}}
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define wpi_proto_ProtobufTrajectoryState_time_tag 1
|
||||
#define wpi_proto_ProtobufTrajectoryState_velocity_tag 2
|
||||
#define wpi_proto_ProtobufTrajectoryState_acceleration_tag 3
|
||||
#define wpi_proto_ProtobufTrajectoryState_pose_tag 4
|
||||
#define wpi_proto_ProtobufTrajectoryState_curvature_tag 5
|
||||
#define wpi_proto_ProtobufTrajectory_states_tag 2
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define wpi_proto_ProtobufTrajectoryState_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, time, 1) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, velocity, 2) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, acceleration, 3) \
|
||||
X(a, CALLBACK, OPTIONAL, MESSAGE, pose, 4) \
|
||||
X(a, STATIC, SINGULAR, DOUBLE, curvature, 5)
|
||||
#define wpi_proto_ProtobufTrajectoryState_CALLBACK pb_default_field_callback
|
||||
#define wpi_proto_ProtobufTrajectoryState_DEFAULT NULL
|
||||
#define wpi_proto_ProtobufTrajectoryState_pose_MSGTYPE wpi_proto_ProtobufPose2d
|
||||
|
||||
#define wpi_proto_ProtobufTrajectory_FIELDLIST(X, a) \
|
||||
X(a, CALLBACK, REPEATED, MESSAGE, states, 2)
|
||||
#define wpi_proto_ProtobufTrajectory_CALLBACK pb_default_field_callback
|
||||
#define wpi_proto_ProtobufTrajectory_DEFAULT NULL
|
||||
#define wpi_proto_ProtobufTrajectory_states_MSGTYPE wpi_proto_ProtobufTrajectoryState
|
||||
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
/* wpi_proto_ProtobufTrajectoryState_size depends on runtime parameters */
|
||||
/* wpi_proto_ProtobufTrajectory_size depends on runtime parameters */
|
||||
|
||||
|
||||
#endif
|
||||
92
wpimath/src/generated/main/native/cpp/wpimath/protobuf/wpimath.npb.cpp
generated
Normal file
92
wpimath/src/generated/main/native/cpp/wpimath/protobuf/wpimath.npb.cpp
generated
Normal file
@@ -0,0 +1,92 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.9 */
|
||||
|
||||
#include "wpimath.npb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
static const uint8_t file_descriptor[] {
|
||||
0x0a,0x0d,0x77,0x70,0x69,0x6d,0x61,0x74,0x68,0x2e,
|
||||
0x70,0x72,0x6f,0x74,0x6f,0x12,0x09,0x77,0x70,0x69,
|
||||
0x2e,0x70,0x72,0x6f,0x74,0x6f,0x22,0x5a,0x0a,0x0e,
|
||||
0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,0x4d,0x61,
|
||||
0x74,0x72,0x69,0x78,0x12,0x19,0x0a,0x08,0x6e,0x75,
|
||||
0x6d,0x5f,0x72,0x6f,0x77,0x73,0x18,0x01,0x20,0x01,
|
||||
0x28,0x0d,0x52,0x07,0x6e,0x75,0x6d,0x52,0x6f,0x77,
|
||||
0x73,0x12,0x19,0x0a,0x08,0x6e,0x75,0x6d,0x5f,0x63,
|
||||
0x6f,0x6c,0x73,0x18,0x02,0x20,0x01,0x28,0x0d,0x52,
|
||||
0x07,0x6e,0x75,0x6d,0x43,0x6f,0x6c,0x73,0x12,0x12,
|
||||
0x0a,0x04,0x64,0x61,0x74,0x61,0x18,0x03,0x20,0x03,
|
||||
0x28,0x01,0x52,0x04,0x64,0x61,0x74,0x61,0x22,0x24,
|
||||
0x0a,0x0e,0x50,0x72,0x6f,0x74,0x6f,0x62,0x75,0x66,
|
||||
0x56,0x65,0x63,0x74,0x6f,0x72,0x12,0x12,0x0a,0x04,
|
||||
0x72,0x6f,0x77,0x73,0x18,0x01,0x20,0x03,0x28,0x01,
|
||||
0x52,0x04,0x72,0x6f,0x77,0x73,0x42,0x1a,0x0a,0x18,
|
||||
0x65,0x64,0x75,0x2e,0x77,0x70,0x69,0x2e,0x66,0x69,
|
||||
0x72,0x73,0x74,0x2e,0x6d,0x61,0x74,0x68,0x2e,0x70,
|
||||
0x72,0x6f,0x74,0x6f,0x4a,0xd9,0x02,0x0a,0x06,0x12,
|
||||
0x04,0x00,0x00,0x0e,0x01,0x0a,0x08,0x0a,0x01,0x0c,
|
||||
0x12,0x03,0x00,0x00,0x12,0x0a,0x08,0x0a,0x01,0x02,
|
||||
0x12,0x03,0x02,0x00,0x12,0x0a,0x08,0x0a,0x01,0x08,
|
||||
0x12,0x03,0x04,0x00,0x31,0x0a,0x09,0x0a,0x02,0x08,
|
||||
0x01,0x12,0x03,0x04,0x00,0x31,0x0a,0x0a,0x0a,0x02,
|
||||
0x04,0x00,0x12,0x04,0x06,0x00,0x0a,0x01,0x0a,0x0a,
|
||||
0x0a,0x03,0x04,0x00,0x01,0x12,0x03,0x06,0x08,0x16,
|
||||
0x0a,0x0b,0x0a,0x04,0x04,0x00,0x02,0x00,0x12,0x03,
|
||||
0x07,0x02,0x16,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,
|
||||
0x00,0x05,0x12,0x03,0x07,0x02,0x08,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x00,0x02,0x00,0x01,0x12,0x03,0x07,0x09,
|
||||
0x11,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x00,0x03,
|
||||
0x12,0x03,0x07,0x14,0x15,0x0a,0x0b,0x0a,0x04,0x04,
|
||||
0x00,0x02,0x01,0x12,0x03,0x08,0x02,0x16,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x00,0x02,0x01,0x05,0x12,0x03,0x08,
|
||||
0x02,0x08,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x01,
|
||||
0x01,0x12,0x03,0x08,0x09,0x11,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x00,0x02,0x01,0x03,0x12,0x03,0x08,0x14,0x15,
|
||||
0x0a,0x0b,0x0a,0x04,0x04,0x00,0x02,0x02,0x12,0x03,
|
||||
0x09,0x02,0x1b,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,
|
||||
0x02,0x04,0x12,0x03,0x09,0x02,0x0a,0x0a,0x0c,0x0a,
|
||||
0x05,0x04,0x00,0x02,0x02,0x05,0x12,0x03,0x09,0x0b,
|
||||
0x11,0x0a,0x0c,0x0a,0x05,0x04,0x00,0x02,0x02,0x01,
|
||||
0x12,0x03,0x09,0x12,0x16,0x0a,0x0c,0x0a,0x05,0x04,
|
||||
0x00,0x02,0x02,0x03,0x12,0x03,0x09,0x19,0x1a,0x0a,
|
||||
0x0a,0x0a,0x02,0x04,0x01,0x12,0x04,0x0c,0x00,0x0e,
|
||||
0x01,0x0a,0x0a,0x0a,0x03,0x04,0x01,0x01,0x12,0x03,
|
||||
0x0c,0x08,0x16,0x0a,0x0b,0x0a,0x04,0x04,0x01,0x02,
|
||||
0x00,0x12,0x03,0x0d,0x02,0x1b,0x0a,0x0c,0x0a,0x05,
|
||||
0x04,0x01,0x02,0x00,0x04,0x12,0x03,0x0d,0x02,0x0a,
|
||||
0x0a,0x0c,0x0a,0x05,0x04,0x01,0x02,0x00,0x05,0x12,
|
||||
0x03,0x0d,0x0b,0x11,0x0a,0x0c,0x0a,0x05,0x04,0x01,
|
||||
0x02,0x00,0x01,0x12,0x03,0x0d,0x12,0x16,0x0a,0x0c,
|
||||
0x0a,0x05,0x04,0x01,0x02,0x00,0x03,0x12,0x03,0x0d,
|
||||
0x19,0x1a,0x62,0x06,0x70,0x72,0x6f,0x74,0x6f,0x33,
|
||||
|
||||
};
|
||||
static const char file_name[] = "wpimath.proto";
|
||||
static const char wpi_proto_ProtobufMatrix_name[] = "wpi.proto.ProtobufMatrix";
|
||||
std::string_view wpi_proto_ProtobufMatrix::msg_name(void) noexcept { return wpi_proto_ProtobufMatrix_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufMatrix::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufMatrix, wpi_proto_ProtobufMatrix, AUTO)
|
||||
|
||||
|
||||
static const char wpi_proto_ProtobufVector_name[] = "wpi.proto.ProtobufVector";
|
||||
std::string_view wpi_proto_ProtobufVector::msg_name(void) noexcept { return wpi_proto_ProtobufVector_name; }
|
||||
pb_filedesc_t wpi_proto_ProtobufVector::file_descriptor(void) noexcept { return {::file_name, ::file_descriptor}; }
|
||||
PB_BIND(wpi_proto_ProtobufVector, wpi_proto_ProtobufVector, AUTO)
|
||||
|
||||
|
||||
|
||||
#ifndef PB_CONVERT_DOUBLE_FLOAT
|
||||
/* On some platforms (such as AVR), double is really float.
|
||||
* To be able to encode/decode double on these platforms, you need.
|
||||
* to define PB_CONVERT_DOUBLE_FLOAT in pb.h or compiler command line.
|
||||
*/
|
||||
PB_STATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES)
|
||||
#endif
|
||||
|
||||
67
wpimath/src/generated/main/native/cpp/wpimath/protobuf/wpimath.npb.h
generated
Normal file
67
wpimath/src/generated/main/native/cpp/wpimath/protobuf/wpimath.npb.h
generated
Normal file
@@ -0,0 +1,67 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.9 */
|
||||
|
||||
#ifndef PB_WPI_PROTO_WPIMATH_NPB_H_INCLUDED
|
||||
#define PB_WPI_PROTO_WPIMATH_NPB_H_INCLUDED
|
||||
#include <pb.h>
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
/* Struct definitions */
|
||||
typedef struct _wpi_proto_ProtobufMatrix {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
uint32_t num_rows;
|
||||
uint32_t num_cols;
|
||||
pb_callback_t data;
|
||||
} wpi_proto_ProtobufMatrix;
|
||||
|
||||
typedef struct _wpi_proto_ProtobufVector {
|
||||
static const pb_msgdesc_t* msg_descriptor(void) noexcept;
|
||||
static std::string_view msg_name(void) noexcept;
|
||||
static pb_filedesc_t file_descriptor(void) noexcept;
|
||||
|
||||
pb_callback_t rows;
|
||||
} wpi_proto_ProtobufVector;
|
||||
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define wpi_proto_ProtobufMatrix_init_default {0, 0, {{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufVector_init_default {{{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufMatrix_init_zero {0, 0, {{NULL}, NULL}}
|
||||
#define wpi_proto_ProtobufVector_init_zero {{{NULL}, NULL}}
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define wpi_proto_ProtobufMatrix_num_rows_tag 1
|
||||
#define wpi_proto_ProtobufMatrix_num_cols_tag 2
|
||||
#define wpi_proto_ProtobufMatrix_data_tag 3
|
||||
#define wpi_proto_ProtobufVector_rows_tag 1
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define wpi_proto_ProtobufMatrix_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UINT32, num_rows, 1) \
|
||||
X(a, STATIC, SINGULAR, UINT32, num_cols, 2) \
|
||||
X(a, CALLBACK, REPEATED, DOUBLE, data, 3)
|
||||
#define wpi_proto_ProtobufMatrix_CALLBACK pb_default_field_callback
|
||||
#define wpi_proto_ProtobufMatrix_DEFAULT NULL
|
||||
|
||||
#define wpi_proto_ProtobufVector_FIELDLIST(X, a) \
|
||||
X(a, CALLBACK, REPEATED, DOUBLE, rows, 1)
|
||||
#define wpi_proto_ProtobufVector_CALLBACK pb_default_field_callback
|
||||
#define wpi_proto_ProtobufVector_DEFAULT NULL
|
||||
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
/* wpi_proto_ProtobufMatrix_size depends on runtime parameters */
|
||||
/* wpi_proto_ProtobufVector_size depends on runtime parameters */
|
||||
|
||||
|
||||
#endif
|
||||
@@ -4,31 +4,33 @@
|
||||
|
||||
#include "frc/controller/proto/ArmFeedforwardProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <optional>
|
||||
|
||||
#include "controller.pb.h"
|
||||
#include "wpimath/protobuf/controller.npb.h"
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::ArmFeedforward>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufArmFeedforward>(arena);
|
||||
}
|
||||
std::optional<frc::ArmFeedforward> wpi::Protobuf<frc::ArmFeedforward>::Unpack(
|
||||
InputStream& stream) {
|
||||
wpi_proto_ProtobufArmFeedforward msg;
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
frc::ArmFeedforward wpi::Protobuf<frc::ArmFeedforward>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufArmFeedforward*>(&msg);
|
||||
return frc::ArmFeedforward{
|
||||
units::volt_t{m->ks()},
|
||||
units::volt_t{m->kg()},
|
||||
units::unit_t<frc::ArmFeedforward::kv_unit>{m->kv()},
|
||||
units::unit_t<frc::ArmFeedforward::ka_unit>{m->ka()},
|
||||
units::volt_t{msg.ks},
|
||||
units::volt_t{msg.kg},
|
||||
units::unit_t<frc::ArmFeedforward::kv_unit>{msg.kv},
|
||||
units::unit_t<frc::ArmFeedforward::ka_unit>{msg.ka},
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::ArmFeedforward>::Pack(
|
||||
google::protobuf::Message* msg, const frc::ArmFeedforward& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufArmFeedforward*>(msg);
|
||||
m->set_ks(value.GetKs().value());
|
||||
m->set_kg(value.GetKg().value());
|
||||
m->set_kv(value.GetKv().value());
|
||||
m->set_ka(value.GetKa().value());
|
||||
bool wpi::Protobuf<frc::ArmFeedforward>::Pack(
|
||||
OutputStream& stream, const frc::ArmFeedforward& value) {
|
||||
wpi_proto_ProtobufArmFeedforward msg{
|
||||
.ks = value.GetKs().value(),
|
||||
.kg = value.GetKg().value(),
|
||||
.kv = value.GetKv().value(),
|
||||
.ka = value.GetKa().value(),
|
||||
.dt = 0,
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,33 +4,30 @@
|
||||
|
||||
#include "frc/controller/proto/DifferentialDriveFeedforwardProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include "wpimath/protobuf/controller.npb.h"
|
||||
|
||||
#include "controller.pb.h"
|
||||
std::optional<frc::DifferentialDriveFeedforward>
|
||||
wpi::Protobuf<frc::DifferentialDriveFeedforward>::Unpack(InputStream& stream) {
|
||||
wpi_proto_ProtobufDifferentialDriveFeedforward msg;
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<
|
||||
frc::DifferentialDriveFeedforward>::New(google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufDifferentialDriveFeedforward>(
|
||||
arena);
|
||||
return frc::DifferentialDriveFeedforward{
|
||||
decltype(1_V / 1_mps){msg.kv_linear},
|
||||
decltype(1_V / 1_mps_sq){msg.ka_linear},
|
||||
decltype(1_V / 1_mps){msg.kv_angular},
|
||||
decltype(1_V / 1_mps_sq){msg.ka_angular},
|
||||
};
|
||||
}
|
||||
|
||||
frc::DifferentialDriveFeedforward
|
||||
wpi::Protobuf<frc::DifferentialDriveFeedforward>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufDifferentialDriveFeedforward*>(
|
||||
&msg);
|
||||
return {decltype(1_V / 1_mps){m->kv_linear()},
|
||||
decltype(1_V / 1_mps_sq){m->ka_linear()},
|
||||
decltype(1_V / 1_mps){m->kv_angular()},
|
||||
decltype(1_V / 1_mps_sq){m->ka_angular()}};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::DifferentialDriveFeedforward>::Pack(
|
||||
google::protobuf::Message* msg,
|
||||
const frc::DifferentialDriveFeedforward& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufDifferentialDriveFeedforward*>(msg);
|
||||
m->set_kv_linear(value.m_kVLinear.value());
|
||||
m->set_ka_linear(value.m_kALinear.value());
|
||||
m->set_kv_angular(value.m_kVAngular.value());
|
||||
m->set_ka_angular(value.m_kAAngular.value());
|
||||
bool wpi::Protobuf<frc::DifferentialDriveFeedforward>::Pack(
|
||||
OutputStream& stream, const frc::DifferentialDriveFeedforward& value) {
|
||||
wpi_proto_ProtobufDifferentialDriveFeedforward msg{
|
||||
.kv_linear = value.m_kVLinear.value(),
|
||||
.ka_linear = value.m_kALinear.value(),
|
||||
.kv_angular = value.m_kVAngular.value(),
|
||||
.ka_angular = value.m_kAAngular.value(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,33 +4,28 @@
|
||||
|
||||
#include "frc/controller/proto/DifferentialDriveWheelVoltagesProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <optional>
|
||||
|
||||
#include "controller.pb.h"
|
||||
#include "wpimath/protobuf/controller.npb.h"
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<
|
||||
frc::DifferentialDriveWheelVoltages>::New(google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufDifferentialDriveWheelVoltages>(
|
||||
arena);
|
||||
}
|
||||
std::optional<frc::DifferentialDriveWheelVoltages> wpi::Protobuf<
|
||||
frc::DifferentialDriveWheelVoltages>::Unpack(InputStream& stream) {
|
||||
wpi_proto_ProtobufDifferentialDriveWheelVoltages msg;
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
frc::DifferentialDriveWheelVoltages
|
||||
wpi::Protobuf<frc::DifferentialDriveWheelVoltages>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m =
|
||||
static_cast<const wpi::proto::ProtobufDifferentialDriveWheelVoltages*>(
|
||||
&msg);
|
||||
return frc::DifferentialDriveWheelVoltages{
|
||||
units::volt_t{m->left()},
|
||||
units::volt_t{m->right()},
|
||||
units::volt_t{msg.left},
|
||||
units::volt_t{msg.right},
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::DifferentialDriveWheelVoltages>::Pack(
|
||||
google::protobuf::Message* msg,
|
||||
const frc::DifferentialDriveWheelVoltages& value) {
|
||||
auto m =
|
||||
static_cast<wpi::proto::ProtobufDifferentialDriveWheelVoltages*>(msg);
|
||||
m->set_left(value.left.value());
|
||||
m->set_right(value.right.value());
|
||||
bool wpi::Protobuf<frc::DifferentialDriveWheelVoltages>::Pack(
|
||||
OutputStream& stream, const frc::DifferentialDriveWheelVoltages& value) {
|
||||
wpi_proto_ProtobufDifferentialDriveWheelVoltages msg{
|
||||
.left = value.left.value(),
|
||||
.right = value.right.value(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,31 +4,33 @@
|
||||
|
||||
#include "frc/controller/proto/ElevatorFeedforwardProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <optional>
|
||||
|
||||
#include "controller.pb.h"
|
||||
#include "wpimath/protobuf/controller.npb.h"
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::ElevatorFeedforward>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufElevatorFeedforward>(arena);
|
||||
}
|
||||
std::optional<frc::ElevatorFeedforward>
|
||||
wpi::Protobuf<frc::ElevatorFeedforward>::Unpack(InputStream& stream) {
|
||||
wpi_proto_ProtobufElevatorFeedforward msg;
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
frc::ElevatorFeedforward wpi::Protobuf<frc::ElevatorFeedforward>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufElevatorFeedforward*>(&msg);
|
||||
return frc::ElevatorFeedforward{
|
||||
units::volt_t{m->ks()},
|
||||
units::volt_t{m->kg()},
|
||||
units::unit_t<frc::ElevatorFeedforward::kv_unit>{m->kv()},
|
||||
units::unit_t<frc::ElevatorFeedforward::ka_unit>{m->ka()},
|
||||
units::volt_t{msg.ks},
|
||||
units::volt_t{msg.kg},
|
||||
units::unit_t<frc::ElevatorFeedforward::kv_unit>{msg.kv},
|
||||
units::unit_t<frc::ElevatorFeedforward::ka_unit>{msg.ka},
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::ElevatorFeedforward>::Pack(
|
||||
google::protobuf::Message* msg, const frc::ElevatorFeedforward& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufElevatorFeedforward*>(msg);
|
||||
m->set_ks(value.GetKs().value());
|
||||
m->set_kg(value.GetKg().value());
|
||||
m->set_kv(value.GetKv().value());
|
||||
m->set_ka(value.GetKa().value());
|
||||
bool wpi::Protobuf<frc::ElevatorFeedforward>::Pack(
|
||||
OutputStream& stream, const frc::ElevatorFeedforward& value) {
|
||||
wpi_proto_ProtobufElevatorFeedforward msg{
|
||||
.ks = value.GetKs().value(),
|
||||
.kg = value.GetKg().value(),
|
||||
.kv = value.GetKv().value(),
|
||||
.ka = value.GetKa().value(),
|
||||
.dt = 0,
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,29 +4,42 @@
|
||||
|
||||
#include "frc/geometry/proto/Ellipse2dProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <wpi/protobuf/ProtobufCallbacks.h>
|
||||
|
||||
#include "geometry2d.pb.h"
|
||||
#include "wpimath/protobuf/geometry2d.npb.h"
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::Ellipse2d>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufEllipse2d>(arena);
|
||||
}
|
||||
std::optional<frc::Ellipse2d> wpi::Protobuf<frc::Ellipse2d>::Unpack(
|
||||
InputStream& stream) {
|
||||
wpi::UnpackCallback<frc::Pose2d> pose;
|
||||
wpi_proto_ProtobufEllipse2d msg{
|
||||
.center = pose.Callback(),
|
||||
.xSemiAxis = 0,
|
||||
.ySemiAxis = 0,
|
||||
};
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
auto ipose = pose.Items();
|
||||
|
||||
if (ipose.empty()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
frc::Ellipse2d wpi::Protobuf<frc::Ellipse2d>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufEllipse2d*>(&msg);
|
||||
return frc::Ellipse2d{
|
||||
wpi::UnpackProtobuf<frc::Pose2d>(m->wpi_center()),
|
||||
units::meter_t{m->xsemiaxis()},
|
||||
units::meter_t{m->ysemiaxis()},
|
||||
ipose[0],
|
||||
units::meter_t{msg.xSemiAxis},
|
||||
units::meter_t{msg.ySemiAxis},
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::Ellipse2d>::Pack(google::protobuf::Message* msg,
|
||||
bool wpi::Protobuf<frc::Ellipse2d>::Pack(OutputStream& stream,
|
||||
const frc::Ellipse2d& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufEllipse2d*>(msg);
|
||||
wpi::PackProtobuf(m->mutable_center(), value.Center());
|
||||
m->set_xsemiaxis(value.XSemiAxis().value());
|
||||
m->set_ysemiaxis(value.YSemiAxis().value());
|
||||
wpi::PackCallback pose{&value.Center()};
|
||||
wpi_proto_ProtobufEllipse2d msg{
|
||||
.center = pose.Callback(),
|
||||
.xSemiAxis = value.XSemiAxis().value(),
|
||||
.ySemiAxis = value.YSemiAxis().value(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,27 +4,42 @@
|
||||
|
||||
#include "frc/geometry/proto/Pose2dProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <wpi/protobuf/ProtobufCallbacks.h>
|
||||
|
||||
#include "geometry2d.pb.h"
|
||||
#include "wpimath/protobuf/geometry2d.npb.h"
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::Pose2d>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufPose2d>(arena);
|
||||
}
|
||||
std::optional<frc::Pose2d> wpi::Protobuf<frc::Pose2d>::Unpack(
|
||||
InputStream& stream) {
|
||||
wpi::UnpackCallback<frc::Translation2d> tsln;
|
||||
wpi::UnpackCallback<frc::Rotation2d> rot;
|
||||
wpi_proto_ProtobufPose2d msg{
|
||||
.translation = tsln.Callback(),
|
||||
.rotation = rot.Callback(),
|
||||
};
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
auto itsln = tsln.Items();
|
||||
auto irot = rot.Items();
|
||||
|
||||
if (itsln.empty() || irot.empty()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
frc::Pose2d wpi::Protobuf<frc::Pose2d>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufPose2d*>(&msg);
|
||||
return frc::Pose2d{
|
||||
wpi::UnpackProtobuf<frc::Translation2d>(m->wpi_translation()),
|
||||
wpi::UnpackProtobuf<frc::Rotation2d>(m->wpi_rotation()),
|
||||
itsln[0],
|
||||
irot[0],
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::Pose2d>::Pack(google::protobuf::Message* msg,
|
||||
bool wpi::Protobuf<frc::Pose2d>::Pack(OutputStream& stream,
|
||||
const frc::Pose2d& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufPose2d*>(msg);
|
||||
wpi::PackProtobuf(m->mutable_translation(), value.Translation());
|
||||
wpi::PackProtobuf(m->mutable_rotation(), value.Rotation());
|
||||
wpi::PackCallback tsln{&value.Translation()};
|
||||
wpi::PackCallback rot{&value.Rotation()};
|
||||
wpi_proto_ProtobufPose2d msg{
|
||||
.translation = tsln.Callback(),
|
||||
.rotation = rot.Callback(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,27 +4,44 @@
|
||||
|
||||
#include "frc/geometry/proto/Pose3dProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
#include <wpi/protobuf/ProtobufCallbacks.h>
|
||||
|
||||
#include "geometry3d.pb.h"
|
||||
#include "frc/geometry/Pose3d.h"
|
||||
#include "wpimath/protobuf/geometry3d.npb.h"
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::Pose3d>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufPose3d>(arena);
|
||||
}
|
||||
std::optional<frc::Pose3d> wpi::Protobuf<frc::Pose3d>::Unpack(
|
||||
InputStream& stream) {
|
||||
wpi::UnpackCallback<frc::Translation3d> tsln;
|
||||
wpi::UnpackCallback<frc::Rotation3d> rot;
|
||||
wpi_proto_ProtobufPose3d msg{
|
||||
.translation = tsln.Callback(),
|
||||
.rotation = rot.Callback(),
|
||||
};
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
auto itsln = tsln.Items();
|
||||
auto irot = rot.Items();
|
||||
|
||||
if (itsln.empty() || irot.empty()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
frc::Pose3d wpi::Protobuf<frc::Pose3d>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufPose3d*>(&msg);
|
||||
return frc::Pose3d{
|
||||
wpi::UnpackProtobuf<frc::Translation3d>(m->wpi_translation()),
|
||||
wpi::UnpackProtobuf<frc::Rotation3d>(m->wpi_rotation()),
|
||||
itsln[0],
|
||||
irot[0],
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::Pose3d>::Pack(google::protobuf::Message* msg,
|
||||
bool wpi::Protobuf<frc::Pose3d>::Pack(OutputStream& stream,
|
||||
const frc::Pose3d& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufPose3d*>(msg);
|
||||
wpi::PackProtobuf(m->mutable_translation(), value.Translation());
|
||||
wpi::PackProtobuf(m->mutable_rotation(), value.Rotation());
|
||||
wpi::PackCallback tsln{&value.Translation()};
|
||||
wpi::PackCallback rot{&value.Rotation()};
|
||||
wpi_proto_ProtobufPose3d msg{
|
||||
.translation = tsln.Callback(),
|
||||
.rotation = rot.Callback(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,31 +4,30 @@
|
||||
|
||||
#include "frc/geometry/proto/QuaternionProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include "wpimath/protobuf/geometry3d.npb.h"
|
||||
|
||||
#include "geometry3d.pb.h"
|
||||
std::optional<frc::Quaternion> wpi::Protobuf<frc::Quaternion>::Unpack(
|
||||
InputStream& stream) {
|
||||
wpi_proto_ProtobufQuaternion msg;
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::Quaternion>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufQuaternion>(arena);
|
||||
}
|
||||
|
||||
frc::Quaternion wpi::Protobuf<frc::Quaternion>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufQuaternion*>(&msg);
|
||||
return frc::Quaternion{
|
||||
m->w(),
|
||||
m->x(),
|
||||
m->y(),
|
||||
m->z(),
|
||||
msg.w,
|
||||
msg.x,
|
||||
msg.y,
|
||||
msg.z,
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::Quaternion>::Pack(google::protobuf::Message* msg,
|
||||
bool wpi::Protobuf<frc::Quaternion>::Pack(OutputStream& stream,
|
||||
const frc::Quaternion& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufQuaternion*>(msg);
|
||||
m->set_w(value.W());
|
||||
m->set_x(value.X());
|
||||
m->set_y(value.Y());
|
||||
m->set_z(value.Z());
|
||||
wpi_proto_ProtobufQuaternion msg{
|
||||
.w = value.W(),
|
||||
.x = value.X(),
|
||||
.y = value.Y(),
|
||||
.z = value.Z(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,29 +4,42 @@
|
||||
|
||||
#include "frc/geometry/proto/Rectangle2dProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <wpi/protobuf/ProtobufCallbacks.h>
|
||||
|
||||
#include "geometry2d.pb.h"
|
||||
#include "wpimath/protobuf/geometry2d.npb.h"
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::Rectangle2d>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufRectangle2d>(arena);
|
||||
}
|
||||
std::optional<frc::Rectangle2d> wpi::Protobuf<frc::Rectangle2d>::Unpack(
|
||||
InputStream& stream) {
|
||||
wpi::UnpackCallback<frc::Pose2d> pose;
|
||||
wpi_proto_ProtobufRectangle2d msg{
|
||||
.center = pose.Callback(),
|
||||
.xWidth = 0,
|
||||
.yWidth = 0,
|
||||
};
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
auto ipose = pose.Items();
|
||||
|
||||
if (ipose.empty()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
frc::Rectangle2d wpi::Protobuf<frc::Rectangle2d>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufRectangle2d*>(&msg);
|
||||
return frc::Rectangle2d{
|
||||
wpi::UnpackProtobuf<frc::Pose2d>(m->wpi_center()),
|
||||
units::meter_t{m->xwidth()},
|
||||
units::meter_t{m->ywidth()},
|
||||
ipose[0],
|
||||
units::meter_t{msg.xWidth},
|
||||
units::meter_t{msg.yWidth},
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::Rectangle2d>::Pack(google::protobuf::Message* msg,
|
||||
bool wpi::Protobuf<frc::Rectangle2d>::Pack(OutputStream& stream,
|
||||
const frc::Rectangle2d& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufRectangle2d*>(msg);
|
||||
wpi::PackProtobuf(m->mutable_center(), value.Center());
|
||||
m->set_xwidth(value.XWidth().value());
|
||||
m->set_ywidth(value.YWidth().value());
|
||||
wpi::PackCallback pose{&value.Center()};
|
||||
wpi_proto_ProtobufRectangle2d msg{
|
||||
.center = pose.Callback(),
|
||||
.xWidth = value.XWidth().value(),
|
||||
.yWidth = value.YWidth().value(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,25 +4,24 @@
|
||||
|
||||
#include "frc/geometry/proto/Rotation2dProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include "wpimath/protobuf/geometry2d.npb.h"
|
||||
|
||||
#include "geometry2d.pb.h"
|
||||
std::optional<frc::Rotation2d> wpi::Protobuf<frc::Rotation2d>::Unpack(
|
||||
InputStream& stream) {
|
||||
wpi_proto_ProtobufRotation2d msg;
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::Rotation2d>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufRotation2d>(arena);
|
||||
}
|
||||
|
||||
frc::Rotation2d wpi::Protobuf<frc::Rotation2d>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufRotation2d*>(&msg);
|
||||
return frc::Rotation2d{
|
||||
units::radian_t{m->value()},
|
||||
units::radian_t{msg.value},
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::Rotation2d>::Pack(google::protobuf::Message* msg,
|
||||
bool wpi::Protobuf<frc::Rotation2d>::Pack(OutputStream& stream,
|
||||
const frc::Rotation2d& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufRotation2d*>(msg);
|
||||
m->set_value(value.Radians().value());
|
||||
wpi_proto_ProtobufRotation2d msg{
|
||||
.value = value.Radians().value(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,25 +4,36 @@
|
||||
|
||||
#include "frc/geometry/proto/Rotation3dProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <wpi/protobuf/ProtobufCallbacks.h>
|
||||
|
||||
#include "geometry3d.pb.h"
|
||||
#include "wpimath/protobuf/geometry3d.npb.h"
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::Rotation3d>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufRotation3d>(arena);
|
||||
}
|
||||
std::optional<frc::Rotation3d> wpi::Protobuf<frc::Rotation3d>::Unpack(
|
||||
InputStream& stream) {
|
||||
wpi::UnpackCallback<frc::Quaternion> quat;
|
||||
wpi_proto_ProtobufRotation3d msg{
|
||||
.q = quat.Callback(),
|
||||
};
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
auto iquat = quat.Items();
|
||||
|
||||
if (iquat.empty()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
frc::Rotation3d wpi::Protobuf<frc::Rotation3d>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufRotation3d*>(&msg);
|
||||
return frc::Rotation3d{
|
||||
wpi::UnpackProtobuf<frc::Quaternion>(m->wpi_q()),
|
||||
iquat[0],
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::Rotation3d>::Pack(google::protobuf::Message* msg,
|
||||
bool wpi::Protobuf<frc::Rotation3d>::Pack(OutputStream& stream,
|
||||
const frc::Rotation3d& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufRotation3d*>(msg);
|
||||
wpi::PackProtobuf(m->mutable_q(), value.GetQuaternion());
|
||||
wpi::PackCallback quat{&value.GetQuaternion()};
|
||||
wpi_proto_ProtobufRotation3d msg{
|
||||
.q = quat.Callback(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,27 +4,42 @@
|
||||
|
||||
#include "frc/geometry/proto/Transform2dProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <wpi/protobuf/ProtobufCallbacks.h>
|
||||
|
||||
#include "geometry2d.pb.h"
|
||||
#include "wpimath/protobuf/geometry2d.npb.h"
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::Transform2d>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufTransform2d>(arena);
|
||||
}
|
||||
std::optional<frc::Transform2d> wpi::Protobuf<frc::Transform2d>::Unpack(
|
||||
InputStream& stream) {
|
||||
wpi::UnpackCallback<frc::Translation2d> tsln;
|
||||
wpi::UnpackCallback<frc::Rotation2d> rot;
|
||||
wpi_proto_ProtobufTransform2d msg{
|
||||
.translation = tsln.Callback(),
|
||||
.rotation = rot.Callback(),
|
||||
};
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
auto itsln = tsln.Items();
|
||||
auto irot = rot.Items();
|
||||
|
||||
if (itsln.empty() || irot.empty()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
frc::Transform2d wpi::Protobuf<frc::Transform2d>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufTransform2d*>(&msg);
|
||||
return frc::Transform2d{
|
||||
wpi::UnpackProtobuf<frc::Translation2d>(m->wpi_translation()),
|
||||
wpi::UnpackProtobuf<frc::Rotation2d>(m->wpi_rotation()),
|
||||
itsln[0],
|
||||
irot[0],
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::Transform2d>::Pack(google::protobuf::Message* msg,
|
||||
bool wpi::Protobuf<frc::Transform2d>::Pack(OutputStream& stream,
|
||||
const frc::Transform2d& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufTransform2d*>(msg);
|
||||
wpi::PackProtobuf(m->mutable_translation(), value.Translation());
|
||||
wpi::PackProtobuf(m->mutable_rotation(), value.Rotation());
|
||||
wpi::PackCallback tsln{&value.Translation()};
|
||||
wpi::PackCallback rot{&value.Rotation()};
|
||||
wpi_proto_ProtobufTransform2d msg{
|
||||
.translation = tsln.Callback(),
|
||||
.rotation = rot.Callback(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,27 +4,42 @@
|
||||
|
||||
#include "frc/geometry/proto/Transform3dProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <wpi/protobuf/ProtobufCallbacks.h>
|
||||
|
||||
#include "geometry3d.pb.h"
|
||||
#include "wpimath/protobuf/geometry3d.npb.h"
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::Transform3d>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufTransform3d>(arena);
|
||||
}
|
||||
std::optional<frc::Transform3d> wpi::Protobuf<frc::Transform3d>::Unpack(
|
||||
InputStream& stream) {
|
||||
wpi::UnpackCallback<frc::Translation3d> tsln;
|
||||
wpi::UnpackCallback<frc::Rotation3d> rot;
|
||||
wpi_proto_ProtobufTransform3d msg{
|
||||
.translation = tsln.Callback(),
|
||||
.rotation = rot.Callback(),
|
||||
};
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
auto itsln = tsln.Items();
|
||||
auto irot = rot.Items();
|
||||
|
||||
if (itsln.empty() || irot.empty()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
frc::Transform3d wpi::Protobuf<frc::Transform3d>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufTransform3d*>(&msg);
|
||||
return frc::Transform3d{
|
||||
wpi::UnpackProtobuf<frc::Translation3d>(m->wpi_translation()),
|
||||
wpi::UnpackProtobuf<frc::Rotation3d>(m->wpi_rotation()),
|
||||
itsln[0],
|
||||
irot[0],
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::Transform3d>::Pack(google::protobuf::Message* msg,
|
||||
bool wpi::Protobuf<frc::Transform3d>::Pack(OutputStream& stream,
|
||||
const frc::Transform3d& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufTransform3d*>(msg);
|
||||
wpi::PackProtobuf(m->mutable_translation(), value.Translation());
|
||||
wpi::PackProtobuf(m->mutable_rotation(), value.Rotation());
|
||||
wpi::PackCallback tsln{&value.Translation()};
|
||||
wpi::PackCallback rot{&value.Rotation()};
|
||||
wpi_proto_ProtobufTransform3d msg{
|
||||
.translation = tsln.Callback(),
|
||||
.rotation = rot.Callback(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,27 +4,26 @@
|
||||
|
||||
#include "frc/geometry/proto/Translation2dProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include "wpimath/protobuf/geometry2d.npb.h"
|
||||
|
||||
#include "geometry2d.pb.h"
|
||||
std::optional<frc::Translation2d> wpi::Protobuf<frc::Translation2d>::Unpack(
|
||||
InputStream& stream) {
|
||||
wpi_proto_ProtobufTranslation2d msg;
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::Translation2d>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufTranslation2d>(arena);
|
||||
}
|
||||
|
||||
frc::Translation2d wpi::Protobuf<frc::Translation2d>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufTranslation2d*>(&msg);
|
||||
return frc::Translation2d{
|
||||
units::meter_t{m->x()},
|
||||
units::meter_t{m->y()},
|
||||
units::meter_t{msg.x},
|
||||
units::meter_t{msg.y},
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::Translation2d>::Pack(google::protobuf::Message* msg,
|
||||
bool wpi::Protobuf<frc::Translation2d>::Pack(OutputStream& stream,
|
||||
const frc::Translation2d& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufTranslation2d*>(msg);
|
||||
m->set_x(value.X().value());
|
||||
m->set_y(value.Y().value());
|
||||
wpi_proto_ProtobufTranslation2d msg{
|
||||
.x = value.X().value(),
|
||||
.y = value.Y().value(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,29 +4,28 @@
|
||||
|
||||
#include "frc/geometry/proto/Translation3dProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include "wpimath/protobuf/geometry3d.npb.h"
|
||||
|
||||
#include "geometry3d.pb.h"
|
||||
std::optional<frc::Translation3d> wpi::Protobuf<frc::Translation3d>::Unpack(
|
||||
InputStream& stream) {
|
||||
wpi_proto_ProtobufTranslation3d msg;
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::Translation3d>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufTranslation3d>(arena);
|
||||
}
|
||||
|
||||
frc::Translation3d wpi::Protobuf<frc::Translation3d>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufTranslation3d*>(&msg);
|
||||
return frc::Translation3d{
|
||||
units::meter_t{m->x()},
|
||||
units::meter_t{m->y()},
|
||||
units::meter_t{m->z()},
|
||||
units::meter_t{msg.x},
|
||||
units::meter_t{msg.y},
|
||||
units::meter_t{msg.z},
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::Translation3d>::Pack(google::protobuf::Message* msg,
|
||||
bool wpi::Protobuf<frc::Translation3d>::Pack(OutputStream& stream,
|
||||
const frc::Translation3d& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufTranslation3d*>(msg);
|
||||
m->set_x(value.X().value());
|
||||
m->set_y(value.Y().value());
|
||||
m->set_z(value.Z().value());
|
||||
wpi_proto_ProtobufTranslation3d msg{
|
||||
.x = value.X().value(),
|
||||
.y = value.Y().value(),
|
||||
.z = value.Z().value(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,29 +4,28 @@
|
||||
|
||||
#include "frc/geometry/proto/Twist2dProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include "wpimath/protobuf/geometry2d.npb.h"
|
||||
|
||||
#include "geometry2d.pb.h"
|
||||
std::optional<frc::Twist2d> wpi::Protobuf<frc::Twist2d>::Unpack(
|
||||
InputStream& stream) {
|
||||
wpi_proto_ProtobufTwist2d msg;
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::Twist2d>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufTwist2d>(arena);
|
||||
}
|
||||
|
||||
frc::Twist2d wpi::Protobuf<frc::Twist2d>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufTwist2d*>(&msg);
|
||||
return frc::Twist2d{
|
||||
units::meter_t{m->dx()},
|
||||
units::meter_t{m->dy()},
|
||||
units::radian_t{m->dtheta()},
|
||||
units::meter_t{msg.dx},
|
||||
units::meter_t{msg.dy},
|
||||
units::radian_t{msg.dtheta},
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::Twist2d>::Pack(google::protobuf::Message* msg,
|
||||
bool wpi::Protobuf<frc::Twist2d>::Pack(OutputStream& stream,
|
||||
const frc::Twist2d& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufTwist2d*>(msg);
|
||||
m->set_dx(value.dx.value());
|
||||
m->set_dy(value.dy.value());
|
||||
m->set_dtheta(value.dtheta.value());
|
||||
wpi_proto_ProtobufTwist2d msg{
|
||||
.dx = value.dx.value(),
|
||||
.dy = value.dy.value(),
|
||||
.dtheta = value.dtheta.value(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,32 +4,30 @@
|
||||
|
||||
#include "frc/geometry/proto/Twist3dProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include "wpimath/protobuf/geometry3d.npb.h"
|
||||
|
||||
#include "geometry3d.pb.h"
|
||||
std::optional<frc::Twist3d> wpi::Protobuf<frc::Twist3d>::Unpack(
|
||||
InputStream& stream) {
|
||||
wpi_proto_ProtobufTwist3d msg;
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::Twist3d>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufTwist3d>(arena);
|
||||
}
|
||||
|
||||
frc::Twist3d wpi::Protobuf<frc::Twist3d>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufTwist3d*>(&msg);
|
||||
return frc::Twist3d{
|
||||
units::meter_t{m->dx()}, units::meter_t{m->dy()},
|
||||
units::meter_t{m->dz()}, units::radian_t{m->rx()},
|
||||
units::radian_t{m->ry()}, units::radian_t{m->rz()},
|
||||
units::meter_t{msg.dx}, units::meter_t{msg.dy}, units::meter_t{msg.dz},
|
||||
units::radian_t{msg.rx}, units::radian_t{msg.ry}, units::radian_t{msg.rz},
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::Twist3d>::Pack(google::protobuf::Message* msg,
|
||||
bool wpi::Protobuf<frc::Twist3d>::Pack(OutputStream& stream,
|
||||
const frc::Twist3d& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufTwist3d*>(msg);
|
||||
m->set_dx(value.dx.value());
|
||||
m->set_dy(value.dy.value());
|
||||
m->set_dz(value.dz.value());
|
||||
m->set_rx(value.rx.value());
|
||||
m->set_ry(value.ry.value());
|
||||
m->set_rz(value.rz.value());
|
||||
wpi_proto_ProtobufTwist3d msg{
|
||||
.dx = value.dx.value(),
|
||||
.dy = value.dy.value(),
|
||||
.dz = value.dz.value(),
|
||||
.rx = value.rx.value(),
|
||||
.ry = value.ry.value(),
|
||||
.rz = value.rz.value(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,29 +4,28 @@
|
||||
|
||||
#include "frc/kinematics/proto/ChassisSpeedsProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include "wpimath/protobuf/kinematics.npb.h"
|
||||
|
||||
#include "kinematics.pb.h"
|
||||
std::optional<frc::ChassisSpeeds> wpi::Protobuf<frc::ChassisSpeeds>::Unpack(
|
||||
InputStream& stream) {
|
||||
wpi_proto_ProtobufChassisSpeeds msg;
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::ChassisSpeeds>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufChassisSpeeds>(arena);
|
||||
}
|
||||
|
||||
frc::ChassisSpeeds wpi::Protobuf<frc::ChassisSpeeds>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufChassisSpeeds*>(&msg);
|
||||
return frc::ChassisSpeeds{
|
||||
units::meters_per_second_t{m->vx()},
|
||||
units::meters_per_second_t{m->vy()},
|
||||
units::radians_per_second_t{m->omega()},
|
||||
units::meters_per_second_t{msg.vx},
|
||||
units::meters_per_second_t{msg.vy},
|
||||
units::radians_per_second_t{msg.omega},
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::ChassisSpeeds>::Pack(google::protobuf::Message* msg,
|
||||
bool wpi::Protobuf<frc::ChassisSpeeds>::Pack(OutputStream& stream,
|
||||
const frc::ChassisSpeeds& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufChassisSpeeds*>(msg);
|
||||
m->set_vx(value.vx.value());
|
||||
m->set_vy(value.vy.value());
|
||||
m->set_omega(value.omega.value());
|
||||
wpi_proto_ProtobufChassisSpeeds msg{
|
||||
.vx = value.vx.value(),
|
||||
.vy = value.vy.value(),
|
||||
.omega = value.omega.value(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,29 +4,24 @@
|
||||
|
||||
#include "frc/kinematics/proto/DifferentialDriveKinematicsProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include "wpimath/protobuf/kinematics.npb.h"
|
||||
|
||||
#include "kinematics.pb.h"
|
||||
std::optional<frc::DifferentialDriveKinematics>
|
||||
wpi::Protobuf<frc::DifferentialDriveKinematics>::Unpack(InputStream& stream) {
|
||||
wpi_proto_ProtobufDifferentialDriveKinematics msg;
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::DifferentialDriveKinematics>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufDifferentialDriveKinematics>(
|
||||
arena);
|
||||
}
|
||||
|
||||
frc::DifferentialDriveKinematics
|
||||
wpi::Protobuf<frc::DifferentialDriveKinematics>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m =
|
||||
static_cast<const wpi::proto::ProtobufDifferentialDriveKinematics*>(&msg);
|
||||
return frc::DifferentialDriveKinematics{
|
||||
units::meter_t{m->track_width()},
|
||||
units::meter_t{msg.track_width},
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::DifferentialDriveKinematics>::Pack(
|
||||
google::protobuf::Message* msg,
|
||||
const frc::DifferentialDriveKinematics& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufDifferentialDriveKinematics*>(msg);
|
||||
m->set_track_width(value.trackWidth.value());
|
||||
bool wpi::Protobuf<frc::DifferentialDriveKinematics>::Pack(
|
||||
OutputStream& stream, const frc::DifferentialDriveKinematics& value) {
|
||||
wpi_proto_ProtobufDifferentialDriveKinematics msg{
|
||||
.track_width = value.trackWidth.value(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,33 +4,26 @@
|
||||
|
||||
#include "frc/kinematics/proto/DifferentialDriveWheelPositionsProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include "wpimath/protobuf/kinematics.npb.h"
|
||||
|
||||
#include "kinematics.pb.h"
|
||||
std::optional<frc::DifferentialDriveWheelPositions> wpi::Protobuf<
|
||||
frc::DifferentialDriveWheelPositions>::Unpack(InputStream& stream) {
|
||||
wpi_proto_ProtobufDifferentialDriveWheelPositions msg;
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<
|
||||
frc::DifferentialDriveWheelPositions>::New(google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<
|
||||
wpi::proto::ProtobufDifferentialDriveWheelPositions>(arena);
|
||||
}
|
||||
|
||||
frc::DifferentialDriveWheelPositions
|
||||
wpi::Protobuf<frc::DifferentialDriveWheelPositions>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m =
|
||||
static_cast<const wpi::proto::ProtobufDifferentialDriveWheelPositions*>(
|
||||
&msg);
|
||||
return frc::DifferentialDriveWheelPositions{
|
||||
units::meter_t{m->left()},
|
||||
units::meter_t{m->right()},
|
||||
units::meter_t{msg.left},
|
||||
units::meter_t{msg.right},
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::DifferentialDriveWheelPositions>::Pack(
|
||||
google::protobuf::Message* msg,
|
||||
const frc::DifferentialDriveWheelPositions& value) {
|
||||
auto m =
|
||||
static_cast<wpi::proto::ProtobufDifferentialDriveWheelPositions*>(msg);
|
||||
m->set_left(value.left.value());
|
||||
m->set_right(value.right.value());
|
||||
bool wpi::Protobuf<frc::DifferentialDriveWheelPositions>::Pack(
|
||||
OutputStream& stream, const frc::DifferentialDriveWheelPositions& value) {
|
||||
wpi_proto_ProtobufDifferentialDriveWheelPositions msg{
|
||||
.left = value.left.value(),
|
||||
.right = value.right.value(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,31 +4,26 @@
|
||||
|
||||
#include "frc/kinematics/proto/DifferentialDriveWheelSpeedsProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include "wpimath/protobuf/kinematics.npb.h"
|
||||
|
||||
#include "kinematics.pb.h"
|
||||
std::optional<frc::DifferentialDriveWheelSpeeds>
|
||||
wpi::Protobuf<frc::DifferentialDriveWheelSpeeds>::Unpack(InputStream& stream) {
|
||||
wpi_proto_ProtobufDifferentialDriveWheelSpeeds msg;
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<
|
||||
frc::DifferentialDriveWheelSpeeds>::New(google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufDifferentialDriveWheelSpeeds>(
|
||||
arena);
|
||||
}
|
||||
|
||||
frc::DifferentialDriveWheelSpeeds
|
||||
wpi::Protobuf<frc::DifferentialDriveWheelSpeeds>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufDifferentialDriveWheelSpeeds*>(
|
||||
&msg);
|
||||
return frc::DifferentialDriveWheelSpeeds{
|
||||
units::meters_per_second_t{m->left()},
|
||||
units::meters_per_second_t{m->right()},
|
||||
units::meters_per_second_t{msg.left},
|
||||
units::meters_per_second_t{msg.right},
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::DifferentialDriveWheelSpeeds>::Pack(
|
||||
google::protobuf::Message* msg,
|
||||
const frc::DifferentialDriveWheelSpeeds& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufDifferentialDriveWheelSpeeds*>(msg);
|
||||
m->set_left(value.left.value());
|
||||
m->set_right(value.right.value());
|
||||
bool wpi::Protobuf<frc::DifferentialDriveWheelSpeeds>::Pack(
|
||||
OutputStream& stream, const frc::DifferentialDriveWheelSpeeds& value) {
|
||||
wpi_proto_ProtobufDifferentialDriveWheelSpeeds msg{
|
||||
.left = value.left.value(),
|
||||
.right = value.right.value(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,31 +4,55 @@
|
||||
|
||||
#include "frc/kinematics/proto/MecanumDriveKinematicsProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <wpi/protobuf/ProtobufCallbacks.h>
|
||||
|
||||
#include "kinematics.pb.h"
|
||||
#include "wpimath/protobuf/kinematics.npb.h"
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::MecanumDriveKinematics>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufMecanumDriveKinematics>(arena);
|
||||
}
|
||||
std::optional<frc::MecanumDriveKinematics>
|
||||
wpi::Protobuf<frc::MecanumDriveKinematics>::Unpack(InputStream& stream) {
|
||||
wpi::UnpackCallback<frc::Translation2d> frontLeft;
|
||||
wpi::UnpackCallback<frc::Translation2d> frontRight;
|
||||
wpi::UnpackCallback<frc::Translation2d> rearLeft;
|
||||
wpi::UnpackCallback<frc::Translation2d> rearRight;
|
||||
wpi_proto_ProtobufMecanumDriveKinematics msg{
|
||||
.front_left = frontLeft.Callback(),
|
||||
.front_right = frontRight.Callback(),
|
||||
.rear_left = rearLeft.Callback(),
|
||||
.rear_right = rearRight.Callback(),
|
||||
};
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
auto ifrontLeft = frontLeft.Items();
|
||||
auto ifrontRight = frontRight.Items();
|
||||
auto irearLeft = rearLeft.Items();
|
||||
auto irearRight = rearRight.Items();
|
||||
|
||||
if (ifrontLeft.empty() || ifrontRight.empty() || irearLeft.empty() ||
|
||||
irearRight.empty()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
frc::MecanumDriveKinematics wpi::Protobuf<frc::MecanumDriveKinematics>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufMecanumDriveKinematics*>(&msg);
|
||||
return frc::MecanumDriveKinematics{
|
||||
wpi::UnpackProtobuf<frc::Translation2d>(m->wpi_front_left()),
|
||||
wpi::UnpackProtobuf<frc::Translation2d>(m->wpi_front_right()),
|
||||
wpi::UnpackProtobuf<frc::Translation2d>(m->wpi_rear_left()),
|
||||
wpi::UnpackProtobuf<frc::Translation2d>(m->wpi_rear_right()),
|
||||
ifrontLeft[0],
|
||||
ifrontRight[0],
|
||||
irearLeft[0],
|
||||
irearRight[0],
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::MecanumDriveKinematics>::Pack(
|
||||
google::protobuf::Message* msg, const frc::MecanumDriveKinematics& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufMecanumDriveKinematics*>(msg);
|
||||
wpi::PackProtobuf(m->mutable_front_left(), value.GetFrontLeft());
|
||||
wpi::PackProtobuf(m->mutable_front_right(), value.GetFrontRight());
|
||||
wpi::PackProtobuf(m->mutable_rear_left(), value.GetRearLeft());
|
||||
wpi::PackProtobuf(m->mutable_rear_right(), value.GetRearRight());
|
||||
bool wpi::Protobuf<frc::MecanumDriveKinematics>::Pack(
|
||||
OutputStream& stream, const frc::MecanumDriveKinematics& value) {
|
||||
wpi::PackCallback frontLeft{&value.GetFrontLeft()};
|
||||
wpi::PackCallback frontRight{&value.GetFrontRight()};
|
||||
wpi::PackCallback rearLeft{&value.GetRearLeft()};
|
||||
wpi::PackCallback rearRight{&value.GetRearRight()};
|
||||
wpi_proto_ProtobufMecanumDriveKinematics msg{
|
||||
.front_left = frontLeft.Callback(),
|
||||
.front_right = frontRight.Callback(),
|
||||
.rear_left = rearLeft.Callback(),
|
||||
.rear_right = rearRight.Callback(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,35 +4,30 @@
|
||||
|
||||
#include "frc/kinematics/proto/MecanumDriveWheelPositionsProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include "wpimath/protobuf/kinematics.npb.h"
|
||||
|
||||
#include "kinematics.pb.h"
|
||||
std::optional<frc::MecanumDriveWheelPositions>
|
||||
wpi::Protobuf<frc::MecanumDriveWheelPositions>::Unpack(InputStream& stream) {
|
||||
wpi_proto_ProtobufMecanumDriveWheelPositions msg;
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::MecanumDriveWheelPositions>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufMecanumDriveWheelPositions>(
|
||||
arena);
|
||||
}
|
||||
|
||||
frc::MecanumDriveWheelPositions
|
||||
wpi::Protobuf<frc::MecanumDriveWheelPositions>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m =
|
||||
static_cast<const wpi::proto::ProtobufMecanumDriveWheelPositions*>(&msg);
|
||||
return frc::MecanumDriveWheelPositions{
|
||||
units::meter_t{m->front_left()},
|
||||
units::meter_t{m->front_right()},
|
||||
units::meter_t{m->rear_left()},
|
||||
units::meter_t{m->rear_right()},
|
||||
units::meter_t{msg.front_left},
|
||||
units::meter_t{msg.front_right},
|
||||
units::meter_t{msg.rear_left},
|
||||
units::meter_t{msg.rear_right},
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::MecanumDriveWheelPositions>::Pack(
|
||||
google::protobuf::Message* msg,
|
||||
const frc::MecanumDriveWheelPositions& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufMecanumDriveWheelPositions*>(msg);
|
||||
m->set_front_left(value.frontLeft.value());
|
||||
m->set_front_right(value.frontRight.value());
|
||||
m->set_rear_left(value.rearLeft.value());
|
||||
m->set_rear_right(value.rearRight.value());
|
||||
bool wpi::Protobuf<frc::MecanumDriveWheelPositions>::Pack(
|
||||
OutputStream& stream, const frc::MecanumDriveWheelPositions& value) {
|
||||
wpi_proto_ProtobufMecanumDriveWheelPositions msg{
|
||||
.front_left = value.frontLeft.value(),
|
||||
.front_right = value.frontRight.value(),
|
||||
.rear_left = value.rearLeft.value(),
|
||||
.rear_right = value.rearRight.value(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,33 +4,30 @@
|
||||
|
||||
#include "frc/kinematics/proto/MecanumDriveWheelSpeedsProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include "wpimath/protobuf/kinematics.npb.h"
|
||||
|
||||
#include "kinematics.pb.h"
|
||||
std::optional<frc::MecanumDriveWheelSpeeds>
|
||||
wpi::Protobuf<frc::MecanumDriveWheelSpeeds>::Unpack(InputStream& stream) {
|
||||
wpi_proto_ProtobufMecanumDriveWheelSpeeds msg;
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::MecanumDriveWheelSpeeds>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufMecanumDriveWheelSpeeds>(arena);
|
||||
}
|
||||
|
||||
frc::MecanumDriveWheelSpeeds
|
||||
wpi::Protobuf<frc::MecanumDriveWheelSpeeds>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m =
|
||||
static_cast<const wpi::proto::ProtobufMecanumDriveWheelSpeeds*>(&msg);
|
||||
return frc::MecanumDriveWheelSpeeds{
|
||||
units::meters_per_second_t{m->front_left()},
|
||||
units::meters_per_second_t{m->front_right()},
|
||||
units::meters_per_second_t{m->rear_left()},
|
||||
units::meters_per_second_t{m->rear_right()},
|
||||
units::meters_per_second_t{msg.front_left},
|
||||
units::meters_per_second_t{msg.front_right},
|
||||
units::meters_per_second_t{msg.rear_left},
|
||||
units::meters_per_second_t{msg.rear_right},
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::MecanumDriveWheelSpeeds>::Pack(
|
||||
google::protobuf::Message* msg, const frc::MecanumDriveWheelSpeeds& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufMecanumDriveWheelSpeeds*>(msg);
|
||||
m->set_front_left(value.frontLeft.value());
|
||||
m->set_front_right(value.frontRight.value());
|
||||
m->set_rear_left(value.rearLeft.value());
|
||||
m->set_rear_right(value.rearRight.value());
|
||||
bool wpi::Protobuf<frc::MecanumDriveWheelSpeeds>::Pack(
|
||||
OutputStream& stream, const frc::MecanumDriveWheelSpeeds& value) {
|
||||
wpi_proto_ProtobufMecanumDriveWheelSpeeds msg{
|
||||
.front_left = value.frontLeft.value(),
|
||||
.front_right = value.frontRight.value(),
|
||||
.rear_left = value.rearLeft.value(),
|
||||
.rear_right = value.rearRight.value(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,27 +4,39 @@
|
||||
|
||||
#include "frc/kinematics/proto/SwerveModulePositionProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <wpi/protobuf/ProtobufCallbacks.h>
|
||||
|
||||
#include "kinematics.pb.h"
|
||||
#include "wpimath/protobuf/kinematics.npb.h"
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::SwerveModulePosition>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufSwerveModulePosition>(arena);
|
||||
}
|
||||
std::optional<frc::SwerveModulePosition>
|
||||
wpi::Protobuf<frc::SwerveModulePosition>::Unpack(InputStream& stream) {
|
||||
wpi::UnpackCallback<frc::Rotation2d> angle;
|
||||
wpi_proto_ProtobufSwerveModulePosition msg{
|
||||
.distance = 0,
|
||||
.angle = angle.Callback(),
|
||||
};
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
auto iangle = angle.Items();
|
||||
|
||||
if (iangle.empty()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
frc::SwerveModulePosition wpi::Protobuf<frc::SwerveModulePosition>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufSwerveModulePosition*>(&msg);
|
||||
return frc::SwerveModulePosition{
|
||||
units::meter_t{m->distance()},
|
||||
wpi::UnpackProtobuf<frc::Rotation2d>(m->wpi_angle()),
|
||||
units::meter_t{msg.distance},
|
||||
iangle[0],
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::SwerveModulePosition>::Pack(
|
||||
google::protobuf::Message* msg, const frc::SwerveModulePosition& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufSwerveModulePosition*>(msg);
|
||||
m->set_distance(value.distance.value());
|
||||
wpi::PackProtobuf(m->mutable_angle(), value.angle);
|
||||
bool wpi::Protobuf<frc::SwerveModulePosition>::Pack(
|
||||
OutputStream& stream, const frc::SwerveModulePosition& value) {
|
||||
wpi::PackCallback angle{&value.angle};
|
||||
wpi_proto_ProtobufSwerveModulePosition msg{
|
||||
.distance = value.distance.value(),
|
||||
.angle = angle.Callback(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,27 +4,39 @@
|
||||
|
||||
#include "frc/kinematics/proto/SwerveModuleStateProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <wpi/protobuf/ProtobufCallbacks.h>
|
||||
|
||||
#include "kinematics.pb.h"
|
||||
#include "wpimath/protobuf/kinematics.npb.h"
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::SwerveModuleState>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufSwerveModuleState>(arena);
|
||||
}
|
||||
std::optional<frc::SwerveModuleState>
|
||||
wpi::Protobuf<frc::SwerveModuleState>::Unpack(InputStream& stream) {
|
||||
wpi::UnpackCallback<frc::Rotation2d> angle;
|
||||
wpi_proto_ProtobufSwerveModuleState msg{
|
||||
.speed = 0,
|
||||
.angle = angle.Callback(),
|
||||
};
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
auto iangle = angle.Items();
|
||||
|
||||
if (iangle.empty()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
frc::SwerveModuleState wpi::Protobuf<frc::SwerveModuleState>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufSwerveModuleState*>(&msg);
|
||||
return frc::SwerveModuleState{
|
||||
units::meters_per_second_t{m->speed()},
|
||||
wpi::UnpackProtobuf<frc::Rotation2d>(m->wpi_angle()),
|
||||
units::meters_per_second_t{msg.speed},
|
||||
iangle[0],
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::SwerveModuleState>::Pack(
|
||||
google::protobuf::Message* msg, const frc::SwerveModuleState& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufSwerveModuleState*>(msg);
|
||||
m->set_speed(value.speed.value());
|
||||
wpi::PackProtobuf(m->mutable_angle(), value.angle);
|
||||
bool wpi::Protobuf<frc::SwerveModuleState>::Pack(
|
||||
OutputStream& stream, const frc::SwerveModuleState& value) {
|
||||
wpi::PackCallback angle{&value.angle};
|
||||
wpi_proto_ProtobufSwerveModuleState msg{
|
||||
.speed = value.speed.value(),
|
||||
.angle = angle.Callback(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,32 +4,50 @@
|
||||
|
||||
#include "frc/spline/proto/CubicHermiteSplineProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <wpi/protobuf/ProtobufCallbacks.h>
|
||||
|
||||
#include "spline.pb.h"
|
||||
#include "wpimath/protobuf/spline.npb.h"
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::CubicHermiteSpline>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufCubicHermiteSpline>(arena);
|
||||
}
|
||||
std::optional<frc::CubicHermiteSpline>
|
||||
wpi::Protobuf<frc::CubicHermiteSpline>::Unpack(InputStream& stream) {
|
||||
wpi::WpiArrayUnpackCallback<double, 2> xInitial;
|
||||
wpi::WpiArrayUnpackCallback<double, 2> xFinal;
|
||||
wpi::WpiArrayUnpackCallback<double, 2> yInitial;
|
||||
wpi::WpiArrayUnpackCallback<double, 2> yFinal;
|
||||
wpi_proto_ProtobufCubicHermiteSpline msg{
|
||||
.x_initial = xInitial.Callback(),
|
||||
.x_final = xFinal.Callback(),
|
||||
.y_initial = yInitial.Callback(),
|
||||
.y_final = yFinal.Callback(),
|
||||
};
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
if (!xInitial.IsFull() || !yInitial.IsFull() || !xFinal.IsFull() ||
|
||||
!yFinal.IsFull()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
frc::CubicHermiteSpline wpi::Protobuf<frc::CubicHermiteSpline>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufCubicHermiteSpline*>(&msg);
|
||||
return frc::CubicHermiteSpline{
|
||||
wpi::UnpackProtobufArray<double, 2>(m->x_initial()),
|
||||
wpi::UnpackProtobufArray<double, 2>(m->x_final()),
|
||||
wpi::UnpackProtobufArray<double, 2>(m->y_initial()),
|
||||
wpi::UnpackProtobufArray<double, 2>(m->y_final())};
|
||||
xInitial.Array(),
|
||||
xFinal.Array(),
|
||||
yInitial.Array(),
|
||||
yFinal.Array(),
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::CubicHermiteSpline>::Pack(
|
||||
google::protobuf::Message* msg, const frc::CubicHermiteSpline& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufCubicHermiteSpline*>(msg);
|
||||
wpi::PackProtobufArray(m->mutable_x_initial(),
|
||||
value.GetInitialControlVector().x);
|
||||
wpi::PackProtobufArray(m->mutable_x_final(), value.GetFinalControlVector().x);
|
||||
wpi::PackProtobufArray(m->mutable_y_initial(),
|
||||
value.GetInitialControlVector().y);
|
||||
wpi::PackProtobufArray(m->mutable_y_final(), value.GetFinalControlVector().y);
|
||||
bool wpi::Protobuf<frc::CubicHermiteSpline>::Pack(
|
||||
OutputStream& stream, const frc::CubicHermiteSpline& value) {
|
||||
wpi::PackCallback<double> xInitial{value.GetInitialControlVector().x};
|
||||
wpi::PackCallback<double> xFinal{value.GetFinalControlVector().x};
|
||||
wpi::PackCallback<double> yInitial{value.GetInitialControlVector().y};
|
||||
wpi::PackCallback<double> yFinal{value.GetFinalControlVector().y};
|
||||
wpi_proto_ProtobufCubicHermiteSpline msg{
|
||||
.x_initial = xInitial.Callback(),
|
||||
.x_final = xFinal.Callback(),
|
||||
.y_initial = yInitial.Callback(),
|
||||
.y_final = yFinal.Callback(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,32 +4,50 @@
|
||||
|
||||
#include "frc/spline/proto/QuinticHermiteSplineProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <wpi/protobuf/ProtobufCallbacks.h>
|
||||
|
||||
#include "spline.pb.h"
|
||||
#include "wpimath/protobuf/spline.npb.h"
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::QuinticHermiteSpline>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufQuinticHermiteSpline>(arena);
|
||||
}
|
||||
std::optional<frc::QuinticHermiteSpline>
|
||||
wpi::Protobuf<frc::QuinticHermiteSpline>::Unpack(InputStream& stream) {
|
||||
wpi::WpiArrayUnpackCallback<double, 3> xInitial;
|
||||
wpi::WpiArrayUnpackCallback<double, 3> xFinal;
|
||||
wpi::WpiArrayUnpackCallback<double, 3> yInitial;
|
||||
wpi::WpiArrayUnpackCallback<double, 3> yFinal;
|
||||
wpi_proto_ProtobufQuinticHermiteSpline msg{
|
||||
.x_initial = xInitial.Callback(),
|
||||
.x_final = xFinal.Callback(),
|
||||
.y_initial = yInitial.Callback(),
|
||||
.y_final = yFinal.Callback(),
|
||||
};
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
if (!xInitial.IsFull() || !yInitial.IsFull() || !xFinal.IsFull() ||
|
||||
!yFinal.IsFull()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
frc::QuinticHermiteSpline wpi::Protobuf<frc::QuinticHermiteSpline>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufQuinticHermiteSpline*>(&msg);
|
||||
return frc::QuinticHermiteSpline{
|
||||
wpi::UnpackProtobufArray<double, 3>(m->x_initial()),
|
||||
wpi::UnpackProtobufArray<double, 3>(m->x_final()),
|
||||
wpi::UnpackProtobufArray<double, 3>(m->y_initial()),
|
||||
wpi::UnpackProtobufArray<double, 3>(m->y_final())};
|
||||
xInitial.Array(),
|
||||
xFinal.Array(),
|
||||
yInitial.Array(),
|
||||
yFinal.Array(),
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::QuinticHermiteSpline>::Pack(
|
||||
google::protobuf::Message* msg, const frc::QuinticHermiteSpline& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufQuinticHermiteSpline*>(msg);
|
||||
wpi::PackProtobufArray(m->mutable_x_initial(),
|
||||
value.GetInitialControlVector().x);
|
||||
wpi::PackProtobufArray(m->mutable_x_final(), value.GetFinalControlVector().x);
|
||||
wpi::PackProtobufArray(m->mutable_y_initial(),
|
||||
value.GetInitialControlVector().y);
|
||||
wpi::PackProtobufArray(m->mutable_y_final(), value.GetFinalControlVector().y);
|
||||
bool wpi::Protobuf<frc::QuinticHermiteSpline>::Pack(
|
||||
OutputStream& stream, const frc::QuinticHermiteSpline& value) {
|
||||
wpi::PackCallback<double> xInitial{value.GetInitialControlVector().x};
|
||||
wpi::PackCallback<double> xFinal{value.GetFinalControlVector().x};
|
||||
wpi::PackCallback<double> yInitial{value.GetInitialControlVector().y};
|
||||
wpi::PackCallback<double> yFinal{value.GetFinalControlVector().y};
|
||||
wpi_proto_ProtobufQuinticHermiteSpline msg{
|
||||
.x_initial = xInitial.Callback(),
|
||||
.x_final = xFinal.Callback(),
|
||||
.y_initial = yInitial.Callback(),
|
||||
.y_final = yFinal.Callback(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,33 +4,34 @@
|
||||
|
||||
#include "frc/system/plant/proto/DCMotorProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <optional>
|
||||
|
||||
#include "plant.pb.h"
|
||||
#include "wpimath/protobuf/plant.npb.h"
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::DCMotor>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufDCMotor>(arena);
|
||||
}
|
||||
std::optional<frc::DCMotor> wpi::Protobuf<frc::DCMotor>::Unpack(
|
||||
InputStream& stream) {
|
||||
wpi_proto_ProtobufDCMotor msg;
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
frc::DCMotor wpi::Protobuf<frc::DCMotor>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufDCMotor*>(&msg);
|
||||
return frc::DCMotor{
|
||||
units::volt_t{m->nominal_voltage()},
|
||||
units::newton_meter_t{m->stall_torque()},
|
||||
units::ampere_t{m->stall_current()},
|
||||
units::ampere_t{m->free_current()},
|
||||
units::radians_per_second_t{m->free_speed()},
|
||||
units::volt_t{msg.nominal_voltage},
|
||||
units::newton_meter_t{msg.stall_torque},
|
||||
units::ampere_t{msg.stall_current},
|
||||
units::ampere_t{msg.free_current},
|
||||
units::radians_per_second_t{msg.free_speed},
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::DCMotor>::Pack(google::protobuf::Message* msg,
|
||||
bool wpi::Protobuf<frc::DCMotor>::Pack(OutputStream& stream,
|
||||
const frc::DCMotor& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufDCMotor*>(msg);
|
||||
m->set_nominal_voltage(value.nominalVoltage.value());
|
||||
m->set_stall_torque(value.stallTorque.value());
|
||||
m->set_stall_current(value.stallCurrent.value());
|
||||
m->set_free_current(value.freeCurrent.value());
|
||||
m->set_free_speed(value.freeSpeed.value());
|
||||
wpi_proto_ProtobufDCMotor msg{
|
||||
.nominal_voltage = value.nominalVoltage.value(),
|
||||
.stall_torque = value.stallTorque.value(),
|
||||
.stall_current = value.stallCurrent.value(),
|
||||
.free_current = value.freeCurrent.value(),
|
||||
.free_speed = value.freeSpeed.value(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -6,31 +6,28 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <wpi/protobuf/ProtobufCallbacks.h>
|
||||
|
||||
#include "trajectory.pb.h"
|
||||
#include "wpimath/protobuf/trajectory.npb.h"
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::Trajectory>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufTrajectory>(arena);
|
||||
}
|
||||
|
||||
frc::Trajectory wpi::Protobuf<frc::Trajectory>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufTrajectory*>(&msg);
|
||||
std::vector<frc::Trajectory::State> states;
|
||||
states.reserve(m->states().size());
|
||||
for (const auto& protoState : m->states()) {
|
||||
states.push_back(wpi::UnpackProtobuf<frc::Trajectory::State>(protoState));
|
||||
std::optional<frc::Trajectory> wpi::Protobuf<frc::Trajectory>::Unpack(
|
||||
InputStream& stream) {
|
||||
wpi::StdVectorUnpackCallback<frc::Trajectory::State, SIZE_MAX> states;
|
||||
wpi_proto_ProtobufTrajectory msg{
|
||||
.states = states.Callback(),
|
||||
};
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
return frc::Trajectory{states};
|
||||
|
||||
return frc::Trajectory{states.Vec()};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::Trajectory>::Pack(google::protobuf::Message* msg,
|
||||
bool wpi::Protobuf<frc::Trajectory>::Pack(OutputStream& stream,
|
||||
const frc::Trajectory& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufTrajectory*>(msg);
|
||||
m->mutable_states()->Reserve(value.States().size());
|
||||
for (const auto& state : value.States()) {
|
||||
wpi::PackProtobuf(m->add_states(), state);
|
||||
}
|
||||
wpi::PackCallback<frc::Trajectory::State> states{value.States()};
|
||||
wpi_proto_ProtobufTrajectory msg{
|
||||
.states = states.Callback(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -4,33 +4,46 @@
|
||||
|
||||
#include "frc/trajectory/proto/TrajectoryStateProto.h"
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <utility>
|
||||
|
||||
#include "trajectory.pb.h"
|
||||
#include <wpi/protobuf/ProtobufCallbacks.h>
|
||||
|
||||
google::protobuf::Message* wpi::Protobuf<frc::Trajectory::State>::New(
|
||||
google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufTrajectoryState>(arena);
|
||||
}
|
||||
#include "wpimath/protobuf/trajectory.npb.h"
|
||||
|
||||
std::optional<frc::Trajectory::State>
|
||||
wpi::Protobuf<frc::Trajectory::State>::Unpack(InputStream& stream) {
|
||||
wpi::UnpackCallback<frc::Pose2d> pose;
|
||||
wpi_proto_ProtobufTrajectoryState msg;
|
||||
msg.pose = pose.Callback();
|
||||
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
auto ipose = pose.Items();
|
||||
|
||||
if (ipose.empty()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
frc::Trajectory::State wpi::Protobuf<frc::Trajectory::State>::Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufTrajectoryState*>(&msg);
|
||||
return frc::Trajectory::State{
|
||||
units::second_t{m->time()},
|
||||
units::meters_per_second_t{m->velocity()},
|
||||
units::meters_per_second_squared_t{m->acceleration()},
|
||||
wpi::UnpackProtobuf<frc::Pose2d>(m->wpi_pose()),
|
||||
units::curvature_t{m->curvature()},
|
||||
units::second_t{msg.time},
|
||||
units::meters_per_second_t{msg.velocity},
|
||||
units::meters_per_second_squared_t{msg.acceleration},
|
||||
std::move(ipose[0]),
|
||||
units::curvature_t{msg.curvature},
|
||||
};
|
||||
}
|
||||
|
||||
void wpi::Protobuf<frc::Trajectory::State>::Pack(
|
||||
google::protobuf::Message* msg, const frc::Trajectory::State& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufTrajectoryState*>(msg);
|
||||
m->set_time(value.t.value());
|
||||
m->set_velocity(value.velocity.value());
|
||||
m->set_acceleration(value.acceleration.value());
|
||||
wpi::PackProtobuf(m->mutable_pose(), value.pose);
|
||||
m->set_curvature(value.curvature.value());
|
||||
bool wpi::Protobuf<frc::Trajectory::State>::Pack(
|
||||
OutputStream& stream, const frc::Trajectory::State& value) {
|
||||
wpi::PackCallback pose{&value.pose};
|
||||
wpi_proto_ProtobufTrajectoryState msg{
|
||||
.time = value.t.value(),
|
||||
.velocity = value.velocity.value(),
|
||||
.acceleration = value.acceleration.value(),
|
||||
.pose = pose.Callback(),
|
||||
.curvature = value.curvature.value(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
|
||||
@@ -8,11 +8,14 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/controller/ArmFeedforward.h"
|
||||
#include "pb.h"
|
||||
#include "wpimath/protobuf/controller.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::ArmFeedforward> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::ArmFeedforward Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
const frc::ArmFeedforward& value);
|
||||
using MessageStruct = wpi_proto_ProtobufArmFeedforward;
|
||||
using InputStream = wpi::ProtoInputStream<frc::ArmFeedforward>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::ArmFeedforward>;
|
||||
static std::optional<frc::ArmFeedforward> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream, const frc::ArmFeedforward& value);
|
||||
};
|
||||
|
||||
@@ -8,12 +8,17 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/controller/DifferentialDriveFeedforward.h"
|
||||
#include "pb.h"
|
||||
#include "wpimath/protobuf/controller.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::DifferentialDriveFeedforward> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::DifferentialDriveFeedforward Unpack(
|
||||
const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
using MessageStruct = wpi_proto_ProtobufDifferentialDriveFeedforward;
|
||||
using InputStream = wpi::ProtoInputStream<frc::DifferentialDriveFeedforward>;
|
||||
using OutputStream =
|
||||
wpi::ProtoOutputStream<frc::DifferentialDriveFeedforward>;
|
||||
static std::optional<frc::DifferentialDriveFeedforward> Unpack(
|
||||
InputStream& stream);
|
||||
static bool Pack(OutputStream& stream,
|
||||
const frc::DifferentialDriveFeedforward& value);
|
||||
};
|
||||
|
||||
@@ -8,12 +8,18 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/controller/DifferentialDriveWheelVoltages.h"
|
||||
#include "pb.h"
|
||||
#include "wpimath/protobuf/controller.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::DifferentialDriveWheelVoltages> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::DifferentialDriveWheelVoltages Unpack(
|
||||
const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
using MessageStruct = wpi_proto_ProtobufDifferentialDriveWheelVoltages;
|
||||
using InputStream =
|
||||
wpi::ProtoInputStream<frc::DifferentialDriveWheelVoltages>;
|
||||
using OutputStream =
|
||||
wpi::ProtoOutputStream<frc::DifferentialDriveWheelVoltages>;
|
||||
static std::optional<frc::DifferentialDriveWheelVoltages> Unpack(
|
||||
InputStream& stream);
|
||||
static bool Pack(OutputStream& stream,
|
||||
const frc::DifferentialDriveWheelVoltages& value);
|
||||
};
|
||||
|
||||
@@ -8,11 +8,14 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/controller/ElevatorFeedforward.h"
|
||||
#include "pb.h"
|
||||
#include "wpimath/protobuf/controller.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::ElevatorFeedforward> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::ElevatorFeedforward Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
const frc::ElevatorFeedforward& value);
|
||||
using MessageStruct = wpi_proto_ProtobufElevatorFeedforward;
|
||||
using InputStream = wpi::ProtoInputStream<frc::ElevatorFeedforward>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::ElevatorFeedforward>;
|
||||
static std::optional<frc::ElevatorFeedforward> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream, const frc::ElevatorFeedforward& value);
|
||||
};
|
||||
|
||||
@@ -4,47 +4,55 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "controller.pb.h"
|
||||
#include "frc/controller/SimpleMotorFeedforward.h"
|
||||
#include "pb.h"
|
||||
#include "units/length.h"
|
||||
#include "wpimath/protobuf/controller.npb.h"
|
||||
|
||||
// Everything is converted into units for
|
||||
// frc::SimpleMotorFeedforward<units::meters>
|
||||
|
||||
template <class Distance>
|
||||
struct wpi::Protobuf<frc::SimpleMotorFeedforward<Distance>> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufSimpleMotorFeedforward>(
|
||||
arena);
|
||||
}
|
||||
struct wpi::Protobuf<frc::SimpleMotorFeedforward<Distance>> { // NOLINT
|
||||
using MessageStruct = wpi_proto_ProtobufSimpleMotorFeedforward;
|
||||
using InputStream =
|
||||
wpi::ProtoInputStream<frc::SimpleMotorFeedforward<Distance>>;
|
||||
using OutputStream =
|
||||
wpi::ProtoOutputStream<frc::SimpleMotorFeedforward<Distance>>;
|
||||
|
||||
static frc::SimpleMotorFeedforward<Distance> Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m =
|
||||
static_cast<const wpi::proto::ProtobufSimpleMotorFeedforward*>(&msg);
|
||||
return {units::volt_t{m->ks()},
|
||||
units::unit_t<frc::SimpleMotorFeedforward<units::meters>::kv_unit>{
|
||||
m->kv()},
|
||||
units::unit_t<frc::SimpleMotorFeedforward<units::meters>::ka_unit>{
|
||||
m->ka()},
|
||||
units::second_t{m->dt()}};
|
||||
}
|
||||
static std::optional<frc::SimpleMotorFeedforward<Distance>> Unpack(
|
||||
InputStream& stream) {
|
||||
wpi_proto_ProtobufSimpleMotorFeedforward msg;
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
const frc::SimpleMotorFeedforward<Distance>& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufSimpleMotorFeedforward*>(msg);
|
||||
m->set_ks(value.GetKs().value());
|
||||
m->set_kv(
|
||||
return frc::SimpleMotorFeedforward<Distance>{
|
||||
units::volt_t{msg.ks},
|
||||
units::unit_t<frc::SimpleMotorFeedforward<units::meters>::kv_unit>{
|
||||
value.GetKv()}
|
||||
.value());
|
||||
m->set_ka(
|
||||
msg.kv},
|
||||
units::unit_t<frc::SimpleMotorFeedforward<units::meters>::ka_unit>{
|
||||
value.GetKa()}
|
||||
.value());
|
||||
m->set_dt(units::second_t{value.GetDt()}.value());
|
||||
msg.ka},
|
||||
units::second_t{msg.dt},
|
||||
};
|
||||
}
|
||||
|
||||
static bool Pack(OutputStream& stream,
|
||||
const frc::SimpleMotorFeedforward<Distance>& value) {
|
||||
wpi_proto_ProtobufSimpleMotorFeedforward msg{
|
||||
.ks = value.GetKs().value(),
|
||||
.kv =
|
||||
units::unit_t<frc::SimpleMotorFeedforward<units::meters>::kv_unit>{
|
||||
value.GetKv()}
|
||||
.value(),
|
||||
.ka =
|
||||
units::unit_t<frc::SimpleMotorFeedforward<units::meters>::ka_unit>{
|
||||
value.GetKa()}
|
||||
.value(),
|
||||
.dt = units::second_t{value.GetDt()}.value(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -8,10 +8,13 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/geometry/Ellipse2d.h"
|
||||
#include "wpimath/protobuf/geometry2d.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::Ellipse2d> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::Ellipse2d Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg, const frc::Ellipse2d& value);
|
||||
using MessageStruct = wpi_proto_ProtobufEllipse2d;
|
||||
using InputStream = wpi::ProtoInputStream<frc::Ellipse2d>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::Ellipse2d>;
|
||||
static std::optional<frc::Ellipse2d> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream, const frc::Ellipse2d& value);
|
||||
};
|
||||
|
||||
@@ -8,10 +8,14 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/geometry/Pose2d.h"
|
||||
#include "pb.h"
|
||||
#include "wpimath/protobuf/geometry2d.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::Pose2d> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::Pose2d Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg, const frc::Pose2d& value);
|
||||
using MessageStruct = wpi_proto_ProtobufPose2d;
|
||||
using InputStream = wpi::ProtoInputStream<frc::Pose2d>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::Pose2d>;
|
||||
static std::optional<frc::Pose2d> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream, const frc::Pose2d& value);
|
||||
};
|
||||
|
||||
@@ -8,10 +8,13 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/geometry/Pose3d.h"
|
||||
#include "wpimath/protobuf/geometry3d.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::Pose3d> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::Pose3d Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg, const frc::Pose3d& value);
|
||||
using MessageStruct = wpi_proto_ProtobufPose3d;
|
||||
using InputStream = wpi::ProtoInputStream<frc::Pose3d>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::Pose3d>;
|
||||
static std::optional<frc::Pose3d> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream, const frc::Pose3d& value);
|
||||
};
|
||||
|
||||
@@ -8,11 +8,13 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/geometry/Quaternion.h"
|
||||
#include "wpimath/protobuf/geometry3d.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::Quaternion> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::Quaternion Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
const frc::Quaternion& value);
|
||||
using MessageStruct = wpi_proto_ProtobufQuaternion;
|
||||
using InputStream = wpi::ProtoInputStream<frc::Quaternion>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::Quaternion>;
|
||||
static std::optional<frc::Quaternion> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream, const frc::Quaternion& value);
|
||||
};
|
||||
|
||||
@@ -8,11 +8,13 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/geometry/Rectangle2d.h"
|
||||
#include "wpimath/protobuf/geometry2d.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::Rectangle2d> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::Rectangle2d Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
const frc::Rectangle2d& value);
|
||||
using MessageStruct = wpi_proto_ProtobufRectangle2d;
|
||||
using InputStream = wpi::ProtoInputStream<frc::Rectangle2d>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::Rectangle2d>;
|
||||
static std::optional<frc::Rectangle2d> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream, const frc::Rectangle2d& value);
|
||||
};
|
||||
|
||||
@@ -8,11 +8,14 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/geometry/Rotation2d.h"
|
||||
#include "pb.h"
|
||||
#include "wpimath/protobuf/geometry2d.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::Rotation2d> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::Rotation2d Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
const frc::Rotation2d& value);
|
||||
using MessageStruct = wpi_proto_ProtobufRotation2d;
|
||||
using InputStream = wpi::ProtoInputStream<frc::Rotation2d>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::Rotation2d>;
|
||||
static std::optional<frc::Rotation2d> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream, const frc::Rotation2d& value);
|
||||
};
|
||||
|
||||
@@ -8,11 +8,13 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/geometry/Rotation3d.h"
|
||||
#include "wpimath/protobuf/geometry3d.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::Rotation3d> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::Rotation3d Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
const frc::Rotation3d& value);
|
||||
using MessageStruct = wpi_proto_ProtobufRotation3d;
|
||||
using InputStream = wpi::ProtoInputStream<frc::Rotation3d>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::Rotation3d>;
|
||||
static std::optional<frc::Rotation3d> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream, const frc::Rotation3d& value);
|
||||
};
|
||||
|
||||
@@ -8,11 +8,13 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/geometry/Transform2d.h"
|
||||
#include "wpimath/protobuf/geometry2d.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::Transform2d> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::Transform2d Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
const frc::Transform2d& value);
|
||||
using MessageStruct = wpi_proto_ProtobufTransform2d;
|
||||
using InputStream = wpi::ProtoInputStream<frc::Transform2d>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::Transform2d>;
|
||||
static std::optional<frc::Transform2d> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream, const frc::Transform2d& value);
|
||||
};
|
||||
|
||||
@@ -8,11 +8,13 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/geometry/Transform3d.h"
|
||||
#include "wpimath/protobuf/geometry3d.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::Transform3d> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::Transform3d Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
const frc::Transform3d& value);
|
||||
using MessageStruct = wpi_proto_ProtobufTransform3d;
|
||||
using InputStream = wpi::ProtoInputStream<frc::Transform3d>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::Transform3d>;
|
||||
static std::optional<frc::Transform3d> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream, const frc::Transform3d& value);
|
||||
};
|
||||
|
||||
@@ -8,11 +8,14 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/geometry/Translation2d.h"
|
||||
#include "pb.h"
|
||||
#include "wpimath/protobuf/geometry2d.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::Translation2d> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::Translation2d Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
const frc::Translation2d& value);
|
||||
using MessageStruct = wpi_proto_ProtobufTranslation2d;
|
||||
using InputStream = wpi::ProtoInputStream<frc::Translation2d>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::Translation2d>;
|
||||
static std::optional<frc::Translation2d> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream, const frc::Translation2d& value);
|
||||
};
|
||||
|
||||
@@ -8,11 +8,13 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/geometry/Translation3d.h"
|
||||
#include "wpimath/protobuf/geometry3d.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::Translation3d> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::Translation3d Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
const frc::Translation3d& value);
|
||||
using MessageStruct = wpi_proto_ProtobufTranslation3d;
|
||||
using InputStream = wpi::ProtoInputStream<frc::Translation3d>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::Translation3d>;
|
||||
static std::optional<frc::Translation3d> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream, const frc::Translation3d& value);
|
||||
};
|
||||
|
||||
@@ -8,10 +8,13 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/geometry/Twist2d.h"
|
||||
#include "wpimath/protobuf/geometry2d.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::Twist2d> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::Twist2d Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg, const frc::Twist2d& value);
|
||||
using MessageStruct = wpi_proto_ProtobufTwist2d;
|
||||
using InputStream = wpi::ProtoInputStream<frc::Twist2d>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::Twist2d>;
|
||||
static std::optional<frc::Twist2d> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream, const frc::Twist2d& value);
|
||||
};
|
||||
|
||||
@@ -8,10 +8,13 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/geometry/Twist3d.h"
|
||||
#include "wpimath/protobuf/geometry3d.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::Twist3d> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::Twist3d Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg, const frc::Twist3d& value);
|
||||
using MessageStruct = wpi_proto_ProtobufTwist3d;
|
||||
using InputStream = wpi::ProtoInputStream<frc::Twist3d>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::Twist3d>;
|
||||
static std::optional<frc::Twist3d> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream, const frc::Twist3d& value);
|
||||
};
|
||||
|
||||
@@ -24,6 +24,8 @@ template <typename WheelSpeeds, typename WheelPositions>
|
||||
std::assignable_from<WheelPositions&, const WheelPositions&>
|
||||
class WPILIB_DLLEXPORT Kinematics {
|
||||
public:
|
||||
virtual ~Kinematics() noexcept = default;
|
||||
|
||||
/**
|
||||
* Performs forward kinematics to return the resulting chassis speed from the
|
||||
* wheel speeds. This method is often used for odometry -- determining the
|
||||
|
||||
@@ -429,7 +429,7 @@ class SwerveDriveKinematics
|
||||
return {result};
|
||||
}
|
||||
|
||||
const wpi::array<Translation2d, NumModules> GetModules() const {
|
||||
const wpi::array<Translation2d, NumModules>& GetModules() const {
|
||||
return m_modules;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,11 +8,13 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/kinematics/ChassisSpeeds.h"
|
||||
#include "wpimath/protobuf/kinematics.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::ChassisSpeeds> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::ChassisSpeeds Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
const frc::ChassisSpeeds& value);
|
||||
using MessageStruct = wpi_proto_ProtobufChassisSpeeds;
|
||||
using InputStream = wpi::ProtoInputStream<frc::ChassisSpeeds>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::ChassisSpeeds>;
|
||||
static std::optional<frc::ChassisSpeeds> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream, const frc::ChassisSpeeds& value);
|
||||
};
|
||||
|
||||
@@ -8,12 +8,15 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/kinematics/DifferentialDriveKinematics.h"
|
||||
#include "wpimath/protobuf/kinematics.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::DifferentialDriveKinematics> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::DifferentialDriveKinematics Unpack(
|
||||
const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
using MessageStruct = wpi_proto_ProtobufDifferentialDriveKinematics;
|
||||
using InputStream = wpi::ProtoInputStream<frc::DifferentialDriveKinematics>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::DifferentialDriveKinematics>;
|
||||
static std::optional<frc::DifferentialDriveKinematics> Unpack(
|
||||
InputStream& stream);
|
||||
static bool Pack(OutputStream& stream,
|
||||
const frc::DifferentialDriveKinematics& value);
|
||||
};
|
||||
|
||||
@@ -8,12 +8,17 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/kinematics/DifferentialDriveWheelPositions.h"
|
||||
#include "wpimath/protobuf/kinematics.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::DifferentialDriveWheelPositions> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::DifferentialDriveWheelPositions Unpack(
|
||||
const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
using MessageStruct = wpi_proto_ProtobufDifferentialDriveWheelPositions;
|
||||
using InputStream =
|
||||
wpi::ProtoInputStream<frc::DifferentialDriveWheelPositions>;
|
||||
using OutputStream =
|
||||
wpi::ProtoOutputStream<frc::DifferentialDriveWheelPositions>;
|
||||
static std::optional<frc::DifferentialDriveWheelPositions> Unpack(
|
||||
InputStream& stream);
|
||||
static bool Pack(OutputStream& stream,
|
||||
const frc::DifferentialDriveWheelPositions& value);
|
||||
};
|
||||
|
||||
@@ -8,12 +8,16 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/kinematics/DifferentialDriveWheelSpeeds.h"
|
||||
#include "wpimath/protobuf/kinematics.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::DifferentialDriveWheelSpeeds> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::DifferentialDriveWheelSpeeds Unpack(
|
||||
const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
using MessageStruct = wpi_proto_ProtobufDifferentialDriveWheelSpeeds;
|
||||
using InputStream = wpi::ProtoInputStream<frc::DifferentialDriveWheelSpeeds>;
|
||||
using OutputStream =
|
||||
wpi::ProtoOutputStream<frc::DifferentialDriveWheelSpeeds>;
|
||||
static std::optional<frc::DifferentialDriveWheelSpeeds> Unpack(
|
||||
InputStream& stream);
|
||||
static bool Pack(OutputStream& stream,
|
||||
const frc::DifferentialDriveWheelSpeeds& value);
|
||||
};
|
||||
|
||||
@@ -8,12 +8,14 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/kinematics/MecanumDriveKinematics.h"
|
||||
#include "wpimath/protobuf/kinematics.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::MecanumDriveKinematics> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::MecanumDriveKinematics Unpack(
|
||||
const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
using MessageStruct = wpi_proto_ProtobufMecanumDriveKinematics;
|
||||
using InputStream = wpi::ProtoInputStream<frc::MecanumDriveKinematics>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::MecanumDriveKinematics>;
|
||||
static std::optional<frc::MecanumDriveKinematics> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream,
|
||||
const frc::MecanumDriveKinematics& value);
|
||||
};
|
||||
|
||||
@@ -8,12 +8,15 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/kinematics/MecanumDriveWheelPositions.h"
|
||||
#include "wpimath/protobuf/kinematics.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::MecanumDriveWheelPositions> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::MecanumDriveWheelPositions Unpack(
|
||||
const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
using MessageStruct = wpi_proto_ProtobufMecanumDriveWheelPositions;
|
||||
using InputStream = wpi::ProtoInputStream<frc::MecanumDriveWheelPositions>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::MecanumDriveWheelPositions>;
|
||||
static std::optional<frc::MecanumDriveWheelPositions> Unpack(
|
||||
InputStream& stream);
|
||||
static bool Pack(OutputStream& stream,
|
||||
const frc::MecanumDriveWheelPositions& value);
|
||||
};
|
||||
|
||||
@@ -8,12 +8,15 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/kinematics/MecanumDriveWheelSpeeds.h"
|
||||
#include "wpimath/protobuf/kinematics.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::MecanumDriveWheelSpeeds> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::MecanumDriveWheelSpeeds Unpack(
|
||||
const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
using MessageStruct = wpi_proto_ProtobufMecanumDriveWheelSpeeds;
|
||||
using InputStream = wpi::ProtoInputStream<frc::MecanumDriveWheelSpeeds>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::MecanumDriveWheelSpeeds>;
|
||||
static std::optional<frc::MecanumDriveWheelSpeeds> Unpack(
|
||||
InputStream& stream);
|
||||
static bool Pack(OutputStream& stream,
|
||||
const frc::MecanumDriveWheelSpeeds& value);
|
||||
};
|
||||
|
||||
@@ -7,36 +7,40 @@
|
||||
#include <stdexcept>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
#include <wpi/protobuf/ProtobufCallbacks.h>
|
||||
|
||||
#include "frc/kinematics/SwerveDriveKinematics.h"
|
||||
#include "kinematics.pb.h"
|
||||
#include "wpimath/protobuf/kinematics.npb.h"
|
||||
|
||||
template <size_t NumModules>
|
||||
struct wpi::Protobuf<frc::SwerveDriveKinematics<NumModules>> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufSwerveDriveKinematics>(arena);
|
||||
}
|
||||
using MessageStruct = wpi_proto_ProtobufSwerveDriveKinematics;
|
||||
using InputStream =
|
||||
wpi::ProtoInputStream<frc::SwerveDriveKinematics<NumModules>>;
|
||||
using OutputStream =
|
||||
wpi::ProtoOutputStream<frc::SwerveDriveKinematics<NumModules>>;
|
||||
|
||||
static frc::SwerveDriveKinematics<NumModules> Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m =
|
||||
static_cast<const wpi::proto::ProtobufSwerveDriveKinematics*>(&msg);
|
||||
if (m->modules_size() != NumModules) {
|
||||
throw std::invalid_argument(fmt::format(
|
||||
"Tried to unpack message with {} elements in modules into "
|
||||
"SwerveDriveKinematics with {} modules",
|
||||
m->modules_size(), NumModules));
|
||||
static std::optional<frc::SwerveDriveKinematics<NumModules>> Unpack(
|
||||
InputStream& stream) {
|
||||
wpi::WpiArrayUnpackCallback<frc::Translation2d, NumModules> modules;
|
||||
wpi_proto_ProtobufSwerveDriveKinematics msg{
|
||||
.modules = modules.Callback(),
|
||||
};
|
||||
modules.SetLimits(wpi::DecodeLimits::Fail);
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
return frc::SwerveDriveKinematics<NumModules>{
|
||||
wpi::UnpackProtobufArray<wpi::proto::ProtobufTranslation2d,
|
||||
frc::Translation2d, NumModules>(m->modules())};
|
||||
|
||||
return frc::SwerveDriveKinematics<NumModules>{modules.Array()};
|
||||
}
|
||||
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
static bool Pack(OutputStream& stream,
|
||||
const frc::SwerveDriveKinematics<NumModules>& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufSwerveDriveKinematics*>(msg);
|
||||
wpi::PackProtobufArray(m->mutable_modules(), value.GetModules());
|
||||
wpi::PackCallback<frc::Translation2d> modules{value.GetModules()};
|
||||
wpi_proto_ProtobufSwerveDriveKinematics msg{
|
||||
.modules = modules.Callback(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -8,11 +8,14 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/kinematics/SwerveModulePosition.h"
|
||||
#include "wpimath/protobuf/kinematics.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::SwerveModulePosition> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::SwerveModulePosition Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
using MessageStruct = wpi_proto_ProtobufSwerveModulePosition;
|
||||
using InputStream = wpi::ProtoInputStream<frc::SwerveModulePosition>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::SwerveModulePosition>;
|
||||
static std::optional<frc::SwerveModulePosition> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream,
|
||||
const frc::SwerveModulePosition& value);
|
||||
};
|
||||
|
||||
@@ -8,11 +8,13 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/kinematics/SwerveModuleState.h"
|
||||
#include "wpimath/protobuf/kinematics.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::SwerveModuleState> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::SwerveModuleState Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
const frc::SwerveModuleState& value);
|
||||
using MessageStruct = wpi_proto_ProtobufSwerveModuleState;
|
||||
using InputStream = wpi::ProtoInputStream<frc::SwerveModuleState>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::SwerveModuleState>;
|
||||
static std::optional<frc::SwerveModuleState> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream, const frc::SwerveModuleState& value);
|
||||
};
|
||||
|
||||
@@ -7,50 +7,65 @@
|
||||
#include <stdexcept>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
#include <wpi/protobuf/ProtobufCallbacks.h>
|
||||
|
||||
#include "frc/EigenCore.h"
|
||||
#include "wpimath.pb.h"
|
||||
#include "wpimath/protobuf/wpimath.npb.h"
|
||||
|
||||
template <int Rows, int Cols, int Options, int MaxRows, int MaxCols>
|
||||
requires(Cols != 1)
|
||||
struct wpi::Protobuf<frc::Matrixd<Rows, Cols, Options, MaxRows, MaxCols>> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufMatrix>(arena);
|
||||
}
|
||||
using MessageStruct = wpi_proto_ProtobufMatrix;
|
||||
using InputStream = wpi::ProtoInputStream<
|
||||
frc::Matrixd<Rows, Cols, Options, MaxRows, MaxCols>>;
|
||||
using OutputStream = wpi::ProtoOutputStream<
|
||||
frc::Matrixd<Rows, Cols, Options, MaxRows, MaxCols>>;
|
||||
|
||||
static frc::Matrixd<Rows, Cols, Options, MaxRows, MaxCols> Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufMatrix*>(&msg);
|
||||
if (m->num_rows() != Rows || m->num_cols() != Cols) {
|
||||
throw std::invalid_argument(fmt::format(
|
||||
"Tried to unpack message with {} rows and {} columns into "
|
||||
"Matrix with {} rows and {} columns",
|
||||
m->num_rows(), m->num_cols(), Rows, Cols));
|
||||
static std::optional<frc::Matrixd<Rows, Cols, Options, MaxRows, MaxCols>>
|
||||
Unpack(InputStream& stream) {
|
||||
constexpr bool isSmall = Rows * Cols * sizeof(double) < 256;
|
||||
using UnpackType =
|
||||
std::conditional_t<isSmall, wpi::UnpackCallback<double, Rows * Cols>,
|
||||
wpi::StdVectorUnpackCallback<double, Rows * Cols>>;
|
||||
UnpackType data;
|
||||
data.Vec().reserve(Rows * Cols);
|
||||
data.SetLimits(wpi::DecodeLimits::Fail);
|
||||
wpi_proto_ProtobufMatrix msg;
|
||||
msg.data = data.Callback();
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
if (m->data_size() != Rows * Cols) {
|
||||
throw std::invalid_argument(
|
||||
fmt::format("Tried to unpack message with {} elements in data into "
|
||||
"Matrix with {} elements",
|
||||
m->data_size(), Rows * Cols));
|
||||
|
||||
if (msg.num_rows != Rows || msg.num_cols != Cols) {
|
||||
return {};
|
||||
}
|
||||
|
||||
auto items = data.Items();
|
||||
|
||||
if (items.size() != Rows * Cols) {
|
||||
return {};
|
||||
}
|
||||
|
||||
frc::Matrixd<Rows, Cols, Options, MaxRows, MaxCols> mat;
|
||||
for (int i = 0; i < Rows * Cols; i++) {
|
||||
mat(i) = m->data(i);
|
||||
mat(i) = items[i];
|
||||
}
|
||||
|
||||
return mat;
|
||||
}
|
||||
|
||||
static void Pack(
|
||||
google::protobuf::Message* msg,
|
||||
static bool Pack(
|
||||
OutputStream& stream,
|
||||
const frc::Matrixd<Rows, Cols, Options, MaxRows, MaxCols>& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufMatrix*>(msg);
|
||||
m->set_num_rows(Rows);
|
||||
m->set_num_cols(Cols);
|
||||
m->clear_data();
|
||||
for (int i = 0; i < Rows * Cols; i++) {
|
||||
m->add_data(value(i));
|
||||
}
|
||||
std::span<const double> dataSpan{value.data(),
|
||||
static_cast<size_t>(Rows * Cols)};
|
||||
wpi::PackCallback<double> data{dataSpan};
|
||||
wpi_proto_ProtobufMatrix msg{
|
||||
.num_rows = Rows,
|
||||
.num_cols = Cols,
|
||||
.data = data.Callback(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,41 +7,58 @@
|
||||
#include <stdexcept>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
#include <wpi/protobuf/ProtobufCallbacks.h>
|
||||
|
||||
#include "frc/EigenCore.h"
|
||||
#include "wpimath.pb.h"
|
||||
#include "wpimath/protobuf/wpimath.npb.h"
|
||||
|
||||
template <int Size, int Options, int MaxRows, int MaxCols>
|
||||
struct wpi::Protobuf<frc::Matrixd<Size, 1, Options, MaxRows, MaxCols>> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufVector>(arena);
|
||||
}
|
||||
using MessageStruct = wpi_proto_ProtobufVector;
|
||||
using InputStream =
|
||||
wpi::ProtoInputStream<frc::Matrixd<Size, 1, Options, MaxRows, MaxCols>>;
|
||||
using OutputStream =
|
||||
wpi::ProtoOutputStream<frc::Matrixd<Size, 1, Options, MaxRows, MaxCols>>;
|
||||
|
||||
static frc::Matrixd<Size, 1, Options, MaxRows, MaxCols> Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufVector*>(&msg);
|
||||
if (m->rows_size() != Size) {
|
||||
throw std::invalid_argument(
|
||||
fmt::format("Tried to unpack message with {} elements in rows into "
|
||||
"Vector with {} rows",
|
||||
m->rows_size(), Size));
|
||||
static std::optional<frc::Matrixd<Size, 1, Options, MaxRows, MaxCols>> Unpack(
|
||||
InputStream& stream) {
|
||||
constexpr bool isSmall = Size * sizeof(double) < 256;
|
||||
using UnpackType =
|
||||
std::conditional_t<isSmall, wpi::UnpackCallback<double, Size>,
|
||||
wpi::StdVectorUnpackCallback<double, Size>>;
|
||||
UnpackType rows;
|
||||
rows.Vec().reserve(Size);
|
||||
rows.SetLimits(wpi::DecodeLimits::Fail);
|
||||
wpi_proto_ProtobufVector msg{
|
||||
.rows = rows.Callback(),
|
||||
};
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
frc::Matrixd<Size, 1, Options, MaxRows, MaxCols> vec;
|
||||
|
||||
auto items = rows.Items();
|
||||
|
||||
if (items.size() != Size) {
|
||||
return {};
|
||||
}
|
||||
|
||||
frc::Matrixd<Size, 1, Options, MaxRows, MaxCols> mat;
|
||||
for (int i = 0; i < Size; i++) {
|
||||
vec(i) = m->rows(i);
|
||||
mat(i) = items[i];
|
||||
}
|
||||
return vec;
|
||||
|
||||
return mat;
|
||||
}
|
||||
|
||||
static void Pack(
|
||||
google::protobuf::Message* msg,
|
||||
static bool Pack(
|
||||
OutputStream& stream,
|
||||
const frc::Matrixd<Size, 1, Options, MaxRows, MaxCols>& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufVector*>(msg);
|
||||
m->clear_rows();
|
||||
for (int i = 0; i < Size; i++) {
|
||||
m->add_rows(value(i));
|
||||
}
|
||||
std::span<const double> rowsSpan{value.data(), static_cast<size_t>(Size)};
|
||||
wpi::PackCallback<double> rows{rowsSpan};
|
||||
wpi_proto_ProtobufVector msg{
|
||||
.rows = rows.Callback(),
|
||||
};
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -8,11 +8,13 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/spline/CubicHermiteSpline.h"
|
||||
#include "wpimath/protobuf/spline.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::CubicHermiteSpline> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::CubicHermiteSpline Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
const frc::CubicHermiteSpline& value);
|
||||
using MessageStruct = wpi_proto_ProtobufCubicHermiteSpline;
|
||||
using InputStream = wpi::ProtoInputStream<frc::CubicHermiteSpline>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::CubicHermiteSpline>;
|
||||
static std::optional<frc::CubicHermiteSpline> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream, const frc::CubicHermiteSpline& value);
|
||||
};
|
||||
|
||||
@@ -8,11 +8,14 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/spline/QuinticHermiteSpline.h"
|
||||
#include "wpimath/protobuf/spline.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::QuinticHermiteSpline> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::QuinticHermiteSpline Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
using MessageStruct = wpi_proto_ProtobufQuinticHermiteSpline;
|
||||
using InputStream = wpi::ProtoInputStream<frc::QuinticHermiteSpline>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::QuinticHermiteSpline>;
|
||||
static std::optional<frc::QuinticHermiteSpline> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream,
|
||||
const frc::QuinticHermiteSpline& value);
|
||||
};
|
||||
|
||||
@@ -8,10 +8,13 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/system/plant/DCMotor.h"
|
||||
#include "wpimath/protobuf/plant.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::DCMotor> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::DCMotor Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg, const frc::DCMotor& value);
|
||||
using MessageStruct = wpi_proto_ProtobufDCMotor;
|
||||
using InputStream = wpi::ProtoInputStream<frc::DCMotor>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::DCMotor>;
|
||||
static std::optional<frc::DCMotor> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream, const frc::DCMotor& value);
|
||||
};
|
||||
|
||||
@@ -5,48 +5,84 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdexcept>
|
||||
#include <utility>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/ProtoHelper.h>
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
#include <wpi/protobuf/ProtobufCallbacks.h>
|
||||
|
||||
#include "frc/proto/MatrixProto.h"
|
||||
#include "frc/system/LinearSystem.h"
|
||||
#include "system.pb.h"
|
||||
#include "wpimath/protobuf/system.npb.h"
|
||||
|
||||
template <int States, int Inputs, int Outputs>
|
||||
struct wpi::Protobuf<frc::LinearSystem<States, Inputs, Outputs>> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena) {
|
||||
return wpi::CreateMessage<wpi::proto::ProtobufLinearSystem>(arena);
|
||||
}
|
||||
using MessageStruct = wpi_proto_ProtobufLinearSystem;
|
||||
using InputStream =
|
||||
wpi::ProtoInputStream<frc::LinearSystem<States, Inputs, Outputs>>;
|
||||
using OutputStream =
|
||||
wpi::ProtoOutputStream<frc::LinearSystem<States, Inputs, Outputs>>;
|
||||
|
||||
static frc::LinearSystem<States, Inputs, Outputs> Unpack(
|
||||
const google::protobuf::Message& msg) {
|
||||
auto m = static_cast<const wpi::proto::ProtobufLinearSystem*>(&msg);
|
||||
if (m->num_states() != States || m->num_inputs() != Inputs ||
|
||||
m->num_outputs() != Outputs) {
|
||||
throw std::invalid_argument(fmt::format(
|
||||
"Tried to unpack message with {} states and {} inputs and {} outputs "
|
||||
"into LinearSystem with {} states and {} inputs and {} outputs",
|
||||
m->num_states(), m->num_inputs(), m->num_outputs(), States, Inputs,
|
||||
Outputs));
|
||||
static std::optional<frc::LinearSystem<States, Inputs, Outputs>> Unpack(
|
||||
InputStream& stream) {
|
||||
wpi::UnpackCallback<frc::Matrixd<States, States>> a;
|
||||
a.SetLimits(wpi::DecodeLimits::Fail);
|
||||
wpi::UnpackCallback<frc::Matrixd<States, Inputs>> b;
|
||||
a.SetLimits(wpi::DecodeLimits::Fail);
|
||||
wpi::UnpackCallback<frc::Matrixd<Outputs, States>> c;
|
||||
a.SetLimits(wpi::DecodeLimits::Fail);
|
||||
wpi::UnpackCallback<frc::Matrixd<Outputs, Inputs>> d;
|
||||
a.SetLimits(wpi::DecodeLimits::Fail);
|
||||
|
||||
wpi_proto_ProtobufLinearSystem msg;
|
||||
msg.a = a.Callback();
|
||||
msg.b = b.Callback();
|
||||
msg.c = c.Callback();
|
||||
msg.d = d.Callback();
|
||||
|
||||
if (!stream.Decode(msg)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
if (msg.num_inputs != Inputs || msg.num_outputs != Outputs ||
|
||||
msg.num_states != States) {
|
||||
return {};
|
||||
}
|
||||
|
||||
auto ai = a.Items();
|
||||
auto bi = b.Items();
|
||||
auto ci = c.Items();
|
||||
auto di = d.Items();
|
||||
|
||||
if (ai.empty() || bi.empty() || ci.empty() || di.empty()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return frc::LinearSystem<States, Inputs, Outputs>{
|
||||
wpi::UnpackProtobuf<frc::Matrixd<States, States>>(m->wpi_a()),
|
||||
wpi::UnpackProtobuf<frc::Matrixd<States, Inputs>>(m->wpi_b()),
|
||||
wpi::UnpackProtobuf<frc::Matrixd<Outputs, States>>(m->wpi_c()),
|
||||
wpi::UnpackProtobuf<frc::Matrixd<Outputs, Inputs>>(m->wpi_d())};
|
||||
std::move(ai[0]),
|
||||
std::move(bi[0]),
|
||||
std::move(ci[0]),
|
||||
std::move(di[0]),
|
||||
};
|
||||
}
|
||||
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
static bool Pack(OutputStream& stream,
|
||||
const frc::LinearSystem<States, Inputs, Outputs>& value) {
|
||||
auto m = static_cast<wpi::proto::ProtobufLinearSystem*>(msg);
|
||||
m->set_num_states(States);
|
||||
m->set_num_inputs(Inputs);
|
||||
m->set_num_outputs(Outputs);
|
||||
wpi::PackProtobuf(m->mutable_a(), value.A());
|
||||
wpi::PackProtobuf(m->mutable_b(), value.B());
|
||||
wpi::PackProtobuf(m->mutable_c(), value.C());
|
||||
wpi::PackProtobuf(m->mutable_d(), value.D());
|
||||
wpi::PackCallback a{&value.A()};
|
||||
wpi::PackCallback b{&value.B()};
|
||||
wpi::PackCallback c{&value.C()};
|
||||
wpi::PackCallback d{&value.D()};
|
||||
|
||||
wpi_proto_ProtobufLinearSystem msg{
|
||||
.num_states = States,
|
||||
.num_inputs = Inputs,
|
||||
.num_outputs = Outputs,
|
||||
.a = a.Callback(),
|
||||
.b = b.Callback(),
|
||||
.c = c.Callback(),
|
||||
.d = d.Callback(),
|
||||
};
|
||||
|
||||
return stream.Encode(msg);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -8,11 +8,13 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/trajectory/Trajectory.h"
|
||||
#include "wpimath/protobuf/trajectory.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::Trajectory> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::Trajectory Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
const frc::Trajectory& value);
|
||||
using MessageStruct = wpi_proto_ProtobufTrajectory;
|
||||
using InputStream = wpi::ProtoInputStream<frc::Trajectory>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::Trajectory>;
|
||||
static std::optional<frc::Trajectory> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream, const frc::Trajectory& value);
|
||||
};
|
||||
|
||||
@@ -8,11 +8,13 @@
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
#include "frc/trajectory/Trajectory.h"
|
||||
#include "wpimath/protobuf/trajectory.npb.h"
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Protobuf<frc::Trajectory::State> {
|
||||
static google::protobuf::Message* New(google::protobuf::Arena* arena);
|
||||
static frc::Trajectory::State Unpack(const google::protobuf::Message& msg);
|
||||
static void Pack(google::protobuf::Message* msg,
|
||||
const frc::Trajectory::State& value);
|
||||
using MessageStruct = wpi_proto_ProtobufTrajectoryState;
|
||||
using InputStream = wpi::ProtoInputStream<frc::Trajectory::State>;
|
||||
using OutputStream = wpi::ProtoOutputStream<frc::Trajectory::State>;
|
||||
static std::optional<frc::Trajectory::State> Unpack(InputStream& stream);
|
||||
static bool Pack(OutputStream& stream, const frc::Trajectory::State& value);
|
||||
};
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <google/protobuf/arena.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
#include <wpi/protobuf/Protobuf.h>
|
||||
|
||||
template <typename T>
|
||||
@@ -14,41 +14,14 @@ class ProtoTest : public testing::Test {};
|
||||
TYPED_TEST_SUITE_P(ProtoTest);
|
||||
|
||||
TYPED_TEST_P(ProtoTest, RoundTrip) {
|
||||
using Type = typename TypeParam::Type;
|
||||
google::protobuf::Arena arena;
|
||||
google::protobuf::Message* proto = wpi::Protobuf<Type>::New(&arena);
|
||||
wpi::PackProtobuf(proto, TypeParam::kTestData);
|
||||
wpi::ProtobufMessage<decltype(TypeParam::kTestData)> message;
|
||||
wpi::SmallVector<uint8_t, 64> buf;
|
||||
|
||||
Type unpacked_data = wpi::UnpackProtobuf<Type>(*proto);
|
||||
TypeParam::CheckEq(TypeParam::kTestData, unpacked_data);
|
||||
ASSERT_TRUE(message.Pack(buf, TypeParam::kTestData));
|
||||
auto unpacked_data = message.Unpack(buf);
|
||||
ASSERT_TRUE(unpacked_data.has_value());
|
||||
|
||||
TypeParam::CheckEq(TypeParam::kTestData, *unpacked_data);
|
||||
}
|
||||
|
||||
TYPED_TEST_P(ProtoTest, DoublePack) {
|
||||
using Type = typename TypeParam::Type;
|
||||
google::protobuf::Arena arena;
|
||||
google::protobuf::Message* proto = wpi::Protobuf<Type>::New(&arena);
|
||||
wpi::PackProtobuf(proto, TypeParam::kTestData);
|
||||
wpi::PackProtobuf(proto, TypeParam::kTestData);
|
||||
|
||||
Type unpacked_data = wpi::UnpackProtobuf<Type>(*proto);
|
||||
TypeParam::CheckEq(TypeParam::kTestData, unpacked_data);
|
||||
}
|
||||
|
||||
TYPED_TEST_P(ProtoTest, DoubleUnpack) {
|
||||
using Type = typename TypeParam::Type;
|
||||
google::protobuf::Arena arena;
|
||||
google::protobuf::Message* proto = wpi::Protobuf<Type>::New(&arena);
|
||||
wpi::PackProtobuf(proto, TypeParam::kTestData);
|
||||
|
||||
{
|
||||
Type unpacked_data = wpi::UnpackProtobuf<Type>(*proto);
|
||||
TypeParam::CheckEq(TypeParam::kTestData, unpacked_data);
|
||||
}
|
||||
|
||||
{
|
||||
Type unpacked_data = wpi::UnpackProtobuf<Type>(*proto);
|
||||
TypeParam::CheckEq(TypeParam::kTestData, unpacked_data);
|
||||
}
|
||||
}
|
||||
|
||||
REGISTER_TYPED_TEST_SUITE_P(ProtoTest, RoundTrip, DoublePack, DoubleUnpack);
|
||||
REGISTER_TYPED_TEST_SUITE_P(ProtoTest, RoundTrip);
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include <google/protobuf/arena.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
|
||||
#include "frc/controller/ArmFeedforward.h"
|
||||
|
||||
@@ -11,8 +11,6 @@ using namespace frc;
|
||||
|
||||
namespace {
|
||||
|
||||
using ProtoType = wpi::Protobuf<frc::ArmFeedforward>;
|
||||
|
||||
static constexpr auto Ks = 1.91_V;
|
||||
static constexpr auto Kg = 2.29_V;
|
||||
static constexpr auto Kv = 35.04_V * 1_s / 1_rad;
|
||||
@@ -21,13 +19,15 @@ const ArmFeedforward kExpectedData{Ks, Kg, Kv, Ka};
|
||||
} // namespace
|
||||
|
||||
TEST(ArmFeedforwardProtoTest, Roundtrip) {
|
||||
google::protobuf::Arena arena;
|
||||
google::protobuf::Message* proto = ProtoType::New(&arena);
|
||||
ProtoType::Pack(proto, kExpectedData);
|
||||
wpi::ProtobufMessage<decltype(kExpectedData)> message;
|
||||
wpi::SmallVector<uint8_t, 64> buf;
|
||||
|
||||
ArmFeedforward unpacked_data = ProtoType::Unpack(*proto);
|
||||
EXPECT_EQ(kExpectedData.GetKs().value(), unpacked_data.GetKs().value());
|
||||
EXPECT_EQ(kExpectedData.GetKg().value(), unpacked_data.GetKg().value());
|
||||
EXPECT_EQ(kExpectedData.GetKv().value(), unpacked_data.GetKv().value());
|
||||
EXPECT_EQ(kExpectedData.GetKa().value(), unpacked_data.GetKa().value());
|
||||
ASSERT_TRUE(message.Pack(buf, kExpectedData));
|
||||
auto unpacked_data = message.Unpack(buf);
|
||||
ASSERT_TRUE(unpacked_data.has_value());
|
||||
|
||||
EXPECT_EQ(kExpectedData.GetKs().value(), unpacked_data->GetKs().value());
|
||||
EXPECT_EQ(kExpectedData.GetKg().value(), unpacked_data->GetKg().value());
|
||||
EXPECT_EQ(kExpectedData.GetKv().value(), unpacked_data->GetKv().value());
|
||||
EXPECT_EQ(kExpectedData.GetKa().value(), unpacked_data->GetKa().value());
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include <google/protobuf/arena.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
|
||||
#include "frc/controller/DifferentialDriveWheelVoltages.h"
|
||||
|
||||
@@ -18,11 +18,12 @@ const DifferentialDriveWheelVoltages kExpectedData =
|
||||
} // namespace
|
||||
|
||||
TEST(DifferentialDriveWheelVoltagesProtoTest, Roundtrip) {
|
||||
google::protobuf::Arena arena;
|
||||
google::protobuf::Message* proto = ProtoType::New(&arena);
|
||||
ProtoType::Pack(proto, kExpectedData);
|
||||
wpi::ProtobufMessage<decltype(kExpectedData)> message;
|
||||
wpi::SmallVector<uint8_t, 64> buf;
|
||||
|
||||
DifferentialDriveWheelVoltages unpacked_data = ProtoType::Unpack(*proto);
|
||||
EXPECT_EQ(kExpectedData.left.value(), unpacked_data.left.value());
|
||||
EXPECT_EQ(kExpectedData.right.value(), unpacked_data.right.value());
|
||||
ASSERT_TRUE(message.Pack(buf, kExpectedData));
|
||||
auto unpacked_data = message.Unpack(buf);
|
||||
ASSERT_TRUE(unpacked_data.has_value());
|
||||
EXPECT_EQ(kExpectedData.left.value(), unpacked_data->left.value());
|
||||
EXPECT_EQ(kExpectedData.right.value(), unpacked_data->right.value());
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include <google/protobuf/arena.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
|
||||
#include "frc/controller/ElevatorFeedforward.h"
|
||||
|
||||
@@ -11,8 +11,6 @@ using namespace frc;
|
||||
|
||||
namespace {
|
||||
|
||||
using ProtoType = wpi::Protobuf<frc::ElevatorFeedforward>;
|
||||
|
||||
static constexpr auto Ks = 1.91_V;
|
||||
static constexpr auto Kg = 2.29_V;
|
||||
static constexpr auto Kv = 35.04_V * 1_s / 1_m;
|
||||
@@ -22,13 +20,15 @@ constexpr ElevatorFeedforward kExpectedData{Ks, Kg, Kv, Ka};
|
||||
} // namespace
|
||||
|
||||
TEST(ElevatorFeedforwardProtoTest, Roundtrip) {
|
||||
google::protobuf::Arena arena;
|
||||
google::protobuf::Message* proto = ProtoType::New(&arena);
|
||||
ProtoType::Pack(proto, kExpectedData);
|
||||
wpi::ProtobufMessage<decltype(kExpectedData)> message;
|
||||
wpi::SmallVector<uint8_t, 64> buf;
|
||||
|
||||
ElevatorFeedforward unpacked_data = ProtoType::Unpack(*proto);
|
||||
EXPECT_EQ(kExpectedData.GetKs().value(), unpacked_data.GetKs().value());
|
||||
EXPECT_EQ(kExpectedData.GetKg().value(), unpacked_data.GetKg().value());
|
||||
EXPECT_EQ(kExpectedData.GetKv().value(), unpacked_data.GetKv().value());
|
||||
EXPECT_EQ(kExpectedData.GetKa().value(), unpacked_data.GetKa().value());
|
||||
ASSERT_TRUE(message.Pack(buf, kExpectedData));
|
||||
auto unpacked_data = message.Unpack(buf);
|
||||
ASSERT_TRUE(unpacked_data.has_value());
|
||||
|
||||
EXPECT_EQ(kExpectedData.GetKs().value(), unpacked_data->GetKs().value());
|
||||
EXPECT_EQ(kExpectedData.GetKg().value(), unpacked_data->GetKg().value());
|
||||
EXPECT_EQ(kExpectedData.GetKv().value(), unpacked_data->GetKv().value());
|
||||
EXPECT_EQ(kExpectedData.GetKa().value(), unpacked_data->GetKa().value());
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include <google/protobuf/arena.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
|
||||
#include "frc/geometry/Ellipse2d.h"
|
||||
|
||||
@@ -11,19 +11,19 @@ using namespace frc;
|
||||
|
||||
namespace {
|
||||
|
||||
using ProtoType = wpi::Protobuf<frc::Ellipse2d>;
|
||||
|
||||
const Ellipse2d kExpectedData{
|
||||
Pose2d{Translation2d{0.191_m, 2.2_m}, Rotation2d{22.9_rad}}, 1.2_m, 2.3_m};
|
||||
} // namespace
|
||||
|
||||
TEST(Ellipse2dProtoTest, Roundtrip) {
|
||||
google::protobuf::Arena arena;
|
||||
google::protobuf::Message* proto = ProtoType::New(&arena);
|
||||
ProtoType::Pack(proto, kExpectedData);
|
||||
wpi::ProtobufMessage<decltype(kExpectedData)> message;
|
||||
wpi::SmallVector<uint8_t, 64> buf;
|
||||
|
||||
Ellipse2d unpacked_data = ProtoType::Unpack(*proto);
|
||||
EXPECT_EQ(kExpectedData.Center(), unpacked_data.Center());
|
||||
EXPECT_EQ(kExpectedData.XSemiAxis(), unpacked_data.XSemiAxis());
|
||||
EXPECT_EQ(kExpectedData.YSemiAxis(), unpacked_data.YSemiAxis());
|
||||
ASSERT_TRUE(message.Pack(buf, kExpectedData));
|
||||
auto unpacked_data = message.Unpack(buf);
|
||||
ASSERT_TRUE(unpacked_data.has_value());
|
||||
|
||||
EXPECT_EQ(kExpectedData.Center(), unpacked_data->Center());
|
||||
EXPECT_EQ(kExpectedData.XSemiAxis(), unpacked_data->XSemiAxis());
|
||||
EXPECT_EQ(kExpectedData.YSemiAxis(), unpacked_data->YSemiAxis());
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include <google/protobuf/arena.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
|
||||
#include "frc/geometry/Pose2d.h"
|
||||
|
||||
@@ -11,18 +11,18 @@ using namespace frc;
|
||||
|
||||
namespace {
|
||||
|
||||
using ProtoType = wpi::Protobuf<frc::Pose2d>;
|
||||
|
||||
const Pose2d kExpectedData =
|
||||
Pose2d{Translation2d{0.191_m, 2.2_m}, Rotation2d{22.9_rad}};
|
||||
} // namespace
|
||||
|
||||
TEST(Pose2dProtoTest, Roundtrip) {
|
||||
google::protobuf::Arena arena;
|
||||
google::protobuf::Message* proto = ProtoType::New(&arena);
|
||||
ProtoType::Pack(proto, kExpectedData);
|
||||
wpi::ProtobufMessage<decltype(kExpectedData)> message;
|
||||
wpi::SmallVector<uint8_t, 64> buf;
|
||||
|
||||
Pose2d unpacked_data = ProtoType::Unpack(*proto);
|
||||
EXPECT_EQ(kExpectedData.Translation(), unpacked_data.Translation());
|
||||
EXPECT_EQ(kExpectedData.Rotation(), unpacked_data.Rotation());
|
||||
ASSERT_TRUE(message.Pack(buf, kExpectedData));
|
||||
auto unpacked_data = message.Unpack(buf);
|
||||
ASSERT_TRUE(unpacked_data.has_value());
|
||||
|
||||
EXPECT_EQ(kExpectedData.Translation(), unpacked_data->Translation());
|
||||
EXPECT_EQ(kExpectedData.Rotation(), unpacked_data->Rotation());
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include <google/protobuf/arena.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
|
||||
#include "frc/geometry/Pose3d.h"
|
||||
|
||||
@@ -11,19 +11,19 @@ using namespace frc;
|
||||
|
||||
namespace {
|
||||
|
||||
using ProtoType = wpi::Protobuf<frc::Pose3d>;
|
||||
|
||||
const Pose3d kExpectedData =
|
||||
Pose3d{Translation3d{1.1_m, 2.2_m, 1.1_m},
|
||||
Rotation3d{Quaternion{1.91, 0.3504, 3.3, 1.74}}};
|
||||
} // namespace
|
||||
|
||||
TEST(Pose3dProtoTest, Roundtrip) {
|
||||
google::protobuf::Arena arena;
|
||||
google::protobuf::Message* proto = ProtoType::New(&arena);
|
||||
ProtoType::Pack(proto, kExpectedData);
|
||||
wpi::ProtobufMessage<decltype(kExpectedData)> message;
|
||||
wpi::SmallVector<uint8_t, 64> buf;
|
||||
|
||||
Pose3d unpacked_data = ProtoType::Unpack(*proto);
|
||||
EXPECT_EQ(kExpectedData.Translation(), unpacked_data.Translation());
|
||||
EXPECT_EQ(kExpectedData.Rotation(), unpacked_data.Rotation());
|
||||
ASSERT_TRUE(message.Pack(buf, kExpectedData));
|
||||
auto unpacked_data = message.Unpack(buf);
|
||||
ASSERT_TRUE(unpacked_data.has_value());
|
||||
|
||||
EXPECT_EQ(kExpectedData.Translation(), unpacked_data->Translation());
|
||||
EXPECT_EQ(kExpectedData.Rotation(), unpacked_data->Rotation());
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include <google/protobuf/arena.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
|
||||
#include "frc/geometry/Quaternion.h"
|
||||
|
||||
@@ -11,19 +11,19 @@ using namespace frc;
|
||||
|
||||
namespace {
|
||||
|
||||
using ProtoType = wpi::Protobuf<frc::Quaternion>;
|
||||
|
||||
const Quaternion kExpectedData = Quaternion{1.1, 0.191, 35.04, 19.1};
|
||||
} // namespace
|
||||
|
||||
TEST(QuaternionProtoTest, Roundtrip) {
|
||||
google::protobuf::Arena arena;
|
||||
google::protobuf::Message* proto = ProtoType::New(&arena);
|
||||
ProtoType::Pack(proto, kExpectedData);
|
||||
wpi::ProtobufMessage<decltype(kExpectedData)> message;
|
||||
wpi::SmallVector<uint8_t, 64> buf;
|
||||
|
||||
Quaternion unpacked_data = ProtoType::Unpack(*proto);
|
||||
EXPECT_EQ(kExpectedData.W(), unpacked_data.W());
|
||||
EXPECT_EQ(kExpectedData.X(), unpacked_data.X());
|
||||
EXPECT_EQ(kExpectedData.Y(), unpacked_data.Y());
|
||||
EXPECT_EQ(kExpectedData.Z(), unpacked_data.Z());
|
||||
ASSERT_TRUE(message.Pack(buf, kExpectedData));
|
||||
auto unpacked_data = message.Unpack(buf);
|
||||
ASSERT_TRUE(unpacked_data.has_value());
|
||||
|
||||
EXPECT_EQ(kExpectedData.W(), unpacked_data->W());
|
||||
EXPECT_EQ(kExpectedData.X(), unpacked_data->X());
|
||||
EXPECT_EQ(kExpectedData.Y(), unpacked_data->Y());
|
||||
EXPECT_EQ(kExpectedData.Z(), unpacked_data->Z());
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include <google/protobuf/arena.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
|
||||
#include "frc/geometry/Rectangle2d.h"
|
||||
|
||||
@@ -11,19 +11,19 @@ using namespace frc;
|
||||
|
||||
namespace {
|
||||
|
||||
using ProtoType = wpi::Protobuf<frc::Rectangle2d>;
|
||||
|
||||
const Rectangle2d kExpectedData{
|
||||
Pose2d{Translation2d{0.191_m, 2.2_m}, Rotation2d{22.9_rad}}, 1.2_m, 2.3_m};
|
||||
} // namespace
|
||||
|
||||
TEST(Rectangle2dProtoTest, Roundtrip) {
|
||||
google::protobuf::Arena arena;
|
||||
google::protobuf::Message* proto = ProtoType::New(&arena);
|
||||
ProtoType::Pack(proto, kExpectedData);
|
||||
wpi::ProtobufMessage<decltype(kExpectedData)> message;
|
||||
wpi::SmallVector<uint8_t, 64> buf;
|
||||
|
||||
Rectangle2d unpacked_data = ProtoType::Unpack(*proto);
|
||||
EXPECT_EQ(kExpectedData.Center(), unpacked_data.Center());
|
||||
EXPECT_EQ(kExpectedData.XWidth(), unpacked_data.XWidth());
|
||||
EXPECT_EQ(kExpectedData.YWidth(), unpacked_data.YWidth());
|
||||
ASSERT_TRUE(message.Pack(buf, kExpectedData));
|
||||
auto unpacked_data = message.Unpack(buf);
|
||||
ASSERT_TRUE(unpacked_data.has_value());
|
||||
|
||||
EXPECT_EQ(kExpectedData.Center(), unpacked_data->Center());
|
||||
EXPECT_EQ(kExpectedData.XWidth(), unpacked_data->XWidth());
|
||||
EXPECT_EQ(kExpectedData.YWidth(), unpacked_data->YWidth());
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include <google/protobuf/arena.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
|
||||
#include "frc/geometry/Rotation2d.h"
|
||||
|
||||
@@ -11,16 +11,15 @@ using namespace frc;
|
||||
|
||||
namespace {
|
||||
|
||||
using ProtoType = wpi::Protobuf<frc::Rotation2d>;
|
||||
|
||||
const Rotation2d kExpectedData = Rotation2d{1.91_rad};
|
||||
} // namespace
|
||||
|
||||
TEST(Rotation2dProtoTest, Roundtrip) {
|
||||
google::protobuf::Arena arena;
|
||||
google::protobuf::Message* proto = ProtoType::New(&arena);
|
||||
ProtoType::Pack(proto, kExpectedData);
|
||||
wpi::ProtobufMessage<decltype(kExpectedData)> message;
|
||||
wpi::SmallVector<uint8_t, 64> buf;
|
||||
|
||||
Rotation2d unpacked_data = ProtoType::Unpack(*proto);
|
||||
EXPECT_EQ(kExpectedData.Radians().value(), unpacked_data.Radians().value());
|
||||
ASSERT_TRUE(message.Pack(buf, kExpectedData));
|
||||
auto unpacked_data = message.Unpack(buf);
|
||||
ASSERT_TRUE(unpacked_data.has_value());
|
||||
EXPECT_EQ(kExpectedData.Radians().value(), unpacked_data->Radians().value());
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include <google/protobuf/arena.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
|
||||
#include "frc/geometry/Rotation3d.h"
|
||||
|
||||
@@ -11,17 +11,17 @@ using namespace frc;
|
||||
|
||||
namespace {
|
||||
|
||||
using ProtoType = wpi::Protobuf<frc::Rotation3d>;
|
||||
|
||||
const Rotation3d kExpectedData =
|
||||
Rotation3d{Quaternion{2.29, 0.191, 0.191, 17.4}};
|
||||
} // namespace
|
||||
|
||||
TEST(Rotation3dProtoTest, Roundtrip) {
|
||||
google::protobuf::Arena arena;
|
||||
google::protobuf::Message* proto = ProtoType::New(&arena);
|
||||
ProtoType::Pack(proto, kExpectedData);
|
||||
wpi::ProtobufMessage<decltype(kExpectedData)> message;
|
||||
wpi::SmallVector<uint8_t, 64> buf;
|
||||
|
||||
Rotation3d unpacked_data = ProtoType::Unpack(*proto);
|
||||
EXPECT_EQ(kExpectedData.GetQuaternion(), unpacked_data.GetQuaternion());
|
||||
ASSERT_TRUE(message.Pack(buf, kExpectedData));
|
||||
auto unpacked_data = message.Unpack(buf);
|
||||
ASSERT_TRUE(unpacked_data.has_value());
|
||||
|
||||
EXPECT_EQ(kExpectedData.GetQuaternion(), unpacked_data->GetQuaternion());
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include <google/protobuf/arena.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
|
||||
#include "frc/geometry/Transform2d.h"
|
||||
|
||||
@@ -11,18 +11,18 @@ using namespace frc;
|
||||
|
||||
namespace {
|
||||
|
||||
using ProtoType = wpi::Protobuf<frc::Transform2d>;
|
||||
|
||||
const Transform2d kExpectedData =
|
||||
Transform2d{Translation2d{0.191_m, 2.2_m}, Rotation2d{4.4_rad}};
|
||||
} // namespace
|
||||
|
||||
TEST(Transform2dProtoTest, Roundtrip) {
|
||||
google::protobuf::Arena arena;
|
||||
google::protobuf::Message* proto = ProtoType::New(&arena);
|
||||
ProtoType::Pack(proto, kExpectedData);
|
||||
wpi::ProtobufMessage<decltype(kExpectedData)> message;
|
||||
wpi::SmallVector<uint8_t, 64> buf;
|
||||
|
||||
Transform2d unpacked_data = ProtoType::Unpack(*proto);
|
||||
EXPECT_EQ(kExpectedData.Translation(), unpacked_data.Translation());
|
||||
EXPECT_EQ(kExpectedData.Rotation(), unpacked_data.Rotation());
|
||||
ASSERT_TRUE(message.Pack(buf, kExpectedData));
|
||||
auto unpacked_data = message.Unpack(buf);
|
||||
ASSERT_TRUE(unpacked_data.has_value());
|
||||
|
||||
EXPECT_EQ(kExpectedData.Translation(), unpacked_data->Translation());
|
||||
EXPECT_EQ(kExpectedData.Rotation(), unpacked_data->Rotation());
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include <google/protobuf/arena.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
|
||||
#include "frc/geometry/Transform3d.h"
|
||||
|
||||
@@ -11,19 +11,19 @@ using namespace frc;
|
||||
|
||||
namespace {
|
||||
|
||||
using ProtoType = wpi::Protobuf<frc::Transform3d>;
|
||||
|
||||
const Transform3d kExpectedData =
|
||||
Transform3d{Translation3d{0.3504_m, 22.9_m, 3.504_m},
|
||||
Rotation3d{Quaternion{0.3504, 35.04, 2.29, 0.3504}}};
|
||||
} // namespace
|
||||
|
||||
TEST(Transform3dProtoTest, Roundtrip) {
|
||||
google::protobuf::Arena arena;
|
||||
google::protobuf::Message* proto = ProtoType::New(&arena);
|
||||
ProtoType::Pack(proto, kExpectedData);
|
||||
wpi::ProtobufMessage<decltype(kExpectedData)> message;
|
||||
wpi::SmallVector<uint8_t, 64> buf;
|
||||
|
||||
Transform3d unpacked_data = ProtoType::Unpack(*proto);
|
||||
EXPECT_EQ(kExpectedData.Translation(), unpacked_data.Translation());
|
||||
EXPECT_EQ(kExpectedData.Rotation(), unpacked_data.Rotation());
|
||||
ASSERT_TRUE(message.Pack(buf, kExpectedData));
|
||||
auto unpacked_data = message.Unpack(buf);
|
||||
ASSERT_TRUE(unpacked_data.has_value());
|
||||
|
||||
EXPECT_EQ(kExpectedData.Translation(), unpacked_data->Translation());
|
||||
EXPECT_EQ(kExpectedData.Rotation(), unpacked_data->Rotation());
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user