Added protobufs for TS

This commit is contained in:
Niklas Jensen
2025-12-28 22:02:27 +01:00
committed by nikguin04
parent 9ceb7a9919
commit 8e66a03c00
10 changed files with 137 additions and 24 deletions
+46 -10
View File
@@ -1,15 +1,51 @@
{
"files.associations": {
"cmath": "cpp",
"array": "cpp",
"deque": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"string_view": "cpp",
"initializer_list": "cpp",
"regex": "cpp"
"cmath": "cpp",
"array": "cpp",
"deque": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"string_view": "cpp",
"initializer_list": "cpp",
"regex": "cpp",
"list": "cpp",
"memory": "cpp",
"random": "cpp",
"atomic": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"map": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"iosfwd": "cpp",
"istream": "cpp",
"limits": "cpp",
"new": "cpp",
"ostream": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"cinttypes": "cpp",
"typeinfo": "cpp"
},
"editor.tabSize": 4,
"editor.detectIndentation": false,
+6 -6
View File
@@ -1,8 +1,8 @@
declare module 'app-env' {
interface ENV {
VITE_USE_HOST_NAME: boolean
}
declare module "app-env" {
interface ENV {
VITE_USE_HOST_NAME: boolean;
}
const appEnv: ENV
export default appEnv
const appEnv: ENV;
export default appEnv;
}
+2
View File
@@ -48,6 +48,7 @@
},
"type": "module",
"dependencies": {
"@bufbuild/protobuf": "^2.10.2",
"@msgpack/msgpack": "^3.1.2",
"@niku/vite-env-caster": "^1.1.2",
"@sveltejs/adapter-auto": "^6.1.1",
@@ -60,6 +61,7 @@
"svelte-dnd-list": "^0.1.8",
"svelte-modals": "^2.0.1",
"three": "^0.180.0",
"ts-proto": "^2.10.1",
"urdf-loader": "^0.12.6",
"uzip": "^0.20201231.0",
"xacro-parser": "^0.3.10"
+56
View File
@@ -8,6 +8,9 @@ importers:
.:
dependencies:
'@bufbuild/protobuf':
specifier: ^2.10.2
version: 2.10.2
'@msgpack/msgpack':
specifier: ^3.1.2
version: 3.1.2
@@ -44,6 +47,9 @@ importers:
three:
specifier: ^0.180.0
version: 0.180.0
ts-proto:
specifier: ^2.10.1
version: 2.10.1
urdf-loader:
specifier: ^0.12.6
version: 0.12.6(three@0.180.0)
@@ -159,6 +165,9 @@ packages:
'@asamuzakjp/nwsapi@2.3.9':
resolution: {integrity: sha512-n8GuYSrI9bF7FFZ/SjhwevlHc8xaVlb/7HmHelnc/PZXBD2ZR49NnN9sMMuDdEGPeeRQ5d0hqlSlEpgCX3Wl0Q==}
'@bufbuild/protobuf@2.10.2':
resolution: {integrity: sha512-uFsRXwIGyu+r6AMdz+XijIIZJYpoWeYzILt5yZ2d3mCjQrWUTVpVD9WL/jZAbvp+Ed04rOhrsk7FiTcEDseB5A==}
'@csstools/color-helpers@5.1.0':
resolution: {integrity: sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA==}
engines: {node: '>=18'}
@@ -987,6 +996,10 @@ packages:
caniuse-lite@1.0.30001749:
resolution: {integrity: sha512-0rw2fJOmLfnzCRbkm8EyHL8SvI2Apu5UbnQuTsJ0ClgrH8hcwFooJ1s5R0EP8o8aVrFu8++ae29Kt9/gZAZp/Q==}
case-anything@2.1.13:
resolution: {integrity: sha512-zlOQ80VrQ2Ue+ymH5OuM/DlDq64mEm+B9UTdHULv5osUMD6HalNTblf2b1u/m6QecjsnOkBpqVZ+XPwIVsy7Ng==}
engines: {node: '>=12.13'}
chai@5.3.3:
resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==}
engines: {node: '>=18'}
@@ -1094,6 +1107,11 @@ packages:
resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==}
engines: {node: '>=0.10.0'}
detect-libc@1.0.3:
resolution: {integrity: sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==}
engines: {node: '>=0.10'}
hasBin: true
detect-libc@2.1.2:
resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==}
engines: {node: '>=8'}
@@ -1101,6 +1119,9 @@ packages:
devalue@5.3.2:
resolution: {integrity: sha512-UDsjUbpQn9kvm68slnrs+mfxwFkIflOhkanmyabZ8zOYk8SMEIbJ3TK+88g70hSIeytu4y18f0z/hYHMTrXIWw==}
dprint-node@1.0.8:
resolution: {integrity: sha512-iVKnUtYfGrYcW1ZAlfR/F59cUVL8QIhWoBJoSjkkdua/dkWIgjZfiLMeTjiB06X0ZLkQ0M2C1VbUj/CxkIf1zg==}
electron-to-chromium@1.5.234:
resolution: {integrity: sha512-RXfEp2x+VRYn8jbKfQlRImzoJU01kyDvVPBmG39eU2iuRVhuS6vQNocB8J0/8GrIMLnPzgz4eW6WiRnJkTuNWg==}
@@ -1962,6 +1983,16 @@ packages:
peerDependencies:
typescript: '>=4.8.4'
ts-poet@6.12.0:
resolution: {integrity: sha512-xo+iRNMWqyvXpFTaOAvLPA5QAWO6TZrSUs5s4Odaya3epqofBu/fMLHEWl8jPmjhA0s9sgj9sNvF1BmaQlmQkA==}
ts-proto-descriptors@2.1.0:
resolution: {integrity: sha512-S5EZYEQ6L9KLFfjSRpZWDIXDV/W7tAj8uW7pLsihIxyr62EAVSiKuVPwE8iWnr849Bqa53enex1jhDUcpgquzA==}
ts-proto@2.10.1:
resolution: {integrity: sha512-4sOE1hCs0uobJgdRCtcEwdbc8MAyKP+LJqUIKxZIiKac0rPBlVKsRGEGo2oQ1MnKA2Wwk0KuGP2POkiCwPtebw==}
hasBin: true
tslib@2.8.1:
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
@@ -2237,6 +2268,8 @@ snapshots:
'@asamuzakjp/nwsapi@2.3.9': {}
'@bufbuild/protobuf@2.10.2': {}
'@csstools/color-helpers@5.1.0': {}
'@csstools/css-calc@2.1.4(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4)':
@@ -3005,6 +3038,8 @@ snapshots:
caniuse-lite@1.0.30001749: {}
case-anything@2.1.13: {}
chai@5.3.3:
dependencies:
assertion-error: 2.0.1
@@ -3099,10 +3134,16 @@ snapshots:
deepmerge@4.3.1: {}
detect-libc@1.0.3: {}
detect-libc@2.1.2: {}
devalue@5.3.2: {}
dprint-node@1.0.8:
dependencies:
detect-libc: 1.0.3
electron-to-chromium@1.5.234: {}
emoji-regex@8.0.0: {}
@@ -3922,6 +3963,21 @@ snapshots:
dependencies:
typescript: 5.9.3
ts-poet@6.12.0:
dependencies:
dprint-node: 1.0.8
ts-proto-descriptors@2.1.0:
dependencies:
'@bufbuild/protobuf': 2.10.2
ts-proto@2.10.1:
dependencies:
'@bufbuild/protobuf': 2.10.2
case-anything: 2.1.13
ts-poet: 6.12.0
ts-proto-descriptors: 2.1.0
tslib@2.8.1: {}
type-check@0.4.0:
+1 -1
View File
@@ -21,7 +21,7 @@ export default defineConfig({
server: {
proxy: {
'/api': {
target: 'http://spot-micro.local/',
target: 'http://192.168.50.22/',
changeOrigin: true,
ws: true
}
+3
View File
@@ -0,0 +1,3 @@
This file is temporary, just to show how ot compile the proto files
protoc --plugin="protoc-gen-ts_proto=$(Resolve-Path app\node_modules\.bin\protoc-gen-ts_proto.CMD)" --ts_proto_out="./app/proto" "platform_shared\example.proto"
+2 -2
View File
@@ -10,8 +10,8 @@ build_flags =
-D APP_VERSION=\"0.1.0\"
; WiFi settings
-D FACTORY_WIFI_SSID=\"\"
-D FACTORY_WIFI_PASSWORD=\"\"
-D FACTORY_WIFI_SSID=\"Dunder\ Milffin\"
-D FACTORY_WIFI_PASSWORD=\"BodomReaper666\"
-D FACTORY_WIFI_HOSTNAME=\"spot-micro\" ; supports placeholders
; Access point settings
+2 -2
View File
@@ -1,8 +1,8 @@
[features]
build_flags =
; Kinematics - Choose only one
-D SPOTMICRO_ESP32
; -D SPOTMICRO_ESP32_MINI
; -D SPOTMICRO_ESP32
-D SPOTMICRO_ESP32_MINI
; -D SPOTMICRO_YERTLE
; Firmware flags
@@ -14,6 +14,9 @@
#ifndef SCL_PIN
#define SCL_PIN SCL
#endif
// #define STR(x) #x
// #define XSTR(x) STR(x)
// #pragma message ("SDA PIN: " XSTR(SDA_PIN))
#ifndef I2C_FREQUENCY
#define I2C_FREQUENCY 1000000UL
#endif
@@ -42,9 +45,9 @@ class PeripheralsConfiguration {
}
static StateUpdateResult update(JsonVariant &root, PeripheralsConfiguration &settings) {
settings.sda = root["sda"] | SDA_PIN;
settings.scl = root["scl"] | SCL_PIN;
settings.frequency = root["frequency"] | I2C_FREQUENCY;
//settings.sda = root["sda"] | SDA_PIN;
//settings.scl = root["scl"] | SCL_PIN;
//settings.frequency = root["frequency"] | I2C_FREQUENCY;
return StateUpdateResult::CHANGED;
};
};
+13
View File
@@ -0,0 +1,13 @@
syntax = "proto3";
enum IMUType {
IMU_NONE = 0;
IMU_ACCEL = 1;
IMU_GYRO = 2;
}
message IMUReport {
IMUType type = 1;
double x_val = 2;
}