From beffc5d0dd5b12b3fbdaf8d2e309093b916dec00 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 11 Jul 2026 02:18:50 +0000 Subject: [PATCH 1/3] Initial plan From 56f270fee57a07d815e1e10119b32405827ab68b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 11 Jul 2026 02:27:32 +0000 Subject: [PATCH 2/3] Fix evaluator CI: add libeigen3-dev dependency to enable planning_node build --- .github/workflows/ci.yml | 4 +- build_test2/_deps/flowcoro-src | 1 + .../_deps/flowcoro-subbuild/CMakeLists.txt | 42 + .../flowcoro-populate-build | 0 .../flowcoro-populate-configure | 0 .../flowcoro-populate-done | 0 .../flowcoro-populate-download | 0 .../flowcoro-populate-gitclone-lastrun.txt | 15 + .../flowcoro-populate-gitinfo.txt | 15 + .../flowcoro-populate-install | 0 .../flowcoro-populate-mkdir | 0 .../flowcoro-populate-patch | 0 .../flowcoro-populate-patch-info.txt | 6 + .../flowcoro-populate-test | 0 .../flowcoro-populate-update-info.txt | 7 + .../tmp/flowcoro-populate-cfgcmd.txt | 1 + build_test2/config/example.json | 25 + build_test2/flowengine.pc | 11 + build_test2/gen/adas_msgs_gen.h | 1135 +++++++++++++++++ 19 files changed, 1260 insertions(+), 2 deletions(-) create mode 160000 build_test2/_deps/flowcoro-src create mode 100644 build_test2/_deps/flowcoro-subbuild/CMakeLists.txt create mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-build create mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-configure create mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-done create mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-download create mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-gitclone-lastrun.txt create mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-gitinfo.txt create mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-install create mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-mkdir create mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-patch create mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-patch-info.txt create mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-test create mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-update-info.txt create mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/tmp/flowcoro-populate-cfgcmd.txt create mode 100644 build_test2/config/example.json create mode 100644 build_test2/flowengine.pc create mode 100644 build_test2/gen/adas_msgs_gen.h diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e4fb6e..f1fa3a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,7 +124,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install dependencies - run: sudo apt-get update -qq && sudo apt-get install -y -qq libcjson-dev python3 + run: sudo apt-get update -qq && sudo apt-get install -y -qq libcjson-dev python3 libeigen3-dev - name: Configure (Release) run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release - name: Build framework @@ -193,7 +193,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install dependencies - run: sudo apt-get update -qq && sudo apt-get install -y -qq libcjson-dev python3 + run: sudo apt-get update -qq && sudo apt-get install -y -qq libcjson-dev python3 libeigen3-dev - name: Configure (Release) run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release - name: Build framework diff --git a/build_test2/_deps/flowcoro-src b/build_test2/_deps/flowcoro-src new file mode 160000 index 0000000..0934b6f --- /dev/null +++ b/build_test2/_deps/flowcoro-src @@ -0,0 +1 @@ +Subproject commit 0934b6f22cf75bc12ca2c60caaaf78519bf4921c diff --git a/build_test2/_deps/flowcoro-subbuild/CMakeLists.txt b/build_test2/_deps/flowcoro-subbuild/CMakeLists.txt new file mode 100644 index 0000000..9fab5a5 --- /dev/null +++ b/build_test2/_deps/flowcoro-subbuild/CMakeLists.txt @@ -0,0 +1,42 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +cmake_minimum_required(VERSION 3.31.6) + +# Reject any attempt to use a toolchain file. We must not use one because +# we could be downloading it here. If the CMAKE_TOOLCHAIN_FILE environment +# variable is set, the cache variable will have been initialized from it. +unset(CMAKE_TOOLCHAIN_FILE CACHE) +unset(ENV{CMAKE_TOOLCHAIN_FILE}) + +# We name the project and the target for the ExternalProject_Add() call +# to something that will highlight to the user what we are working on if +# something goes wrong and an error message is produced. + +project(flowcoro-populate NONE) + + +# Pass through things we've already detected in the main project to avoid +# paying the cost of redetecting them again in ExternalProject_Add() +set(GIT_EXECUTABLE [==[/usr/bin/git]==]) +set(GIT_VERSION_STRING [==[2.54.0]==]) +set_property(GLOBAL PROPERTY _CMAKE_FindGit_GIT_EXECUTABLE_VERSION + [==[/usr/bin/git;2.54.0]==] +) + + +include(ExternalProject) +ExternalProject_Add(flowcoro-populate + "UPDATE_DISCONNECTED" "False" "GIT_REPOSITORY" "https://github.com/caixuf/flowcoro.git" "EXTERNALPROJECT_INTERNAL_ARGUMENT_SEPARATOR" "GIT_TAG" "0934b6f22cf75bc12ca2c60caaaf78519bf4921c" "GIT_SHALLOW" "TRUE" + SOURCE_DIR "/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps/flowcoro-src" + BINARY_DIR "/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps/flowcoro-build" + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" + TEST_COMMAND "" + USES_TERMINAL_DOWNLOAD YES + USES_TERMINAL_UPDATE YES + USES_TERMINAL_PATCH YES +) + + diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-build b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-build new file mode 100644 index 0000000..e69de29 diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-configure b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-configure new file mode 100644 index 0000000..e69de29 diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-done b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-done new file mode 100644 index 0000000..e69de29 diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-download b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-download new file mode 100644 index 0000000..e69de29 diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-gitclone-lastrun.txt b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-gitclone-lastrun.txt new file mode 100644 index 0000000..c01e4b1 --- /dev/null +++ b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-gitclone-lastrun.txt @@ -0,0 +1,15 @@ +# This is a generated file and its contents are an internal implementation detail. +# The download step will be re-executed if anything in this file changes. +# No other meaning or use of this file is supported. + +method=git +command=/usr/local/bin/cmake;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE;-P;/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/tmp/flowcoro-populate-gitclone.cmake +source_dir=/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps/flowcoro-src +work_dir=/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps +repository=https://github.com/caixuf/flowcoro.git +remote=origin +init_submodules=TRUE +recurse_submodules=--recursive +submodules= +CMP0097=NEW + diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-gitinfo.txt b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-gitinfo.txt new file mode 100644 index 0000000..c01e4b1 --- /dev/null +++ b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-gitinfo.txt @@ -0,0 +1,15 @@ +# This is a generated file and its contents are an internal implementation detail. +# The download step will be re-executed if anything in this file changes. +# No other meaning or use of this file is supported. + +method=git +command=/usr/local/bin/cmake;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE;-P;/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/tmp/flowcoro-populate-gitclone.cmake +source_dir=/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps/flowcoro-src +work_dir=/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps +repository=https://github.com/caixuf/flowcoro.git +remote=origin +init_submodules=TRUE +recurse_submodules=--recursive +submodules= +CMP0097=NEW + diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-install b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-install new file mode 100644 index 0000000..e69de29 diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-mkdir b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-mkdir new file mode 100644 index 0000000..e69de29 diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-patch b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-patch new file mode 100644 index 0000000..e69de29 diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-patch-info.txt b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-patch-info.txt new file mode 100644 index 0000000..53e1e1e --- /dev/null +++ b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-patch-info.txt @@ -0,0 +1,6 @@ +# This is a generated file and its contents are an internal implementation detail. +# The update step will be re-executed if anything in this file changes. +# No other meaning or use of this file is supported. + +command= +work_dir= diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-test b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-test new file mode 100644 index 0000000..e69de29 diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-update-info.txt b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-update-info.txt new file mode 100644 index 0000000..b9600b2 --- /dev/null +++ b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-update-info.txt @@ -0,0 +1,7 @@ +# This is a generated file and its contents are an internal implementation detail. +# The patch step will be re-executed if anything in this file changes. +# No other meaning or use of this file is supported. + +command (connected)=/usr/local/bin/cmake;-Dcan_fetch=YES;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE;-P;/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/tmp/flowcoro-populate-gitupdate.cmake +command (disconnected)=/usr/local/bin/cmake;-Dcan_fetch=NO;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE;-P;/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/tmp/flowcoro-populate-gitupdate.cmake +work_dir=/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps/flowcoro-src diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/tmp/flowcoro-populate-cfgcmd.txt b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/tmp/flowcoro-populate-cfgcmd.txt new file mode 100644 index 0000000..6a6ed5f --- /dev/null +++ b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/tmp/flowcoro-populate-cfgcmd.txt @@ -0,0 +1 @@ +cmd='' diff --git a/build_test2/config/example.json b/build_test2/config/example.json new file mode 100644 index 0000000..2d682d0 --- /dev/null +++ b/build_test2/config/example.json @@ -0,0 +1,25 @@ +{ + "log_file": "launcher.log", + "log_level": 2, + "monitor_interval": 5, + "enable_monitor": true, + "scheduler": { + "mode": "classic", + "worker_threads": 0, + "tick_us": 1000 + }, + "processes": [ + { + "name": "example_process", + "library_path": "./lib/flowengine/plugins/libexample_process.so", + "config_data": "{\"test\": \"value\", \"interval\": 3}", + "priority": 1, + "auto_start": true, + "scheduling": { + "priority": "normal", + "cpu_affinity": [], + "max_frequency_hz": 0 + } + } + ] +} diff --git a/build_test2/flowengine.pc b/build_test2/flowengine.pc new file mode 100644 index 0000000..797b771 --- /dev/null +++ b/build_test2/flowengine.pc @@ -0,0 +1,11 @@ +prefix=/usr/local +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include/flowengine + +Name: FlowEngine +Description: Lightweight middleware for autonomous driving & robotics +Version: 1.0.0 +Requires: libcjson +Libs: -L${libdir} -lflowengine_core -lpthread -ldl -lrt +Cflags: -I${includedir} -D_GNU_SOURCE diff --git a/build_test2/gen/adas_msgs_gen.h b/build_test2/gen/adas_msgs_gen.h new file mode 100644 index 0000000..2343400 --- /dev/null +++ b/build_test2/gen/adas_msgs_gen.h @@ -0,0 +1,1135 @@ +/* + * AUTO-GENERATED by FlowEngine msg_codegen.py — DO NOT EDIT + * Source: msg/adas_msgs.msg + */ + +#ifndef ADAS_MSGS_GEN_H +#define ADAS_MSGS_GEN_H + +#include +#include +#include +#include +#include "serializer.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Enum: ObstacleType */ +typedef enum { + OBJ_TYPE_UNKNOWN = 0, + OBJ_TYPE_VEHICLE = 1, + OBJ_TYPE_PEDESTRIAN = 2, + OBJ_TYPE_CYCLIST = 3, +} ObstacleType; + +/* Enum: Gear */ +typedef enum { + GEAR_REVERSE = -1, + GEAR_NEUTRAL = 0, + GEAR_DRIVE = 1, +} Gear; + +/* ──────────────────────────────────────────────────────── */ +/* Struct: LidarFrame (size=24B, type_id=0xd712aa51) */ +/* Sig: LidarFrame:float_x,float_y,float_z,float_intensity,uint32_point_count,uint32_fra... */ + +#define LIDARFRAME_TYPE_ID 0xd712aa51u +#define LIDARFRAME_SCHEMA_VERSION 1 +#define LIDARFRAME_SCHEMA_HASH 0x5946acc7u +#define LIDARFRAME_TYPE_NAME "LidarFrame" + +typedef struct { + float x; /**< float */ + float y; /**< float */ + float z; /**< float */ + float intensity; /**< float */ + uint32_t point_count; /**< uint32 */ + uint32_t frame_id; /**< uint32 */ +} LidarFrame; + +#ifdef __cplusplus +} /* close extern "C" — template specialization needs C++ linkage */ +/* C++ type traits for msg_cast(msg) */ +template<> struct msg_traits { + static constexpr uint32_t TYPE_ID = LIDARFRAME_TYPE_ID; + static constexpr uint8_t SCHEMA_VERSION = LIDARFRAME_SCHEMA_VERSION; + static constexpr const char* TYPE_NAME = "LidarFrame"; +}; +extern "C" { +#endif + +/** Serialize LidarFrame to buffer (endian-aware). */ +static inline int LidarFrame_serialize(const LidarFrame* src, + uint8_t* buf, size_t* out_size) { + if (!src) return -1; + size_t total = 24; + if (out_size) *out_size = total; + if (!buf) return 0; /* size query only */ + + if (buf) memcpy(buf + 0, &src->x, 4); + if (buf) memcpy(buf + 4, &src->y, 4); + if (buf) memcpy(buf + 8, &src->z, 4); + if (buf) memcpy(buf + 12, &src->intensity, 4); + if (buf) memcpy(buf + 16, &src->point_count, 4); + if (buf) memcpy(buf + 20, &src->frame_id, 4); + return 0; +} + +/** Deserialize LidarFrame from buffer (endian-aware). */ +static inline int LidarFrame_deserialize(LidarFrame* dst, + const uint8_t* buf, size_t size) { + if (!dst || !buf) return -1; + if (size < 24) return -1; + memset(dst, 0, sizeof(*dst)); + + memcpy(&dst->x, buf + 0, 4); + memcpy(&dst->y, buf + 4, 4); + memcpy(&dst->z, buf + 8, 4); + memcpy(&dst->intensity, buf + 12, 4); + memcpy(&dst->point_count, buf + 16, 4); + memcpy(&dst->frame_id, buf + 20, 4); + return 0; +} + +/** In-place endian swap for LidarFrame. */ +static inline void LidarFrame_endian_swap(void* data) { + if (!data) return; + uint8_t* p = (uint8_t*)data; + size_t off = 0; + + serializer_swap32(p + 0); + serializer_swap32(p + 4); + serializer_swap32(p + 8); + serializer_swap32(p + 12); + serializer_swap32(p + 16); + serializer_swap32(p + 20); +} + +/** Field-level schema descriptor table for LidarFrame. */ +static const FieldDesc LidarFrame_fields[] = { + { "x", FIELD_KIND_FLOAT, (uint16_t)offsetof(LidarFrame, x), 4, 1 }, + { "y", FIELD_KIND_FLOAT, (uint16_t)offsetof(LidarFrame, y), 4, 1 }, + { "z", FIELD_KIND_FLOAT, (uint16_t)offsetof(LidarFrame, z), 4, 1 }, + { "intensity", FIELD_KIND_FLOAT, (uint16_t)offsetof(LidarFrame, intensity), 4, 1 }, + { "point_count", FIELD_KIND_UINT, (uint16_t)offsetof(LidarFrame, point_count), 4, 1 }, + { "frame_id", FIELD_KIND_UINT, (uint16_t)offsetof(LidarFrame, frame_id), 4, 1 }, +}; +#define LIDARFRAME_FIELD_COUNT (sizeof(LidarFrame_fields)/sizeof(LidarFrame_fields[0])) + +/** Auto-register LidarFrame in type registry. */ +static inline void LidarFrame_register_type(void) { + TypeRegistryEntry e = { + .type_id = LIDARFRAME_TYPE_ID, + .schema_version = LIDARFRAME_SCHEMA_VERSION, + .struct_size = sizeof(LidarFrame), + .type_name = "LidarFrame", + .serialize = (SerializeFunc)LidarFrame_serialize, + .deserialize = (DeserializeFunc)LidarFrame_deserialize, + .endian_swap = (EndianSwapFunc)LidarFrame_endian_swap, + .schema_hash = LIDARFRAME_SCHEMA_HASH, + .fields = LidarFrame_fields, + .field_count = (uint16_t)LIDARFRAME_FIELD_COUNT, + }; + serializer_register_type(&e); +} + +/* ──────────────────────────────────────────────────────── */ +/* Struct: GpsData (size=28B, type_id=0x0596b0b7) */ +/* Sig: GpsData:float64_latitude,float64_longitude,float_speed_mps,float_heading_deg,flo... */ + +#define GPSDATA_TYPE_ID 0x0596b0b7u +#define GPSDATA_SCHEMA_VERSION 1 +#define GPSDATA_SCHEMA_HASH 0xd9be1a46u +#define GPSDATA_TYPE_NAME "GpsData" + +typedef struct { + double latitude; /**< float64 */ + double longitude; /**< float64 */ + float speed_mps; /**< float */ + float heading_deg; /**< float */ + float accuracy_m; /**< float */ +} GpsData; + +#ifdef __cplusplus +} /* close extern "C" — template specialization needs C++ linkage */ +/* C++ type traits for msg_cast(msg) */ +template<> struct msg_traits { + static constexpr uint32_t TYPE_ID = GPSDATA_TYPE_ID; + static constexpr uint8_t SCHEMA_VERSION = GPSDATA_SCHEMA_VERSION; + static constexpr const char* TYPE_NAME = "GpsData"; +}; +extern "C" { +#endif + +/** Serialize GpsData to buffer (endian-aware). */ +static inline int GpsData_serialize(const GpsData* src, + uint8_t* buf, size_t* out_size) { + if (!src) return -1; + size_t total = 28; + if (out_size) *out_size = total; + if (!buf) return 0; /* size query only */ + + if (buf) memcpy(buf + 0, &src->latitude, 8); + if (buf) memcpy(buf + 8, &src->longitude, 8); + if (buf) memcpy(buf + 16, &src->speed_mps, 4); + if (buf) memcpy(buf + 20, &src->heading_deg, 4); + if (buf) memcpy(buf + 24, &src->accuracy_m, 4); + return 0; +} + +/** Deserialize GpsData from buffer (endian-aware). */ +static inline int GpsData_deserialize(GpsData* dst, + const uint8_t* buf, size_t size) { + if (!dst || !buf) return -1; + if (size < 28) return -1; + memset(dst, 0, sizeof(*dst)); + + memcpy(&dst->latitude, buf + 0, 8); + memcpy(&dst->longitude, buf + 8, 8); + memcpy(&dst->speed_mps, buf + 16, 4); + memcpy(&dst->heading_deg, buf + 20, 4); + memcpy(&dst->accuracy_m, buf + 24, 4); + return 0; +} + +/** In-place endian swap for GpsData. */ +static inline void GpsData_endian_swap(void* data) { + if (!data) return; + uint8_t* p = (uint8_t*)data; + size_t off = 0; + + serializer_swap64(p + 0); + serializer_swap64(p + 8); + serializer_swap32(p + 16); + serializer_swap32(p + 20); + serializer_swap32(p + 24); +} + +/** Field-level schema descriptor table for GpsData. */ +static const FieldDesc GpsData_fields[] = { + { "latitude", FIELD_KIND_FLOAT, (uint16_t)offsetof(GpsData, latitude), 8, 1 }, + { "longitude", FIELD_KIND_FLOAT, (uint16_t)offsetof(GpsData, longitude), 8, 1 }, + { "speed_mps", FIELD_KIND_FLOAT, (uint16_t)offsetof(GpsData, speed_mps), 4, 1 }, + { "heading_deg", FIELD_KIND_FLOAT, (uint16_t)offsetof(GpsData, heading_deg), 4, 1 }, + { "accuracy_m", FIELD_KIND_FLOAT, (uint16_t)offsetof(GpsData, accuracy_m), 4, 1 }, +}; +#define GPSDATA_FIELD_COUNT (sizeof(GpsData_fields)/sizeof(GpsData_fields[0])) + +/** Auto-register GpsData in type registry. */ +static inline void GpsData_register_type(void) { + TypeRegistryEntry e = { + .type_id = GPSDATA_TYPE_ID, + .schema_version = GPSDATA_SCHEMA_VERSION, + .struct_size = sizeof(GpsData), + .type_name = "GpsData", + .serialize = (SerializeFunc)GpsData_serialize, + .deserialize = (DeserializeFunc)GpsData_deserialize, + .endian_swap = (EndianSwapFunc)GpsData_endian_swap, + .schema_hash = GPSDATA_SCHEMA_HASH, + .fields = GpsData_fields, + .field_count = (uint16_t)GPSDATA_FIELD_COUNT, + }; + serializer_register_type(&e); +} + +/* ──────────────────────────────────────────────────────── */ +/* Struct: Obstacle (size=33B, type_id=0x5d941266) */ +/* Sig: Obstacle:uint32_id,float_x,float_y,float_vx,float_vy,float_width,float_length,Ob... */ + +#define OBSTACLE_TYPE_ID 0x5d941266u +#define OBSTACLE_SCHEMA_VERSION 1 +#define OBSTACLE_SCHEMA_HASH 0xa5b34fdbu +#define OBSTACLE_TYPE_NAME "Obstacle" + +typedef struct { + uint32_t id; /**< uint32 */ + float x; /**< float */ + float y; /**< float */ + float vx; /**< float */ + float vy; /**< float */ + float width; /**< float */ + float length; /**< float */ + int8_t type; /**< ObstacleType */ + float confidence; /**< float */ +} Obstacle; + +#ifdef __cplusplus +} /* close extern "C" — template specialization needs C++ linkage */ +/* C++ type traits for msg_cast(msg) */ +template<> struct msg_traits { + static constexpr uint32_t TYPE_ID = OBSTACLE_TYPE_ID; + static constexpr uint8_t SCHEMA_VERSION = OBSTACLE_SCHEMA_VERSION; + static constexpr const char* TYPE_NAME = "Obstacle"; +}; +extern "C" { +#endif + +/** Serialize Obstacle to buffer (endian-aware). */ +static inline int Obstacle_serialize(const Obstacle* src, + uint8_t* buf, size_t* out_size) { + if (!src) return -1; + size_t total = 33; + if (out_size) *out_size = total; + if (!buf) return 0; /* size query only */ + + if (buf) memcpy(buf + 0, &src->id, 4); + if (buf) memcpy(buf + 4, &src->x, 4); + if (buf) memcpy(buf + 8, &src->y, 4); + if (buf) memcpy(buf + 12, &src->vx, 4); + if (buf) memcpy(buf + 16, &src->vy, 4); + if (buf) memcpy(buf + 20, &src->width, 4); + if (buf) memcpy(buf + 24, &src->length, 4); + if (buf) buf[28] = (int8_t)src->type; + if (buf) memcpy(buf + 29, &src->confidence, 4); + return 0; +} + +/** Deserialize Obstacle from buffer (endian-aware). */ +static inline int Obstacle_deserialize(Obstacle* dst, + const uint8_t* buf, size_t size) { + if (!dst || !buf) return -1; + if (size < 33) return -1; + memset(dst, 0, sizeof(*dst)); + + memcpy(&dst->id, buf + 0, 4); + memcpy(&dst->x, buf + 4, 4); + memcpy(&dst->y, buf + 8, 4); + memcpy(&dst->vx, buf + 12, 4); + memcpy(&dst->vy, buf + 16, 4); + memcpy(&dst->width, buf + 20, 4); + memcpy(&dst->length, buf + 24, 4); + dst->type = (int8_t)((int8_t)buf[28]); + memcpy(&dst->confidence, buf + 29, 4); + return 0; +} + +/** In-place endian swap for Obstacle. */ +static inline void Obstacle_endian_swap(void* data) { + if (!data) return; + uint8_t* p = (uint8_t*)data; + size_t off = 0; + + serializer_swap32(p + 0); + serializer_swap32(p + 4); + serializer_swap32(p + 8); + serializer_swap32(p + 12); + serializer_swap32(p + 16); + serializer_swap32(p + 20); + serializer_swap32(p + 24); + serializer_swap32(p + 29); +} + +/** Field-level schema descriptor table for Obstacle. */ +static const FieldDesc Obstacle_fields[] = { + { "id", FIELD_KIND_UINT, (uint16_t)offsetof(Obstacle, id), 4, 1 }, + { "x", FIELD_KIND_FLOAT, (uint16_t)offsetof(Obstacle, x), 4, 1 }, + { "y", FIELD_KIND_FLOAT, (uint16_t)offsetof(Obstacle, y), 4, 1 }, + { "vx", FIELD_KIND_FLOAT, (uint16_t)offsetof(Obstacle, vx), 4, 1 }, + { "vy", FIELD_KIND_FLOAT, (uint16_t)offsetof(Obstacle, vy), 4, 1 }, + { "width", FIELD_KIND_FLOAT, (uint16_t)offsetof(Obstacle, width), 4, 1 }, + { "length", FIELD_KIND_FLOAT, (uint16_t)offsetof(Obstacle, length), 4, 1 }, + { "type", FIELD_KIND_ENUM, (uint16_t)offsetof(Obstacle, type), 1, 1 }, + { "confidence", FIELD_KIND_FLOAT, (uint16_t)offsetof(Obstacle, confidence), 4, 1 }, +}; +#define OBSTACLE_FIELD_COUNT (sizeof(Obstacle_fields)/sizeof(Obstacle_fields[0])) + +/** Auto-register Obstacle in type registry. */ +static inline void Obstacle_register_type(void) { + TypeRegistryEntry e = { + .type_id = OBSTACLE_TYPE_ID, + .schema_version = OBSTACLE_SCHEMA_VERSION, + .struct_size = sizeof(Obstacle), + .type_name = "Obstacle", + .serialize = (SerializeFunc)Obstacle_serialize, + .deserialize = (DeserializeFunc)Obstacle_deserialize, + .endian_swap = (EndianSwapFunc)Obstacle_endian_swap, + .schema_hash = OBSTACLE_SCHEMA_HASH, + .fields = Obstacle_fields, + .field_count = (uint16_t)OBSTACLE_FIELD_COUNT, + }; + serializer_register_type(&e); +} + +/* ──────────────────────────────────────────────────────── */ +/* Struct: ObstacleList (size=280B, type_id=0x308f5f71) */ +/* Sig: ObstacleList:uint32_frame_id,uint64_timestamp_us,uint32_count,Obstacle:uint32_id... */ + +#define OBSTACLELIST_TYPE_ID 0x308f5f71u +#define OBSTACLELIST_SCHEMA_VERSION 1 +#define OBSTACLELIST_SCHEMA_HASH 0x7260c39du +#define OBSTACLELIST_TYPE_NAME "ObstacleList" + +typedef struct { + uint32_t frame_id; /**< uint32 */ + uint64_t timestamp_us; /**< uint64 */ + uint32_t count; /**< uint32 */ + Obstacle obstacles[8]; /**< Obstacle */ +} ObstacleList; + +#ifdef __cplusplus +} /* close extern "C" — template specialization needs C++ linkage */ +/* C++ type traits for msg_cast(msg) */ +template<> struct msg_traits { + static constexpr uint32_t TYPE_ID = OBSTACLELIST_TYPE_ID; + static constexpr uint8_t SCHEMA_VERSION = OBSTACLELIST_SCHEMA_VERSION; + static constexpr const char* TYPE_NAME = "ObstacleList"; +}; +extern "C" { +#endif + +/** Serialize ObstacleList to buffer (endian-aware). */ +static inline int ObstacleList_serialize(const ObstacleList* src, + uint8_t* buf, size_t* out_size) { + if (!src) return -1; + size_t total = 280; + if (out_size) *out_size = total; + if (!buf) return 0; /* size query only */ + + if (buf) memcpy(buf + 0, &src->frame_id, 4); + if (buf) memcpy(buf + 4, &src->timestamp_us, 8); + if (buf) memcpy(buf + 12, &src->count, 4); + { /* obstacles[0] */ + size_t sz = 0; + Obstacle_serialize(&src->obstacles[0], buf ? buf + 16 : NULL, &sz); + } + { /* obstacles[1] */ + size_t sz = 0; + Obstacle_serialize(&src->obstacles[1], buf ? buf + 49 : NULL, &sz); + } + { /* obstacles[2] */ + size_t sz = 0; + Obstacle_serialize(&src->obstacles[2], buf ? buf + 82 : NULL, &sz); + } + { /* obstacles[3] */ + size_t sz = 0; + Obstacle_serialize(&src->obstacles[3], buf ? buf + 115 : NULL, &sz); + } + { /* obstacles[4] */ + size_t sz = 0; + Obstacle_serialize(&src->obstacles[4], buf ? buf + 148 : NULL, &sz); + } + { /* obstacles[5] */ + size_t sz = 0; + Obstacle_serialize(&src->obstacles[5], buf ? buf + 181 : NULL, &sz); + } + { /* obstacles[6] */ + size_t sz = 0; + Obstacle_serialize(&src->obstacles[6], buf ? buf + 214 : NULL, &sz); + } + { /* obstacles[7] */ + size_t sz = 0; + Obstacle_serialize(&src->obstacles[7], buf ? buf + 247 : NULL, &sz); + } + return 0; +} + +/** Deserialize ObstacleList from buffer (endian-aware). */ +static inline int ObstacleList_deserialize(ObstacleList* dst, + const uint8_t* buf, size_t size) { + if (!dst || !buf) return -1; + if (size < 280) return -1; + memset(dst, 0, sizeof(*dst)); + + memcpy(&dst->frame_id, buf + 0, 4); + memcpy(&dst->timestamp_us, buf + 4, 8); + memcpy(&dst->count, buf + 12, 4); + { /* obstacles[0] */ + Obstacle_deserialize(&dst->obstacles[0], buf + 16, 33); + } + { /* obstacles[1] */ + Obstacle_deserialize(&dst->obstacles[1], buf + 49, 33); + } + { /* obstacles[2] */ + Obstacle_deserialize(&dst->obstacles[2], buf + 82, 33); + } + { /* obstacles[3] */ + Obstacle_deserialize(&dst->obstacles[3], buf + 115, 33); + } + { /* obstacles[4] */ + Obstacle_deserialize(&dst->obstacles[4], buf + 148, 33); + } + { /* obstacles[5] */ + Obstacle_deserialize(&dst->obstacles[5], buf + 181, 33); + } + { /* obstacles[6] */ + Obstacle_deserialize(&dst->obstacles[6], buf + 214, 33); + } + { /* obstacles[7] */ + Obstacle_deserialize(&dst->obstacles[7], buf + 247, 33); + } + return 0; +} + +/** In-place endian swap for ObstacleList. */ +static inline void ObstacleList_endian_swap(void* data) { + if (!data) return; + uint8_t* p = (uint8_t*)data; + size_t off = 0; + + serializer_swap32(p + 0); + serializer_swap64(p + 4); + serializer_swap32(p + 12); + Obstacle_endian_swap(p + 16); + Obstacle_endian_swap(p + 49); + Obstacle_endian_swap(p + 82); + Obstacle_endian_swap(p + 115); + Obstacle_endian_swap(p + 148); + Obstacle_endian_swap(p + 181); + Obstacle_endian_swap(p + 214); + Obstacle_endian_swap(p + 247); +} + +/** Field-level schema descriptor table for ObstacleList. */ +static const FieldDesc ObstacleList_fields[] = { + { "frame_id", FIELD_KIND_UINT, (uint16_t)offsetof(ObstacleList, frame_id), 4, 1 }, + { "timestamp_us", FIELD_KIND_UINT, (uint16_t)offsetof(ObstacleList, timestamp_us), 8, 1 }, + { "count", FIELD_KIND_UINT, (uint16_t)offsetof(ObstacleList, count), 4, 1 }, + { "obstacles", FIELD_KIND_NESTED, (uint16_t)offsetof(ObstacleList, obstacles), 33, 8 }, +}; +#define OBSTACLELIST_FIELD_COUNT (sizeof(ObstacleList_fields)/sizeof(ObstacleList_fields[0])) + +/** Auto-register ObstacleList in type registry. */ +static inline void ObstacleList_register_type(void) { + TypeRegistryEntry e = { + .type_id = OBSTACLELIST_TYPE_ID, + .schema_version = OBSTACLELIST_SCHEMA_VERSION, + .struct_size = sizeof(ObstacleList), + .type_name = "ObstacleList", + .serialize = (SerializeFunc)ObstacleList_serialize, + .deserialize = (DeserializeFunc)ObstacleList_deserialize, + .endian_swap = (EndianSwapFunc)ObstacleList_endian_swap, + .schema_hash = OBSTACLELIST_SCHEMA_HASH, + .fields = ObstacleList_fields, + .field_count = (uint16_t)OBSTACLELIST_FIELD_COUNT, + }; + serializer_register_type(&e); +} + +/* ──────────────────────────────────────────────────────── */ +/* Struct: EgoState (size=32B, type_id=0x212dcff7) */ +/* Sig: EgoState:float64_latitude,float64_longitude,float_heading_deg,float_speed_mps,fl... */ + +#define EGOSTATE_TYPE_ID 0x212dcff7u +#define EGOSTATE_SCHEMA_VERSION 1 +#define EGOSTATE_SCHEMA_HASH 0xb3550a53u +#define EGOSTATE_TYPE_NAME "EgoState" + +typedef struct { + double latitude; /**< float64 */ + double longitude; /**< float64 */ + float heading_deg; /**< float */ + float speed_mps; /**< float */ + float yaw_rate_dps; /**< float */ + float acceleration_mss; /**< float */ +} EgoState; + +#ifdef __cplusplus +} /* close extern "C" — template specialization needs C++ linkage */ +/* C++ type traits for msg_cast(msg) */ +template<> struct msg_traits { + static constexpr uint32_t TYPE_ID = EGOSTATE_TYPE_ID; + static constexpr uint8_t SCHEMA_VERSION = EGOSTATE_SCHEMA_VERSION; + static constexpr const char* TYPE_NAME = "EgoState"; +}; +extern "C" { +#endif + +/** Serialize EgoState to buffer (endian-aware). */ +static inline int EgoState_serialize(const EgoState* src, + uint8_t* buf, size_t* out_size) { + if (!src) return -1; + size_t total = 32; + if (out_size) *out_size = total; + if (!buf) return 0; /* size query only */ + + if (buf) memcpy(buf + 0, &src->latitude, 8); + if (buf) memcpy(buf + 8, &src->longitude, 8); + if (buf) memcpy(buf + 16, &src->heading_deg, 4); + if (buf) memcpy(buf + 20, &src->speed_mps, 4); + if (buf) memcpy(buf + 24, &src->yaw_rate_dps, 4); + if (buf) memcpy(buf + 28, &src->acceleration_mss, 4); + return 0; +} + +/** Deserialize EgoState from buffer (endian-aware). */ +static inline int EgoState_deserialize(EgoState* dst, + const uint8_t* buf, size_t size) { + if (!dst || !buf) return -1; + if (size < 32) return -1; + memset(dst, 0, sizeof(*dst)); + + memcpy(&dst->latitude, buf + 0, 8); + memcpy(&dst->longitude, buf + 8, 8); + memcpy(&dst->heading_deg, buf + 16, 4); + memcpy(&dst->speed_mps, buf + 20, 4); + memcpy(&dst->yaw_rate_dps, buf + 24, 4); + memcpy(&dst->acceleration_mss, buf + 28, 4); + return 0; +} + +/** In-place endian swap for EgoState. */ +static inline void EgoState_endian_swap(void* data) { + if (!data) return; + uint8_t* p = (uint8_t*)data; + size_t off = 0; + + serializer_swap64(p + 0); + serializer_swap64(p + 8); + serializer_swap32(p + 16); + serializer_swap32(p + 20); + serializer_swap32(p + 24); + serializer_swap32(p + 28); +} + +/** Field-level schema descriptor table for EgoState. */ +static const FieldDesc EgoState_fields[] = { + { "latitude", FIELD_KIND_FLOAT, (uint16_t)offsetof(EgoState, latitude), 8, 1 }, + { "longitude", FIELD_KIND_FLOAT, (uint16_t)offsetof(EgoState, longitude), 8, 1 }, + { "heading_deg", FIELD_KIND_FLOAT, (uint16_t)offsetof(EgoState, heading_deg), 4, 1 }, + { "speed_mps", FIELD_KIND_FLOAT, (uint16_t)offsetof(EgoState, speed_mps), 4, 1 }, + { "yaw_rate_dps", FIELD_KIND_FLOAT, (uint16_t)offsetof(EgoState, yaw_rate_dps), 4, 1 }, + { "acceleration_mss", FIELD_KIND_FLOAT, (uint16_t)offsetof(EgoState, acceleration_mss), 4, 1 }, +}; +#define EGOSTATE_FIELD_COUNT (sizeof(EgoState_fields)/sizeof(EgoState_fields[0])) + +/** Auto-register EgoState in type registry. */ +static inline void EgoState_register_type(void) { + TypeRegistryEntry e = { + .type_id = EGOSTATE_TYPE_ID, + .schema_version = EGOSTATE_SCHEMA_VERSION, + .struct_size = sizeof(EgoState), + .type_name = "EgoState", + .serialize = (SerializeFunc)EgoState_serialize, + .deserialize = (DeserializeFunc)EgoState_deserialize, + .endian_swap = (EndianSwapFunc)EgoState_endian_swap, + .schema_hash = EGOSTATE_SCHEMA_HASH, + .fields = EgoState_fields, + .field_count = (uint16_t)EGOSTATE_FIELD_COUNT, + }; + serializer_register_type(&e); +} + +/* ──────────────────────────────────────────────────────── */ +/* Struct: Localization (size=57B, type_id=0xda16ffb9) */ +/* Sig: Localization:float_x,float_y,float_v,float_heading,float_yaw_rate,float_cov_xx,f... */ + +#define LOCALIZATION_TYPE_ID 0xda16ffb9u +#define LOCALIZATION_SCHEMA_VERSION 1 +#define LOCALIZATION_SCHEMA_HASH 0xfb377b50u +#define LOCALIZATION_TYPE_NAME "Localization" + +typedef struct { + float x; /**< float */ + float y; /**< float */ + float v; /**< float */ + float heading; /**< float */ + float yaw_rate; /**< float */ + float cov_xx; /**< float */ + float cov_yy; /**< float */ + float cov_vv; /**< float */ + float cov_hh; /**< float */ + float cov_yyaw; /**< float */ + float innovation; /**< float */ + bool diverged; /**< bool */ + float raw_pos_x; /**< float */ + float raw_pos_y; /**< float */ + float raw_speed; /**< float */ +} Localization; + +#ifdef __cplusplus +} /* close extern "C" — template specialization needs C++ linkage */ +/* C++ type traits for msg_cast(msg) */ +template<> struct msg_traits { + static constexpr uint32_t TYPE_ID = LOCALIZATION_TYPE_ID; + static constexpr uint8_t SCHEMA_VERSION = LOCALIZATION_SCHEMA_VERSION; + static constexpr const char* TYPE_NAME = "Localization"; +}; +extern "C" { +#endif + +/** Serialize Localization to buffer (endian-aware). */ +static inline int Localization_serialize(const Localization* src, + uint8_t* buf, size_t* out_size) { + if (!src) return -1; + size_t total = 57; + if (out_size) *out_size = total; + if (!buf) return 0; /* size query only */ + + if (buf) memcpy(buf + 0, &src->x, 4); + if (buf) memcpy(buf + 4, &src->y, 4); + if (buf) memcpy(buf + 8, &src->v, 4); + if (buf) memcpy(buf + 12, &src->heading, 4); + if (buf) memcpy(buf + 16, &src->yaw_rate, 4); + if (buf) memcpy(buf + 20, &src->cov_xx, 4); + if (buf) memcpy(buf + 24, &src->cov_yy, 4); + if (buf) memcpy(buf + 28, &src->cov_vv, 4); + if (buf) memcpy(buf + 32, &src->cov_hh, 4); + if (buf) memcpy(buf + 36, &src->cov_yyaw, 4); + if (buf) memcpy(buf + 40, &src->innovation, 4); + if (buf) buf[44] = (uint8_t)src->diverged; + if (buf) memcpy(buf + 45, &src->raw_pos_x, 4); + if (buf) memcpy(buf + 49, &src->raw_pos_y, 4); + if (buf) memcpy(buf + 53, &src->raw_speed, 4); + return 0; +} + +/** Deserialize Localization from buffer (endian-aware). */ +static inline int Localization_deserialize(Localization* dst, + const uint8_t* buf, size_t size) { + if (!dst || !buf) return -1; + if (size < 57) return -1; + memset(dst, 0, sizeof(*dst)); + + memcpy(&dst->x, buf + 0, 4); + memcpy(&dst->y, buf + 4, 4); + memcpy(&dst->v, buf + 8, 4); + memcpy(&dst->heading, buf + 12, 4); + memcpy(&dst->yaw_rate, buf + 16, 4); + memcpy(&dst->cov_xx, buf + 20, 4); + memcpy(&dst->cov_yy, buf + 24, 4); + memcpy(&dst->cov_vv, buf + 28, 4); + memcpy(&dst->cov_hh, buf + 32, 4); + memcpy(&dst->cov_yyaw, buf + 36, 4); + memcpy(&dst->innovation, buf + 40, 4); + dst->diverged = (bool)buf[44]; + memcpy(&dst->raw_pos_x, buf + 45, 4); + memcpy(&dst->raw_pos_y, buf + 49, 4); + memcpy(&dst->raw_speed, buf + 53, 4); + return 0; +} + +/** In-place endian swap for Localization. */ +static inline void Localization_endian_swap(void* data) { + if (!data) return; + uint8_t* p = (uint8_t*)data; + size_t off = 0; + + serializer_swap32(p + 0); + serializer_swap32(p + 4); + serializer_swap32(p + 8); + serializer_swap32(p + 12); + serializer_swap32(p + 16); + serializer_swap32(p + 20); + serializer_swap32(p + 24); + serializer_swap32(p + 28); + serializer_swap32(p + 32); + serializer_swap32(p + 36); + serializer_swap32(p + 40); + serializer_swap32(p + 45); + serializer_swap32(p + 49); + serializer_swap32(p + 53); +} + +/** Field-level schema descriptor table for Localization. */ +static const FieldDesc Localization_fields[] = { + { "x", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, x), 4, 1 }, + { "y", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, y), 4, 1 }, + { "v", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, v), 4, 1 }, + { "heading", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, heading), 4, 1 }, + { "yaw_rate", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, yaw_rate), 4, 1 }, + { "cov_xx", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, cov_xx), 4, 1 }, + { "cov_yy", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, cov_yy), 4, 1 }, + { "cov_vv", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, cov_vv), 4, 1 }, + { "cov_hh", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, cov_hh), 4, 1 }, + { "cov_yyaw", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, cov_yyaw), 4, 1 }, + { "innovation", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, innovation), 4, 1 }, + { "diverged", FIELD_KIND_BOOL, (uint16_t)offsetof(Localization, diverged), 1, 1 }, + { "raw_pos_x", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, raw_pos_x), 4, 1 }, + { "raw_pos_y", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, raw_pos_y), 4, 1 }, + { "raw_speed", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, raw_speed), 4, 1 }, +}; +#define LOCALIZATION_FIELD_COUNT (sizeof(Localization_fields)/sizeof(Localization_fields[0])) + +/** Auto-register Localization in type registry. */ +static inline void Localization_register_type(void) { + TypeRegistryEntry e = { + .type_id = LOCALIZATION_TYPE_ID, + .schema_version = LOCALIZATION_SCHEMA_VERSION, + .struct_size = sizeof(Localization), + .type_name = "Localization", + .serialize = (SerializeFunc)Localization_serialize, + .deserialize = (DeserializeFunc)Localization_deserialize, + .endian_swap = (EndianSwapFunc)Localization_endian_swap, + .schema_hash = LOCALIZATION_SCHEMA_HASH, + .fields = Localization_fields, + .field_count = (uint16_t)LOCALIZATION_FIELD_COUNT, + }; + serializer_register_type(&e); +} + +/* ──────────────────────────────────────────────────────── */ +/* Struct: LatencyReport (size=12B, type_id=0xe5c06baf) */ +/* Sig: LatencyReport:uint32_avg_us,uint32_p50_us,uint32_p99_us... */ + +#define LATENCYREPORT_TYPE_ID 0xe5c06bafu +#define LATENCYREPORT_SCHEMA_VERSION 1 +#define LATENCYREPORT_SCHEMA_HASH 0x4b4b29e6u +#define LATENCYREPORT_TYPE_NAME "LatencyReport" + +typedef struct { + uint32_t avg_us; /**< uint32 */ + uint32_t p50_us; /**< uint32 */ + uint32_t p99_us; /**< uint32 */ +} LatencyReport; + +#ifdef __cplusplus +} /* close extern "C" — template specialization needs C++ linkage */ +/* C++ type traits for msg_cast(msg) */ +template<> struct msg_traits { + static constexpr uint32_t TYPE_ID = LATENCYREPORT_TYPE_ID; + static constexpr uint8_t SCHEMA_VERSION = LATENCYREPORT_SCHEMA_VERSION; + static constexpr const char* TYPE_NAME = "LatencyReport"; +}; +extern "C" { +#endif + +/** Serialize LatencyReport to buffer (endian-aware). */ +static inline int LatencyReport_serialize(const LatencyReport* src, + uint8_t* buf, size_t* out_size) { + if (!src) return -1; + size_t total = 12; + if (out_size) *out_size = total; + if (!buf) return 0; /* size query only */ + + if (buf) memcpy(buf + 0, &src->avg_us, 4); + if (buf) memcpy(buf + 4, &src->p50_us, 4); + if (buf) memcpy(buf + 8, &src->p99_us, 4); + return 0; +} + +/** Deserialize LatencyReport from buffer (endian-aware). */ +static inline int LatencyReport_deserialize(LatencyReport* dst, + const uint8_t* buf, size_t size) { + if (!dst || !buf) return -1; + if (size < 12) return -1; + memset(dst, 0, sizeof(*dst)); + + memcpy(&dst->avg_us, buf + 0, 4); + memcpy(&dst->p50_us, buf + 4, 4); + memcpy(&dst->p99_us, buf + 8, 4); + return 0; +} + +/** In-place endian swap for LatencyReport. */ +static inline void LatencyReport_endian_swap(void* data) { + if (!data) return; + uint8_t* p = (uint8_t*)data; + size_t off = 0; + + serializer_swap32(p + 0); + serializer_swap32(p + 4); + serializer_swap32(p + 8); +} + +/** Field-level schema descriptor table for LatencyReport. */ +static const FieldDesc LatencyReport_fields[] = { + { "avg_us", FIELD_KIND_UINT, (uint16_t)offsetof(LatencyReport, avg_us), 4, 1 }, + { "p50_us", FIELD_KIND_UINT, (uint16_t)offsetof(LatencyReport, p50_us), 4, 1 }, + { "p99_us", FIELD_KIND_UINT, (uint16_t)offsetof(LatencyReport, p99_us), 4, 1 }, +}; +#define LATENCYREPORT_FIELD_COUNT (sizeof(LatencyReport_fields)/sizeof(LatencyReport_fields[0])) + +/** Auto-register LatencyReport in type registry. */ +static inline void LatencyReport_register_type(void) { + TypeRegistryEntry e = { + .type_id = LATENCYREPORT_TYPE_ID, + .schema_version = LATENCYREPORT_SCHEMA_VERSION, + .struct_size = sizeof(LatencyReport), + .type_name = "LatencyReport", + .serialize = (SerializeFunc)LatencyReport_serialize, + .deserialize = (DeserializeFunc)LatencyReport_deserialize, + .endian_swap = (EndianSwapFunc)LatencyReport_endian_swap, + .schema_hash = LATENCYREPORT_SCHEMA_HASH, + .fields = LatencyReport_fields, + .field_count = (uint16_t)LATENCYREPORT_FIELD_COUNT, + }; + serializer_register_type(&e); +} + +/* ──────────────────────────────────────────────────────── */ +/* Struct: ControlRaw (size=52B, type_id=0x871712d1) */ +/* Sig: ControlRaw:uint32_seq,float_throttle,float_brake,float_steering,float_speed,floa... */ + +#define CONTROLRAW_TYPE_ID 0x871712d1u +#define CONTROLRAW_SCHEMA_VERSION 1 +#define CONTROLRAW_SCHEMA_HASH 0x72f385ccu +#define CONTROLRAW_TYPE_NAME "ControlRaw" + +typedef struct { + uint32_t seq; /**< uint32 */ + float throttle; /**< float */ + float brake; /**< float */ + float steering; /**< float */ + float speed; /**< float */ + float target; /**< float */ + float error; /**< float */ + char mode[24]; /**< char */ +} ControlRaw; + +#ifdef __cplusplus +} /* close extern "C" — template specialization needs C++ linkage */ +/* C++ type traits for msg_cast(msg) */ +template<> struct msg_traits { + static constexpr uint32_t TYPE_ID = CONTROLRAW_TYPE_ID; + static constexpr uint8_t SCHEMA_VERSION = CONTROLRAW_SCHEMA_VERSION; + static constexpr const char* TYPE_NAME = "ControlRaw"; +}; +extern "C" { +#endif + +/** Serialize ControlRaw to buffer (endian-aware). */ +static inline int ControlRaw_serialize(const ControlRaw* src, + uint8_t* buf, size_t* out_size) { + if (!src) return -1; + size_t total = 52; + if (out_size) *out_size = total; + if (!buf) return 0; /* size query only */ + + if (buf) memcpy(buf + 0, &src->seq, 4); + if (buf) memcpy(buf + 4, &src->throttle, 4); + if (buf) memcpy(buf + 8, &src->brake, 4); + if (buf) memcpy(buf + 12, &src->steering, 4); + if (buf) memcpy(buf + 16, &src->speed, 4); + if (buf) memcpy(buf + 20, &src->target, 4); + if (buf) memcpy(buf + 24, &src->error, 4); + if (buf) buf[28] = (uint8_t)src->mode[0]; + if (buf) buf[29] = (uint8_t)src->mode[1]; + if (buf) buf[30] = (uint8_t)src->mode[2]; + if (buf) buf[31] = (uint8_t)src->mode[3]; + if (buf) buf[32] = (uint8_t)src->mode[4]; + if (buf) buf[33] = (uint8_t)src->mode[5]; + if (buf) buf[34] = (uint8_t)src->mode[6]; + if (buf) buf[35] = (uint8_t)src->mode[7]; + if (buf) buf[36] = (uint8_t)src->mode[8]; + if (buf) buf[37] = (uint8_t)src->mode[9]; + if (buf) buf[38] = (uint8_t)src->mode[10]; + if (buf) buf[39] = (uint8_t)src->mode[11]; + if (buf) buf[40] = (uint8_t)src->mode[12]; + if (buf) buf[41] = (uint8_t)src->mode[13]; + if (buf) buf[42] = (uint8_t)src->mode[14]; + if (buf) buf[43] = (uint8_t)src->mode[15]; + if (buf) buf[44] = (uint8_t)src->mode[16]; + if (buf) buf[45] = (uint8_t)src->mode[17]; + if (buf) buf[46] = (uint8_t)src->mode[18]; + if (buf) buf[47] = (uint8_t)src->mode[19]; + if (buf) buf[48] = (uint8_t)src->mode[20]; + if (buf) buf[49] = (uint8_t)src->mode[21]; + if (buf) buf[50] = (uint8_t)src->mode[22]; + if (buf) buf[51] = (uint8_t)src->mode[23]; + return 0; +} + +/** Deserialize ControlRaw from buffer (endian-aware). */ +static inline int ControlRaw_deserialize(ControlRaw* dst, + const uint8_t* buf, size_t size) { + if (!dst || !buf) return -1; + if (size < 52) return -1; + memset(dst, 0, sizeof(*dst)); + + memcpy(&dst->seq, buf + 0, 4); + memcpy(&dst->throttle, buf + 4, 4); + memcpy(&dst->brake, buf + 8, 4); + memcpy(&dst->steering, buf + 12, 4); + memcpy(&dst->speed, buf + 16, 4); + memcpy(&dst->target, buf + 20, 4); + memcpy(&dst->error, buf + 24, 4); + dst->mode[0] = (char)buf[28]; + dst->mode[1] = (char)buf[29]; + dst->mode[2] = (char)buf[30]; + dst->mode[3] = (char)buf[31]; + dst->mode[4] = (char)buf[32]; + dst->mode[5] = (char)buf[33]; + dst->mode[6] = (char)buf[34]; + dst->mode[7] = (char)buf[35]; + dst->mode[8] = (char)buf[36]; + dst->mode[9] = (char)buf[37]; + dst->mode[10] = (char)buf[38]; + dst->mode[11] = (char)buf[39]; + dst->mode[12] = (char)buf[40]; + dst->mode[13] = (char)buf[41]; + dst->mode[14] = (char)buf[42]; + dst->mode[15] = (char)buf[43]; + dst->mode[16] = (char)buf[44]; + dst->mode[17] = (char)buf[45]; + dst->mode[18] = (char)buf[46]; + dst->mode[19] = (char)buf[47]; + dst->mode[20] = (char)buf[48]; + dst->mode[21] = (char)buf[49]; + dst->mode[22] = (char)buf[50]; + dst->mode[23] = (char)buf[51]; + return 0; +} + +/** In-place endian swap for ControlRaw. */ +static inline void ControlRaw_endian_swap(void* data) { + if (!data) return; + uint8_t* p = (uint8_t*)data; + size_t off = 0; + + serializer_swap32(p + 0); + serializer_swap32(p + 4); + serializer_swap32(p + 8); + serializer_swap32(p + 12); + serializer_swap32(p + 16); + serializer_swap32(p + 20); + serializer_swap32(p + 24); +} + +/** Field-level schema descriptor table for ControlRaw. */ +static const FieldDesc ControlRaw_fields[] = { + { "seq", FIELD_KIND_UINT, (uint16_t)offsetof(ControlRaw, seq), 4, 1 }, + { "throttle", FIELD_KIND_FLOAT, (uint16_t)offsetof(ControlRaw, throttle), 4, 1 }, + { "brake", FIELD_KIND_FLOAT, (uint16_t)offsetof(ControlRaw, brake), 4, 1 }, + { "steering", FIELD_KIND_FLOAT, (uint16_t)offsetof(ControlRaw, steering), 4, 1 }, + { "speed", FIELD_KIND_FLOAT, (uint16_t)offsetof(ControlRaw, speed), 4, 1 }, + { "target", FIELD_KIND_FLOAT, (uint16_t)offsetof(ControlRaw, target), 4, 1 }, + { "error", FIELD_KIND_FLOAT, (uint16_t)offsetof(ControlRaw, error), 4, 1 }, + { "mode", FIELD_KIND_UNKNOWN, (uint16_t)offsetof(ControlRaw, mode), 1, 24 }, +}; +#define CONTROLRAW_FIELD_COUNT (sizeof(ControlRaw_fields)/sizeof(ControlRaw_fields[0])) + +/** Auto-register ControlRaw in type registry. */ +static inline void ControlRaw_register_type(void) { + TypeRegistryEntry e = { + .type_id = CONTROLRAW_TYPE_ID, + .schema_version = CONTROLRAW_SCHEMA_VERSION, + .struct_size = sizeof(ControlRaw), + .type_name = "ControlRaw", + .serialize = (SerializeFunc)ControlRaw_serialize, + .deserialize = (DeserializeFunc)ControlRaw_deserialize, + .endian_swap = (EndianSwapFunc)ControlRaw_endian_swap, + .schema_hash = CONTROLRAW_SCHEMA_HASH, + .fields = ControlRaw_fields, + .field_count = (uint16_t)CONTROLRAW_FIELD_COUNT, + }; + serializer_register_type(&e); +} + +/* ──────────────────────────────────────────────────────── */ +/* Struct: ControlCmd (size=18B, type_id=0x2d95c6d2) */ +/* Sig: ControlCmd:uint32_seq,float_throttle,float_brake,float_steering,Gear_gear,bool_e... */ + +#define CONTROLCMD_TYPE_ID 0x2d95c6d2u +#define CONTROLCMD_SCHEMA_VERSION 1 +#define CONTROLCMD_SCHEMA_HASH 0x8303b978u +#define CONTROLCMD_TYPE_NAME "ControlCmd" + +typedef struct { + uint32_t seq; /**< uint32 */ + float throttle; /**< float */ + float brake; /**< float */ + float steering; /**< float */ + int8_t gear; /**< Gear */ + bool emergency_stop; /**< bool */ +} ControlCmd; + +#ifdef __cplusplus +} /* close extern "C" — template specialization needs C++ linkage */ +/* C++ type traits for msg_cast(msg) */ +template<> struct msg_traits { + static constexpr uint32_t TYPE_ID = CONTROLCMD_TYPE_ID; + static constexpr uint8_t SCHEMA_VERSION = CONTROLCMD_SCHEMA_VERSION; + static constexpr const char* TYPE_NAME = "ControlCmd"; +}; +extern "C" { +#endif + +/** Serialize ControlCmd to buffer (endian-aware). */ +static inline int ControlCmd_serialize(const ControlCmd* src, + uint8_t* buf, size_t* out_size) { + if (!src) return -1; + size_t total = 18; + if (out_size) *out_size = total; + if (!buf) return 0; /* size query only */ + + if (buf) memcpy(buf + 0, &src->seq, 4); + if (buf) memcpy(buf + 4, &src->throttle, 4); + if (buf) memcpy(buf + 8, &src->brake, 4); + if (buf) memcpy(buf + 12, &src->steering, 4); + if (buf) buf[16] = (int8_t)src->gear; + if (buf) buf[17] = (uint8_t)src->emergency_stop; + return 0; +} + +/** Deserialize ControlCmd from buffer (endian-aware). */ +static inline int ControlCmd_deserialize(ControlCmd* dst, + const uint8_t* buf, size_t size) { + if (!dst || !buf) return -1; + if (size < 18) return -1; + memset(dst, 0, sizeof(*dst)); + + memcpy(&dst->seq, buf + 0, 4); + memcpy(&dst->throttle, buf + 4, 4); + memcpy(&dst->brake, buf + 8, 4); + memcpy(&dst->steering, buf + 12, 4); + dst->gear = (int8_t)((int8_t)buf[16]); + dst->emergency_stop = (bool)buf[17]; + return 0; +} + +/** In-place endian swap for ControlCmd. */ +static inline void ControlCmd_endian_swap(void* data) { + if (!data) return; + uint8_t* p = (uint8_t*)data; + size_t off = 0; + + serializer_swap32(p + 0); + serializer_swap32(p + 4); + serializer_swap32(p + 8); + serializer_swap32(p + 12); +} + +/** Field-level schema descriptor table for ControlCmd. */ +static const FieldDesc ControlCmd_fields[] = { + { "seq", FIELD_KIND_UINT, (uint16_t)offsetof(ControlCmd, seq), 4, 1 }, + { "throttle", FIELD_KIND_FLOAT, (uint16_t)offsetof(ControlCmd, throttle), 4, 1 }, + { "brake", FIELD_KIND_FLOAT, (uint16_t)offsetof(ControlCmd, brake), 4, 1 }, + { "steering", FIELD_KIND_FLOAT, (uint16_t)offsetof(ControlCmd, steering), 4, 1 }, + { "gear", FIELD_KIND_ENUM, (uint16_t)offsetof(ControlCmd, gear), 1, 1 }, + { "emergency_stop", FIELD_KIND_BOOL, (uint16_t)offsetof(ControlCmd, emergency_stop), 1, 1 }, +}; +#define CONTROLCMD_FIELD_COUNT (sizeof(ControlCmd_fields)/sizeof(ControlCmd_fields[0])) + +/** Auto-register ControlCmd in type registry. */ +static inline void ControlCmd_register_type(void) { + TypeRegistryEntry e = { + .type_id = CONTROLCMD_TYPE_ID, + .schema_version = CONTROLCMD_SCHEMA_VERSION, + .struct_size = sizeof(ControlCmd), + .type_name = "ControlCmd", + .serialize = (SerializeFunc)ControlCmd_serialize, + .deserialize = (DeserializeFunc)ControlCmd_deserialize, + .endian_swap = (EndianSwapFunc)ControlCmd_endian_swap, + .schema_hash = CONTROLCMD_SCHEMA_HASH, + .fields = ControlCmd_fields, + .field_count = (uint16_t)CONTROLCMD_FIELD_COUNT, + }; + serializer_register_type(&e); +} + +/* ── Batch registration ─────────────────────────────── */ + +/** + * Register all ADAS message types in the type registry. + * Call once during initialization (idempotent). + */ +static inline void adas_msgs_register_all(void) { + LidarFrame_register_type(); + GpsData_register_type(); + Obstacle_register_type(); + ObstacleList_register_type(); + EgoState_register_type(); + Localization_register_type(); + LatencyReport_register_type(); + ControlRaw_register_type(); + ControlCmd_register_type(); +} + + +#ifdef __cplusplus +} +#endif + +#endif /* ADAS_MSGS_GEN_H */ \ No newline at end of file From af18903811d829a51d6e086fbfb4d87241dbf338 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 11 Jul 2026 02:28:40 +0000 Subject: [PATCH 3/3] Remove accidentally committed build artifacts and update .gitignore --- .gitignore | 1 + build_test2/_deps/flowcoro-src | 1 - .../_deps/flowcoro-subbuild/CMakeLists.txt | 42 - .../flowcoro-populate-build | 0 .../flowcoro-populate-configure | 0 .../flowcoro-populate-done | 0 .../flowcoro-populate-download | 0 .../flowcoro-populate-gitclone-lastrun.txt | 15 - .../flowcoro-populate-gitinfo.txt | 15 - .../flowcoro-populate-install | 0 .../flowcoro-populate-mkdir | 0 .../flowcoro-populate-patch | 0 .../flowcoro-populate-patch-info.txt | 6 - .../flowcoro-populate-test | 0 .../flowcoro-populate-update-info.txt | 7 - .../tmp/flowcoro-populate-cfgcmd.txt | 1 - build_test2/config/example.json | 25 - build_test2/flowengine.pc | 11 - build_test2/gen/adas_msgs_gen.h | 1135 ----------------- 19 files changed, 1 insertion(+), 1258 deletions(-) delete mode 160000 build_test2/_deps/flowcoro-src delete mode 100644 build_test2/_deps/flowcoro-subbuild/CMakeLists.txt delete mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-build delete mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-configure delete mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-done delete mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-download delete mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-gitclone-lastrun.txt delete mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-gitinfo.txt delete mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-install delete mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-mkdir delete mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-patch delete mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-patch-info.txt delete mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-test delete mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-update-info.txt delete mode 100644 build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/tmp/flowcoro-populate-cfgcmd.txt delete mode 100644 build_test2/config/example.json delete mode 100644 build_test2/flowengine.pc delete mode 100644 build_test2/gen/adas_msgs_gen.h diff --git a/.gitignore b/.gitignore index 6f6b87d..4960810 100644 --- a/.gitignore +++ b/.gitignore @@ -132,3 +132,4 @@ data/ third_party/frenet-optimal-trajectory-planner/ third_party/tinympc/ build-*/ +build_*/ diff --git a/build_test2/_deps/flowcoro-src b/build_test2/_deps/flowcoro-src deleted file mode 160000 index 0934b6f..0000000 --- a/build_test2/_deps/flowcoro-src +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0934b6f22cf75bc12ca2c60caaaf78519bf4921c diff --git a/build_test2/_deps/flowcoro-subbuild/CMakeLists.txt b/build_test2/_deps/flowcoro-subbuild/CMakeLists.txt deleted file mode 100644 index 9fab5a5..0000000 --- a/build_test2/_deps/flowcoro-subbuild/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying -# file Copyright.txt or https://cmake.org/licensing for details. - -cmake_minimum_required(VERSION 3.31.6) - -# Reject any attempt to use a toolchain file. We must not use one because -# we could be downloading it here. If the CMAKE_TOOLCHAIN_FILE environment -# variable is set, the cache variable will have been initialized from it. -unset(CMAKE_TOOLCHAIN_FILE CACHE) -unset(ENV{CMAKE_TOOLCHAIN_FILE}) - -# We name the project and the target for the ExternalProject_Add() call -# to something that will highlight to the user what we are working on if -# something goes wrong and an error message is produced. - -project(flowcoro-populate NONE) - - -# Pass through things we've already detected in the main project to avoid -# paying the cost of redetecting them again in ExternalProject_Add() -set(GIT_EXECUTABLE [==[/usr/bin/git]==]) -set(GIT_VERSION_STRING [==[2.54.0]==]) -set_property(GLOBAL PROPERTY _CMAKE_FindGit_GIT_EXECUTABLE_VERSION - [==[/usr/bin/git;2.54.0]==] -) - - -include(ExternalProject) -ExternalProject_Add(flowcoro-populate - "UPDATE_DISCONNECTED" "False" "GIT_REPOSITORY" "https://github.com/caixuf/flowcoro.git" "EXTERNALPROJECT_INTERNAL_ARGUMENT_SEPARATOR" "GIT_TAG" "0934b6f22cf75bc12ca2c60caaaf78519bf4921c" "GIT_SHALLOW" "TRUE" - SOURCE_DIR "/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps/flowcoro-src" - BINARY_DIR "/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps/flowcoro-build" - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "" - TEST_COMMAND "" - USES_TERMINAL_DOWNLOAD YES - USES_TERMINAL_UPDATE YES - USES_TERMINAL_PATCH YES -) - - diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-build b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-build deleted file mode 100644 index e69de29..0000000 diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-configure b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-configure deleted file mode 100644 index e69de29..0000000 diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-done b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-done deleted file mode 100644 index e69de29..0000000 diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-download b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-download deleted file mode 100644 index e69de29..0000000 diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-gitclone-lastrun.txt b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-gitclone-lastrun.txt deleted file mode 100644 index c01e4b1..0000000 --- a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-gitclone-lastrun.txt +++ /dev/null @@ -1,15 +0,0 @@ -# This is a generated file and its contents are an internal implementation detail. -# The download step will be re-executed if anything in this file changes. -# No other meaning or use of this file is supported. - -method=git -command=/usr/local/bin/cmake;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE;-P;/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/tmp/flowcoro-populate-gitclone.cmake -source_dir=/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps/flowcoro-src -work_dir=/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps -repository=https://github.com/caixuf/flowcoro.git -remote=origin -init_submodules=TRUE -recurse_submodules=--recursive -submodules= -CMP0097=NEW - diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-gitinfo.txt b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-gitinfo.txt deleted file mode 100644 index c01e4b1..0000000 --- a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-gitinfo.txt +++ /dev/null @@ -1,15 +0,0 @@ -# This is a generated file and its contents are an internal implementation detail. -# The download step will be re-executed if anything in this file changes. -# No other meaning or use of this file is supported. - -method=git -command=/usr/local/bin/cmake;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE;-P;/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/tmp/flowcoro-populate-gitclone.cmake -source_dir=/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps/flowcoro-src -work_dir=/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps -repository=https://github.com/caixuf/flowcoro.git -remote=origin -init_submodules=TRUE -recurse_submodules=--recursive -submodules= -CMP0097=NEW - diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-install b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-install deleted file mode 100644 index e69de29..0000000 diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-mkdir b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-mkdir deleted file mode 100644 index e69de29..0000000 diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-patch b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-patch deleted file mode 100644 index e69de29..0000000 diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-patch-info.txt b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-patch-info.txt deleted file mode 100644 index 53e1e1e..0000000 --- a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-patch-info.txt +++ /dev/null @@ -1,6 +0,0 @@ -# This is a generated file and its contents are an internal implementation detail. -# The update step will be re-executed if anything in this file changes. -# No other meaning or use of this file is supported. - -command= -work_dir= diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-test b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-test deleted file mode 100644 index e69de29..0000000 diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-update-info.txt b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-update-info.txt deleted file mode 100644 index b9600b2..0000000 --- a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/src/flowcoro-populate-stamp/flowcoro-populate-update-info.txt +++ /dev/null @@ -1,7 +0,0 @@ -# This is a generated file and its contents are an internal implementation detail. -# The patch step will be re-executed if anything in this file changes. -# No other meaning or use of this file is supported. - -command (connected)=/usr/local/bin/cmake;-Dcan_fetch=YES;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE;-P;/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/tmp/flowcoro-populate-gitupdate.cmake -command (disconnected)=/usr/local/bin/cmake;-Dcan_fetch=NO;-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE;-P;/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/tmp/flowcoro-populate-gitupdate.cmake -work_dir=/home/runner/work/FlowEngine/FlowEngine/build_test2/_deps/flowcoro-src diff --git a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/tmp/flowcoro-populate-cfgcmd.txt b/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/tmp/flowcoro-populate-cfgcmd.txt deleted file mode 100644 index 6a6ed5f..0000000 --- a/build_test2/_deps/flowcoro-subbuild/flowcoro-populate-prefix/tmp/flowcoro-populate-cfgcmd.txt +++ /dev/null @@ -1 +0,0 @@ -cmd='' diff --git a/build_test2/config/example.json b/build_test2/config/example.json deleted file mode 100644 index 2d682d0..0000000 --- a/build_test2/config/example.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "log_file": "launcher.log", - "log_level": 2, - "monitor_interval": 5, - "enable_monitor": true, - "scheduler": { - "mode": "classic", - "worker_threads": 0, - "tick_us": 1000 - }, - "processes": [ - { - "name": "example_process", - "library_path": "./lib/flowengine/plugins/libexample_process.so", - "config_data": "{\"test\": \"value\", \"interval\": 3}", - "priority": 1, - "auto_start": true, - "scheduling": { - "priority": "normal", - "cpu_affinity": [], - "max_frequency_hz": 0 - } - } - ] -} diff --git a/build_test2/flowengine.pc b/build_test2/flowengine.pc deleted file mode 100644 index 797b771..0000000 --- a/build_test2/flowengine.pc +++ /dev/null @@ -1,11 +0,0 @@ -prefix=/usr/local -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include/flowengine - -Name: FlowEngine -Description: Lightweight middleware for autonomous driving & robotics -Version: 1.0.0 -Requires: libcjson -Libs: -L${libdir} -lflowengine_core -lpthread -ldl -lrt -Cflags: -I${includedir} -D_GNU_SOURCE diff --git a/build_test2/gen/adas_msgs_gen.h b/build_test2/gen/adas_msgs_gen.h deleted file mode 100644 index 2343400..0000000 --- a/build_test2/gen/adas_msgs_gen.h +++ /dev/null @@ -1,1135 +0,0 @@ -/* - * AUTO-GENERATED by FlowEngine msg_codegen.py — DO NOT EDIT - * Source: msg/adas_msgs.msg - */ - -#ifndef ADAS_MSGS_GEN_H -#define ADAS_MSGS_GEN_H - -#include -#include -#include -#include -#include "serializer.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Enum: ObstacleType */ -typedef enum { - OBJ_TYPE_UNKNOWN = 0, - OBJ_TYPE_VEHICLE = 1, - OBJ_TYPE_PEDESTRIAN = 2, - OBJ_TYPE_CYCLIST = 3, -} ObstacleType; - -/* Enum: Gear */ -typedef enum { - GEAR_REVERSE = -1, - GEAR_NEUTRAL = 0, - GEAR_DRIVE = 1, -} Gear; - -/* ──────────────────────────────────────────────────────── */ -/* Struct: LidarFrame (size=24B, type_id=0xd712aa51) */ -/* Sig: LidarFrame:float_x,float_y,float_z,float_intensity,uint32_point_count,uint32_fra... */ - -#define LIDARFRAME_TYPE_ID 0xd712aa51u -#define LIDARFRAME_SCHEMA_VERSION 1 -#define LIDARFRAME_SCHEMA_HASH 0x5946acc7u -#define LIDARFRAME_TYPE_NAME "LidarFrame" - -typedef struct { - float x; /**< float */ - float y; /**< float */ - float z; /**< float */ - float intensity; /**< float */ - uint32_t point_count; /**< uint32 */ - uint32_t frame_id; /**< uint32 */ -} LidarFrame; - -#ifdef __cplusplus -} /* close extern "C" — template specialization needs C++ linkage */ -/* C++ type traits for msg_cast(msg) */ -template<> struct msg_traits { - static constexpr uint32_t TYPE_ID = LIDARFRAME_TYPE_ID; - static constexpr uint8_t SCHEMA_VERSION = LIDARFRAME_SCHEMA_VERSION; - static constexpr const char* TYPE_NAME = "LidarFrame"; -}; -extern "C" { -#endif - -/** Serialize LidarFrame to buffer (endian-aware). */ -static inline int LidarFrame_serialize(const LidarFrame* src, - uint8_t* buf, size_t* out_size) { - if (!src) return -1; - size_t total = 24; - if (out_size) *out_size = total; - if (!buf) return 0; /* size query only */ - - if (buf) memcpy(buf + 0, &src->x, 4); - if (buf) memcpy(buf + 4, &src->y, 4); - if (buf) memcpy(buf + 8, &src->z, 4); - if (buf) memcpy(buf + 12, &src->intensity, 4); - if (buf) memcpy(buf + 16, &src->point_count, 4); - if (buf) memcpy(buf + 20, &src->frame_id, 4); - return 0; -} - -/** Deserialize LidarFrame from buffer (endian-aware). */ -static inline int LidarFrame_deserialize(LidarFrame* dst, - const uint8_t* buf, size_t size) { - if (!dst || !buf) return -1; - if (size < 24) return -1; - memset(dst, 0, sizeof(*dst)); - - memcpy(&dst->x, buf + 0, 4); - memcpy(&dst->y, buf + 4, 4); - memcpy(&dst->z, buf + 8, 4); - memcpy(&dst->intensity, buf + 12, 4); - memcpy(&dst->point_count, buf + 16, 4); - memcpy(&dst->frame_id, buf + 20, 4); - return 0; -} - -/** In-place endian swap for LidarFrame. */ -static inline void LidarFrame_endian_swap(void* data) { - if (!data) return; - uint8_t* p = (uint8_t*)data; - size_t off = 0; - - serializer_swap32(p + 0); - serializer_swap32(p + 4); - serializer_swap32(p + 8); - serializer_swap32(p + 12); - serializer_swap32(p + 16); - serializer_swap32(p + 20); -} - -/** Field-level schema descriptor table for LidarFrame. */ -static const FieldDesc LidarFrame_fields[] = { - { "x", FIELD_KIND_FLOAT, (uint16_t)offsetof(LidarFrame, x), 4, 1 }, - { "y", FIELD_KIND_FLOAT, (uint16_t)offsetof(LidarFrame, y), 4, 1 }, - { "z", FIELD_KIND_FLOAT, (uint16_t)offsetof(LidarFrame, z), 4, 1 }, - { "intensity", FIELD_KIND_FLOAT, (uint16_t)offsetof(LidarFrame, intensity), 4, 1 }, - { "point_count", FIELD_KIND_UINT, (uint16_t)offsetof(LidarFrame, point_count), 4, 1 }, - { "frame_id", FIELD_KIND_UINT, (uint16_t)offsetof(LidarFrame, frame_id), 4, 1 }, -}; -#define LIDARFRAME_FIELD_COUNT (sizeof(LidarFrame_fields)/sizeof(LidarFrame_fields[0])) - -/** Auto-register LidarFrame in type registry. */ -static inline void LidarFrame_register_type(void) { - TypeRegistryEntry e = { - .type_id = LIDARFRAME_TYPE_ID, - .schema_version = LIDARFRAME_SCHEMA_VERSION, - .struct_size = sizeof(LidarFrame), - .type_name = "LidarFrame", - .serialize = (SerializeFunc)LidarFrame_serialize, - .deserialize = (DeserializeFunc)LidarFrame_deserialize, - .endian_swap = (EndianSwapFunc)LidarFrame_endian_swap, - .schema_hash = LIDARFRAME_SCHEMA_HASH, - .fields = LidarFrame_fields, - .field_count = (uint16_t)LIDARFRAME_FIELD_COUNT, - }; - serializer_register_type(&e); -} - -/* ──────────────────────────────────────────────────────── */ -/* Struct: GpsData (size=28B, type_id=0x0596b0b7) */ -/* Sig: GpsData:float64_latitude,float64_longitude,float_speed_mps,float_heading_deg,flo... */ - -#define GPSDATA_TYPE_ID 0x0596b0b7u -#define GPSDATA_SCHEMA_VERSION 1 -#define GPSDATA_SCHEMA_HASH 0xd9be1a46u -#define GPSDATA_TYPE_NAME "GpsData" - -typedef struct { - double latitude; /**< float64 */ - double longitude; /**< float64 */ - float speed_mps; /**< float */ - float heading_deg; /**< float */ - float accuracy_m; /**< float */ -} GpsData; - -#ifdef __cplusplus -} /* close extern "C" — template specialization needs C++ linkage */ -/* C++ type traits for msg_cast(msg) */ -template<> struct msg_traits { - static constexpr uint32_t TYPE_ID = GPSDATA_TYPE_ID; - static constexpr uint8_t SCHEMA_VERSION = GPSDATA_SCHEMA_VERSION; - static constexpr const char* TYPE_NAME = "GpsData"; -}; -extern "C" { -#endif - -/** Serialize GpsData to buffer (endian-aware). */ -static inline int GpsData_serialize(const GpsData* src, - uint8_t* buf, size_t* out_size) { - if (!src) return -1; - size_t total = 28; - if (out_size) *out_size = total; - if (!buf) return 0; /* size query only */ - - if (buf) memcpy(buf + 0, &src->latitude, 8); - if (buf) memcpy(buf + 8, &src->longitude, 8); - if (buf) memcpy(buf + 16, &src->speed_mps, 4); - if (buf) memcpy(buf + 20, &src->heading_deg, 4); - if (buf) memcpy(buf + 24, &src->accuracy_m, 4); - return 0; -} - -/** Deserialize GpsData from buffer (endian-aware). */ -static inline int GpsData_deserialize(GpsData* dst, - const uint8_t* buf, size_t size) { - if (!dst || !buf) return -1; - if (size < 28) return -1; - memset(dst, 0, sizeof(*dst)); - - memcpy(&dst->latitude, buf + 0, 8); - memcpy(&dst->longitude, buf + 8, 8); - memcpy(&dst->speed_mps, buf + 16, 4); - memcpy(&dst->heading_deg, buf + 20, 4); - memcpy(&dst->accuracy_m, buf + 24, 4); - return 0; -} - -/** In-place endian swap for GpsData. */ -static inline void GpsData_endian_swap(void* data) { - if (!data) return; - uint8_t* p = (uint8_t*)data; - size_t off = 0; - - serializer_swap64(p + 0); - serializer_swap64(p + 8); - serializer_swap32(p + 16); - serializer_swap32(p + 20); - serializer_swap32(p + 24); -} - -/** Field-level schema descriptor table for GpsData. */ -static const FieldDesc GpsData_fields[] = { - { "latitude", FIELD_KIND_FLOAT, (uint16_t)offsetof(GpsData, latitude), 8, 1 }, - { "longitude", FIELD_KIND_FLOAT, (uint16_t)offsetof(GpsData, longitude), 8, 1 }, - { "speed_mps", FIELD_KIND_FLOAT, (uint16_t)offsetof(GpsData, speed_mps), 4, 1 }, - { "heading_deg", FIELD_KIND_FLOAT, (uint16_t)offsetof(GpsData, heading_deg), 4, 1 }, - { "accuracy_m", FIELD_KIND_FLOAT, (uint16_t)offsetof(GpsData, accuracy_m), 4, 1 }, -}; -#define GPSDATA_FIELD_COUNT (sizeof(GpsData_fields)/sizeof(GpsData_fields[0])) - -/** Auto-register GpsData in type registry. */ -static inline void GpsData_register_type(void) { - TypeRegistryEntry e = { - .type_id = GPSDATA_TYPE_ID, - .schema_version = GPSDATA_SCHEMA_VERSION, - .struct_size = sizeof(GpsData), - .type_name = "GpsData", - .serialize = (SerializeFunc)GpsData_serialize, - .deserialize = (DeserializeFunc)GpsData_deserialize, - .endian_swap = (EndianSwapFunc)GpsData_endian_swap, - .schema_hash = GPSDATA_SCHEMA_HASH, - .fields = GpsData_fields, - .field_count = (uint16_t)GPSDATA_FIELD_COUNT, - }; - serializer_register_type(&e); -} - -/* ──────────────────────────────────────────────────────── */ -/* Struct: Obstacle (size=33B, type_id=0x5d941266) */ -/* Sig: Obstacle:uint32_id,float_x,float_y,float_vx,float_vy,float_width,float_length,Ob... */ - -#define OBSTACLE_TYPE_ID 0x5d941266u -#define OBSTACLE_SCHEMA_VERSION 1 -#define OBSTACLE_SCHEMA_HASH 0xa5b34fdbu -#define OBSTACLE_TYPE_NAME "Obstacle" - -typedef struct { - uint32_t id; /**< uint32 */ - float x; /**< float */ - float y; /**< float */ - float vx; /**< float */ - float vy; /**< float */ - float width; /**< float */ - float length; /**< float */ - int8_t type; /**< ObstacleType */ - float confidence; /**< float */ -} Obstacle; - -#ifdef __cplusplus -} /* close extern "C" — template specialization needs C++ linkage */ -/* C++ type traits for msg_cast(msg) */ -template<> struct msg_traits { - static constexpr uint32_t TYPE_ID = OBSTACLE_TYPE_ID; - static constexpr uint8_t SCHEMA_VERSION = OBSTACLE_SCHEMA_VERSION; - static constexpr const char* TYPE_NAME = "Obstacle"; -}; -extern "C" { -#endif - -/** Serialize Obstacle to buffer (endian-aware). */ -static inline int Obstacle_serialize(const Obstacle* src, - uint8_t* buf, size_t* out_size) { - if (!src) return -1; - size_t total = 33; - if (out_size) *out_size = total; - if (!buf) return 0; /* size query only */ - - if (buf) memcpy(buf + 0, &src->id, 4); - if (buf) memcpy(buf + 4, &src->x, 4); - if (buf) memcpy(buf + 8, &src->y, 4); - if (buf) memcpy(buf + 12, &src->vx, 4); - if (buf) memcpy(buf + 16, &src->vy, 4); - if (buf) memcpy(buf + 20, &src->width, 4); - if (buf) memcpy(buf + 24, &src->length, 4); - if (buf) buf[28] = (int8_t)src->type; - if (buf) memcpy(buf + 29, &src->confidence, 4); - return 0; -} - -/** Deserialize Obstacle from buffer (endian-aware). */ -static inline int Obstacle_deserialize(Obstacle* dst, - const uint8_t* buf, size_t size) { - if (!dst || !buf) return -1; - if (size < 33) return -1; - memset(dst, 0, sizeof(*dst)); - - memcpy(&dst->id, buf + 0, 4); - memcpy(&dst->x, buf + 4, 4); - memcpy(&dst->y, buf + 8, 4); - memcpy(&dst->vx, buf + 12, 4); - memcpy(&dst->vy, buf + 16, 4); - memcpy(&dst->width, buf + 20, 4); - memcpy(&dst->length, buf + 24, 4); - dst->type = (int8_t)((int8_t)buf[28]); - memcpy(&dst->confidence, buf + 29, 4); - return 0; -} - -/** In-place endian swap for Obstacle. */ -static inline void Obstacle_endian_swap(void* data) { - if (!data) return; - uint8_t* p = (uint8_t*)data; - size_t off = 0; - - serializer_swap32(p + 0); - serializer_swap32(p + 4); - serializer_swap32(p + 8); - serializer_swap32(p + 12); - serializer_swap32(p + 16); - serializer_swap32(p + 20); - serializer_swap32(p + 24); - serializer_swap32(p + 29); -} - -/** Field-level schema descriptor table for Obstacle. */ -static const FieldDesc Obstacle_fields[] = { - { "id", FIELD_KIND_UINT, (uint16_t)offsetof(Obstacle, id), 4, 1 }, - { "x", FIELD_KIND_FLOAT, (uint16_t)offsetof(Obstacle, x), 4, 1 }, - { "y", FIELD_KIND_FLOAT, (uint16_t)offsetof(Obstacle, y), 4, 1 }, - { "vx", FIELD_KIND_FLOAT, (uint16_t)offsetof(Obstacle, vx), 4, 1 }, - { "vy", FIELD_KIND_FLOAT, (uint16_t)offsetof(Obstacle, vy), 4, 1 }, - { "width", FIELD_KIND_FLOAT, (uint16_t)offsetof(Obstacle, width), 4, 1 }, - { "length", FIELD_KIND_FLOAT, (uint16_t)offsetof(Obstacle, length), 4, 1 }, - { "type", FIELD_KIND_ENUM, (uint16_t)offsetof(Obstacle, type), 1, 1 }, - { "confidence", FIELD_KIND_FLOAT, (uint16_t)offsetof(Obstacle, confidence), 4, 1 }, -}; -#define OBSTACLE_FIELD_COUNT (sizeof(Obstacle_fields)/sizeof(Obstacle_fields[0])) - -/** Auto-register Obstacle in type registry. */ -static inline void Obstacle_register_type(void) { - TypeRegistryEntry e = { - .type_id = OBSTACLE_TYPE_ID, - .schema_version = OBSTACLE_SCHEMA_VERSION, - .struct_size = sizeof(Obstacle), - .type_name = "Obstacle", - .serialize = (SerializeFunc)Obstacle_serialize, - .deserialize = (DeserializeFunc)Obstacle_deserialize, - .endian_swap = (EndianSwapFunc)Obstacle_endian_swap, - .schema_hash = OBSTACLE_SCHEMA_HASH, - .fields = Obstacle_fields, - .field_count = (uint16_t)OBSTACLE_FIELD_COUNT, - }; - serializer_register_type(&e); -} - -/* ──────────────────────────────────────────────────────── */ -/* Struct: ObstacleList (size=280B, type_id=0x308f5f71) */ -/* Sig: ObstacleList:uint32_frame_id,uint64_timestamp_us,uint32_count,Obstacle:uint32_id... */ - -#define OBSTACLELIST_TYPE_ID 0x308f5f71u -#define OBSTACLELIST_SCHEMA_VERSION 1 -#define OBSTACLELIST_SCHEMA_HASH 0x7260c39du -#define OBSTACLELIST_TYPE_NAME "ObstacleList" - -typedef struct { - uint32_t frame_id; /**< uint32 */ - uint64_t timestamp_us; /**< uint64 */ - uint32_t count; /**< uint32 */ - Obstacle obstacles[8]; /**< Obstacle */ -} ObstacleList; - -#ifdef __cplusplus -} /* close extern "C" — template specialization needs C++ linkage */ -/* C++ type traits for msg_cast(msg) */ -template<> struct msg_traits { - static constexpr uint32_t TYPE_ID = OBSTACLELIST_TYPE_ID; - static constexpr uint8_t SCHEMA_VERSION = OBSTACLELIST_SCHEMA_VERSION; - static constexpr const char* TYPE_NAME = "ObstacleList"; -}; -extern "C" { -#endif - -/** Serialize ObstacleList to buffer (endian-aware). */ -static inline int ObstacleList_serialize(const ObstacleList* src, - uint8_t* buf, size_t* out_size) { - if (!src) return -1; - size_t total = 280; - if (out_size) *out_size = total; - if (!buf) return 0; /* size query only */ - - if (buf) memcpy(buf + 0, &src->frame_id, 4); - if (buf) memcpy(buf + 4, &src->timestamp_us, 8); - if (buf) memcpy(buf + 12, &src->count, 4); - { /* obstacles[0] */ - size_t sz = 0; - Obstacle_serialize(&src->obstacles[0], buf ? buf + 16 : NULL, &sz); - } - { /* obstacles[1] */ - size_t sz = 0; - Obstacle_serialize(&src->obstacles[1], buf ? buf + 49 : NULL, &sz); - } - { /* obstacles[2] */ - size_t sz = 0; - Obstacle_serialize(&src->obstacles[2], buf ? buf + 82 : NULL, &sz); - } - { /* obstacles[3] */ - size_t sz = 0; - Obstacle_serialize(&src->obstacles[3], buf ? buf + 115 : NULL, &sz); - } - { /* obstacles[4] */ - size_t sz = 0; - Obstacle_serialize(&src->obstacles[4], buf ? buf + 148 : NULL, &sz); - } - { /* obstacles[5] */ - size_t sz = 0; - Obstacle_serialize(&src->obstacles[5], buf ? buf + 181 : NULL, &sz); - } - { /* obstacles[6] */ - size_t sz = 0; - Obstacle_serialize(&src->obstacles[6], buf ? buf + 214 : NULL, &sz); - } - { /* obstacles[7] */ - size_t sz = 0; - Obstacle_serialize(&src->obstacles[7], buf ? buf + 247 : NULL, &sz); - } - return 0; -} - -/** Deserialize ObstacleList from buffer (endian-aware). */ -static inline int ObstacleList_deserialize(ObstacleList* dst, - const uint8_t* buf, size_t size) { - if (!dst || !buf) return -1; - if (size < 280) return -1; - memset(dst, 0, sizeof(*dst)); - - memcpy(&dst->frame_id, buf + 0, 4); - memcpy(&dst->timestamp_us, buf + 4, 8); - memcpy(&dst->count, buf + 12, 4); - { /* obstacles[0] */ - Obstacle_deserialize(&dst->obstacles[0], buf + 16, 33); - } - { /* obstacles[1] */ - Obstacle_deserialize(&dst->obstacles[1], buf + 49, 33); - } - { /* obstacles[2] */ - Obstacle_deserialize(&dst->obstacles[2], buf + 82, 33); - } - { /* obstacles[3] */ - Obstacle_deserialize(&dst->obstacles[3], buf + 115, 33); - } - { /* obstacles[4] */ - Obstacle_deserialize(&dst->obstacles[4], buf + 148, 33); - } - { /* obstacles[5] */ - Obstacle_deserialize(&dst->obstacles[5], buf + 181, 33); - } - { /* obstacles[6] */ - Obstacle_deserialize(&dst->obstacles[6], buf + 214, 33); - } - { /* obstacles[7] */ - Obstacle_deserialize(&dst->obstacles[7], buf + 247, 33); - } - return 0; -} - -/** In-place endian swap for ObstacleList. */ -static inline void ObstacleList_endian_swap(void* data) { - if (!data) return; - uint8_t* p = (uint8_t*)data; - size_t off = 0; - - serializer_swap32(p + 0); - serializer_swap64(p + 4); - serializer_swap32(p + 12); - Obstacle_endian_swap(p + 16); - Obstacle_endian_swap(p + 49); - Obstacle_endian_swap(p + 82); - Obstacle_endian_swap(p + 115); - Obstacle_endian_swap(p + 148); - Obstacle_endian_swap(p + 181); - Obstacle_endian_swap(p + 214); - Obstacle_endian_swap(p + 247); -} - -/** Field-level schema descriptor table for ObstacleList. */ -static const FieldDesc ObstacleList_fields[] = { - { "frame_id", FIELD_KIND_UINT, (uint16_t)offsetof(ObstacleList, frame_id), 4, 1 }, - { "timestamp_us", FIELD_KIND_UINT, (uint16_t)offsetof(ObstacleList, timestamp_us), 8, 1 }, - { "count", FIELD_KIND_UINT, (uint16_t)offsetof(ObstacleList, count), 4, 1 }, - { "obstacles", FIELD_KIND_NESTED, (uint16_t)offsetof(ObstacleList, obstacles), 33, 8 }, -}; -#define OBSTACLELIST_FIELD_COUNT (sizeof(ObstacleList_fields)/sizeof(ObstacleList_fields[0])) - -/** Auto-register ObstacleList in type registry. */ -static inline void ObstacleList_register_type(void) { - TypeRegistryEntry e = { - .type_id = OBSTACLELIST_TYPE_ID, - .schema_version = OBSTACLELIST_SCHEMA_VERSION, - .struct_size = sizeof(ObstacleList), - .type_name = "ObstacleList", - .serialize = (SerializeFunc)ObstacleList_serialize, - .deserialize = (DeserializeFunc)ObstacleList_deserialize, - .endian_swap = (EndianSwapFunc)ObstacleList_endian_swap, - .schema_hash = OBSTACLELIST_SCHEMA_HASH, - .fields = ObstacleList_fields, - .field_count = (uint16_t)OBSTACLELIST_FIELD_COUNT, - }; - serializer_register_type(&e); -} - -/* ──────────────────────────────────────────────────────── */ -/* Struct: EgoState (size=32B, type_id=0x212dcff7) */ -/* Sig: EgoState:float64_latitude,float64_longitude,float_heading_deg,float_speed_mps,fl... */ - -#define EGOSTATE_TYPE_ID 0x212dcff7u -#define EGOSTATE_SCHEMA_VERSION 1 -#define EGOSTATE_SCHEMA_HASH 0xb3550a53u -#define EGOSTATE_TYPE_NAME "EgoState" - -typedef struct { - double latitude; /**< float64 */ - double longitude; /**< float64 */ - float heading_deg; /**< float */ - float speed_mps; /**< float */ - float yaw_rate_dps; /**< float */ - float acceleration_mss; /**< float */ -} EgoState; - -#ifdef __cplusplus -} /* close extern "C" — template specialization needs C++ linkage */ -/* C++ type traits for msg_cast(msg) */ -template<> struct msg_traits { - static constexpr uint32_t TYPE_ID = EGOSTATE_TYPE_ID; - static constexpr uint8_t SCHEMA_VERSION = EGOSTATE_SCHEMA_VERSION; - static constexpr const char* TYPE_NAME = "EgoState"; -}; -extern "C" { -#endif - -/** Serialize EgoState to buffer (endian-aware). */ -static inline int EgoState_serialize(const EgoState* src, - uint8_t* buf, size_t* out_size) { - if (!src) return -1; - size_t total = 32; - if (out_size) *out_size = total; - if (!buf) return 0; /* size query only */ - - if (buf) memcpy(buf + 0, &src->latitude, 8); - if (buf) memcpy(buf + 8, &src->longitude, 8); - if (buf) memcpy(buf + 16, &src->heading_deg, 4); - if (buf) memcpy(buf + 20, &src->speed_mps, 4); - if (buf) memcpy(buf + 24, &src->yaw_rate_dps, 4); - if (buf) memcpy(buf + 28, &src->acceleration_mss, 4); - return 0; -} - -/** Deserialize EgoState from buffer (endian-aware). */ -static inline int EgoState_deserialize(EgoState* dst, - const uint8_t* buf, size_t size) { - if (!dst || !buf) return -1; - if (size < 32) return -1; - memset(dst, 0, sizeof(*dst)); - - memcpy(&dst->latitude, buf + 0, 8); - memcpy(&dst->longitude, buf + 8, 8); - memcpy(&dst->heading_deg, buf + 16, 4); - memcpy(&dst->speed_mps, buf + 20, 4); - memcpy(&dst->yaw_rate_dps, buf + 24, 4); - memcpy(&dst->acceleration_mss, buf + 28, 4); - return 0; -} - -/** In-place endian swap for EgoState. */ -static inline void EgoState_endian_swap(void* data) { - if (!data) return; - uint8_t* p = (uint8_t*)data; - size_t off = 0; - - serializer_swap64(p + 0); - serializer_swap64(p + 8); - serializer_swap32(p + 16); - serializer_swap32(p + 20); - serializer_swap32(p + 24); - serializer_swap32(p + 28); -} - -/** Field-level schema descriptor table for EgoState. */ -static const FieldDesc EgoState_fields[] = { - { "latitude", FIELD_KIND_FLOAT, (uint16_t)offsetof(EgoState, latitude), 8, 1 }, - { "longitude", FIELD_KIND_FLOAT, (uint16_t)offsetof(EgoState, longitude), 8, 1 }, - { "heading_deg", FIELD_KIND_FLOAT, (uint16_t)offsetof(EgoState, heading_deg), 4, 1 }, - { "speed_mps", FIELD_KIND_FLOAT, (uint16_t)offsetof(EgoState, speed_mps), 4, 1 }, - { "yaw_rate_dps", FIELD_KIND_FLOAT, (uint16_t)offsetof(EgoState, yaw_rate_dps), 4, 1 }, - { "acceleration_mss", FIELD_KIND_FLOAT, (uint16_t)offsetof(EgoState, acceleration_mss), 4, 1 }, -}; -#define EGOSTATE_FIELD_COUNT (sizeof(EgoState_fields)/sizeof(EgoState_fields[0])) - -/** Auto-register EgoState in type registry. */ -static inline void EgoState_register_type(void) { - TypeRegistryEntry e = { - .type_id = EGOSTATE_TYPE_ID, - .schema_version = EGOSTATE_SCHEMA_VERSION, - .struct_size = sizeof(EgoState), - .type_name = "EgoState", - .serialize = (SerializeFunc)EgoState_serialize, - .deserialize = (DeserializeFunc)EgoState_deserialize, - .endian_swap = (EndianSwapFunc)EgoState_endian_swap, - .schema_hash = EGOSTATE_SCHEMA_HASH, - .fields = EgoState_fields, - .field_count = (uint16_t)EGOSTATE_FIELD_COUNT, - }; - serializer_register_type(&e); -} - -/* ──────────────────────────────────────────────────────── */ -/* Struct: Localization (size=57B, type_id=0xda16ffb9) */ -/* Sig: Localization:float_x,float_y,float_v,float_heading,float_yaw_rate,float_cov_xx,f... */ - -#define LOCALIZATION_TYPE_ID 0xda16ffb9u -#define LOCALIZATION_SCHEMA_VERSION 1 -#define LOCALIZATION_SCHEMA_HASH 0xfb377b50u -#define LOCALIZATION_TYPE_NAME "Localization" - -typedef struct { - float x; /**< float */ - float y; /**< float */ - float v; /**< float */ - float heading; /**< float */ - float yaw_rate; /**< float */ - float cov_xx; /**< float */ - float cov_yy; /**< float */ - float cov_vv; /**< float */ - float cov_hh; /**< float */ - float cov_yyaw; /**< float */ - float innovation; /**< float */ - bool diverged; /**< bool */ - float raw_pos_x; /**< float */ - float raw_pos_y; /**< float */ - float raw_speed; /**< float */ -} Localization; - -#ifdef __cplusplus -} /* close extern "C" — template specialization needs C++ linkage */ -/* C++ type traits for msg_cast(msg) */ -template<> struct msg_traits { - static constexpr uint32_t TYPE_ID = LOCALIZATION_TYPE_ID; - static constexpr uint8_t SCHEMA_VERSION = LOCALIZATION_SCHEMA_VERSION; - static constexpr const char* TYPE_NAME = "Localization"; -}; -extern "C" { -#endif - -/** Serialize Localization to buffer (endian-aware). */ -static inline int Localization_serialize(const Localization* src, - uint8_t* buf, size_t* out_size) { - if (!src) return -1; - size_t total = 57; - if (out_size) *out_size = total; - if (!buf) return 0; /* size query only */ - - if (buf) memcpy(buf + 0, &src->x, 4); - if (buf) memcpy(buf + 4, &src->y, 4); - if (buf) memcpy(buf + 8, &src->v, 4); - if (buf) memcpy(buf + 12, &src->heading, 4); - if (buf) memcpy(buf + 16, &src->yaw_rate, 4); - if (buf) memcpy(buf + 20, &src->cov_xx, 4); - if (buf) memcpy(buf + 24, &src->cov_yy, 4); - if (buf) memcpy(buf + 28, &src->cov_vv, 4); - if (buf) memcpy(buf + 32, &src->cov_hh, 4); - if (buf) memcpy(buf + 36, &src->cov_yyaw, 4); - if (buf) memcpy(buf + 40, &src->innovation, 4); - if (buf) buf[44] = (uint8_t)src->diverged; - if (buf) memcpy(buf + 45, &src->raw_pos_x, 4); - if (buf) memcpy(buf + 49, &src->raw_pos_y, 4); - if (buf) memcpy(buf + 53, &src->raw_speed, 4); - return 0; -} - -/** Deserialize Localization from buffer (endian-aware). */ -static inline int Localization_deserialize(Localization* dst, - const uint8_t* buf, size_t size) { - if (!dst || !buf) return -1; - if (size < 57) return -1; - memset(dst, 0, sizeof(*dst)); - - memcpy(&dst->x, buf + 0, 4); - memcpy(&dst->y, buf + 4, 4); - memcpy(&dst->v, buf + 8, 4); - memcpy(&dst->heading, buf + 12, 4); - memcpy(&dst->yaw_rate, buf + 16, 4); - memcpy(&dst->cov_xx, buf + 20, 4); - memcpy(&dst->cov_yy, buf + 24, 4); - memcpy(&dst->cov_vv, buf + 28, 4); - memcpy(&dst->cov_hh, buf + 32, 4); - memcpy(&dst->cov_yyaw, buf + 36, 4); - memcpy(&dst->innovation, buf + 40, 4); - dst->diverged = (bool)buf[44]; - memcpy(&dst->raw_pos_x, buf + 45, 4); - memcpy(&dst->raw_pos_y, buf + 49, 4); - memcpy(&dst->raw_speed, buf + 53, 4); - return 0; -} - -/** In-place endian swap for Localization. */ -static inline void Localization_endian_swap(void* data) { - if (!data) return; - uint8_t* p = (uint8_t*)data; - size_t off = 0; - - serializer_swap32(p + 0); - serializer_swap32(p + 4); - serializer_swap32(p + 8); - serializer_swap32(p + 12); - serializer_swap32(p + 16); - serializer_swap32(p + 20); - serializer_swap32(p + 24); - serializer_swap32(p + 28); - serializer_swap32(p + 32); - serializer_swap32(p + 36); - serializer_swap32(p + 40); - serializer_swap32(p + 45); - serializer_swap32(p + 49); - serializer_swap32(p + 53); -} - -/** Field-level schema descriptor table for Localization. */ -static const FieldDesc Localization_fields[] = { - { "x", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, x), 4, 1 }, - { "y", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, y), 4, 1 }, - { "v", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, v), 4, 1 }, - { "heading", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, heading), 4, 1 }, - { "yaw_rate", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, yaw_rate), 4, 1 }, - { "cov_xx", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, cov_xx), 4, 1 }, - { "cov_yy", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, cov_yy), 4, 1 }, - { "cov_vv", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, cov_vv), 4, 1 }, - { "cov_hh", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, cov_hh), 4, 1 }, - { "cov_yyaw", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, cov_yyaw), 4, 1 }, - { "innovation", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, innovation), 4, 1 }, - { "diverged", FIELD_KIND_BOOL, (uint16_t)offsetof(Localization, diverged), 1, 1 }, - { "raw_pos_x", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, raw_pos_x), 4, 1 }, - { "raw_pos_y", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, raw_pos_y), 4, 1 }, - { "raw_speed", FIELD_KIND_FLOAT, (uint16_t)offsetof(Localization, raw_speed), 4, 1 }, -}; -#define LOCALIZATION_FIELD_COUNT (sizeof(Localization_fields)/sizeof(Localization_fields[0])) - -/** Auto-register Localization in type registry. */ -static inline void Localization_register_type(void) { - TypeRegistryEntry e = { - .type_id = LOCALIZATION_TYPE_ID, - .schema_version = LOCALIZATION_SCHEMA_VERSION, - .struct_size = sizeof(Localization), - .type_name = "Localization", - .serialize = (SerializeFunc)Localization_serialize, - .deserialize = (DeserializeFunc)Localization_deserialize, - .endian_swap = (EndianSwapFunc)Localization_endian_swap, - .schema_hash = LOCALIZATION_SCHEMA_HASH, - .fields = Localization_fields, - .field_count = (uint16_t)LOCALIZATION_FIELD_COUNT, - }; - serializer_register_type(&e); -} - -/* ──────────────────────────────────────────────────────── */ -/* Struct: LatencyReport (size=12B, type_id=0xe5c06baf) */ -/* Sig: LatencyReport:uint32_avg_us,uint32_p50_us,uint32_p99_us... */ - -#define LATENCYREPORT_TYPE_ID 0xe5c06bafu -#define LATENCYREPORT_SCHEMA_VERSION 1 -#define LATENCYREPORT_SCHEMA_HASH 0x4b4b29e6u -#define LATENCYREPORT_TYPE_NAME "LatencyReport" - -typedef struct { - uint32_t avg_us; /**< uint32 */ - uint32_t p50_us; /**< uint32 */ - uint32_t p99_us; /**< uint32 */ -} LatencyReport; - -#ifdef __cplusplus -} /* close extern "C" — template specialization needs C++ linkage */ -/* C++ type traits for msg_cast(msg) */ -template<> struct msg_traits { - static constexpr uint32_t TYPE_ID = LATENCYREPORT_TYPE_ID; - static constexpr uint8_t SCHEMA_VERSION = LATENCYREPORT_SCHEMA_VERSION; - static constexpr const char* TYPE_NAME = "LatencyReport"; -}; -extern "C" { -#endif - -/** Serialize LatencyReport to buffer (endian-aware). */ -static inline int LatencyReport_serialize(const LatencyReport* src, - uint8_t* buf, size_t* out_size) { - if (!src) return -1; - size_t total = 12; - if (out_size) *out_size = total; - if (!buf) return 0; /* size query only */ - - if (buf) memcpy(buf + 0, &src->avg_us, 4); - if (buf) memcpy(buf + 4, &src->p50_us, 4); - if (buf) memcpy(buf + 8, &src->p99_us, 4); - return 0; -} - -/** Deserialize LatencyReport from buffer (endian-aware). */ -static inline int LatencyReport_deserialize(LatencyReport* dst, - const uint8_t* buf, size_t size) { - if (!dst || !buf) return -1; - if (size < 12) return -1; - memset(dst, 0, sizeof(*dst)); - - memcpy(&dst->avg_us, buf + 0, 4); - memcpy(&dst->p50_us, buf + 4, 4); - memcpy(&dst->p99_us, buf + 8, 4); - return 0; -} - -/** In-place endian swap for LatencyReport. */ -static inline void LatencyReport_endian_swap(void* data) { - if (!data) return; - uint8_t* p = (uint8_t*)data; - size_t off = 0; - - serializer_swap32(p + 0); - serializer_swap32(p + 4); - serializer_swap32(p + 8); -} - -/** Field-level schema descriptor table for LatencyReport. */ -static const FieldDesc LatencyReport_fields[] = { - { "avg_us", FIELD_KIND_UINT, (uint16_t)offsetof(LatencyReport, avg_us), 4, 1 }, - { "p50_us", FIELD_KIND_UINT, (uint16_t)offsetof(LatencyReport, p50_us), 4, 1 }, - { "p99_us", FIELD_KIND_UINT, (uint16_t)offsetof(LatencyReport, p99_us), 4, 1 }, -}; -#define LATENCYREPORT_FIELD_COUNT (sizeof(LatencyReport_fields)/sizeof(LatencyReport_fields[0])) - -/** Auto-register LatencyReport in type registry. */ -static inline void LatencyReport_register_type(void) { - TypeRegistryEntry e = { - .type_id = LATENCYREPORT_TYPE_ID, - .schema_version = LATENCYREPORT_SCHEMA_VERSION, - .struct_size = sizeof(LatencyReport), - .type_name = "LatencyReport", - .serialize = (SerializeFunc)LatencyReport_serialize, - .deserialize = (DeserializeFunc)LatencyReport_deserialize, - .endian_swap = (EndianSwapFunc)LatencyReport_endian_swap, - .schema_hash = LATENCYREPORT_SCHEMA_HASH, - .fields = LatencyReport_fields, - .field_count = (uint16_t)LATENCYREPORT_FIELD_COUNT, - }; - serializer_register_type(&e); -} - -/* ──────────────────────────────────────────────────────── */ -/* Struct: ControlRaw (size=52B, type_id=0x871712d1) */ -/* Sig: ControlRaw:uint32_seq,float_throttle,float_brake,float_steering,float_speed,floa... */ - -#define CONTROLRAW_TYPE_ID 0x871712d1u -#define CONTROLRAW_SCHEMA_VERSION 1 -#define CONTROLRAW_SCHEMA_HASH 0x72f385ccu -#define CONTROLRAW_TYPE_NAME "ControlRaw" - -typedef struct { - uint32_t seq; /**< uint32 */ - float throttle; /**< float */ - float brake; /**< float */ - float steering; /**< float */ - float speed; /**< float */ - float target; /**< float */ - float error; /**< float */ - char mode[24]; /**< char */ -} ControlRaw; - -#ifdef __cplusplus -} /* close extern "C" — template specialization needs C++ linkage */ -/* C++ type traits for msg_cast(msg) */ -template<> struct msg_traits { - static constexpr uint32_t TYPE_ID = CONTROLRAW_TYPE_ID; - static constexpr uint8_t SCHEMA_VERSION = CONTROLRAW_SCHEMA_VERSION; - static constexpr const char* TYPE_NAME = "ControlRaw"; -}; -extern "C" { -#endif - -/** Serialize ControlRaw to buffer (endian-aware). */ -static inline int ControlRaw_serialize(const ControlRaw* src, - uint8_t* buf, size_t* out_size) { - if (!src) return -1; - size_t total = 52; - if (out_size) *out_size = total; - if (!buf) return 0; /* size query only */ - - if (buf) memcpy(buf + 0, &src->seq, 4); - if (buf) memcpy(buf + 4, &src->throttle, 4); - if (buf) memcpy(buf + 8, &src->brake, 4); - if (buf) memcpy(buf + 12, &src->steering, 4); - if (buf) memcpy(buf + 16, &src->speed, 4); - if (buf) memcpy(buf + 20, &src->target, 4); - if (buf) memcpy(buf + 24, &src->error, 4); - if (buf) buf[28] = (uint8_t)src->mode[0]; - if (buf) buf[29] = (uint8_t)src->mode[1]; - if (buf) buf[30] = (uint8_t)src->mode[2]; - if (buf) buf[31] = (uint8_t)src->mode[3]; - if (buf) buf[32] = (uint8_t)src->mode[4]; - if (buf) buf[33] = (uint8_t)src->mode[5]; - if (buf) buf[34] = (uint8_t)src->mode[6]; - if (buf) buf[35] = (uint8_t)src->mode[7]; - if (buf) buf[36] = (uint8_t)src->mode[8]; - if (buf) buf[37] = (uint8_t)src->mode[9]; - if (buf) buf[38] = (uint8_t)src->mode[10]; - if (buf) buf[39] = (uint8_t)src->mode[11]; - if (buf) buf[40] = (uint8_t)src->mode[12]; - if (buf) buf[41] = (uint8_t)src->mode[13]; - if (buf) buf[42] = (uint8_t)src->mode[14]; - if (buf) buf[43] = (uint8_t)src->mode[15]; - if (buf) buf[44] = (uint8_t)src->mode[16]; - if (buf) buf[45] = (uint8_t)src->mode[17]; - if (buf) buf[46] = (uint8_t)src->mode[18]; - if (buf) buf[47] = (uint8_t)src->mode[19]; - if (buf) buf[48] = (uint8_t)src->mode[20]; - if (buf) buf[49] = (uint8_t)src->mode[21]; - if (buf) buf[50] = (uint8_t)src->mode[22]; - if (buf) buf[51] = (uint8_t)src->mode[23]; - return 0; -} - -/** Deserialize ControlRaw from buffer (endian-aware). */ -static inline int ControlRaw_deserialize(ControlRaw* dst, - const uint8_t* buf, size_t size) { - if (!dst || !buf) return -1; - if (size < 52) return -1; - memset(dst, 0, sizeof(*dst)); - - memcpy(&dst->seq, buf + 0, 4); - memcpy(&dst->throttle, buf + 4, 4); - memcpy(&dst->brake, buf + 8, 4); - memcpy(&dst->steering, buf + 12, 4); - memcpy(&dst->speed, buf + 16, 4); - memcpy(&dst->target, buf + 20, 4); - memcpy(&dst->error, buf + 24, 4); - dst->mode[0] = (char)buf[28]; - dst->mode[1] = (char)buf[29]; - dst->mode[2] = (char)buf[30]; - dst->mode[3] = (char)buf[31]; - dst->mode[4] = (char)buf[32]; - dst->mode[5] = (char)buf[33]; - dst->mode[6] = (char)buf[34]; - dst->mode[7] = (char)buf[35]; - dst->mode[8] = (char)buf[36]; - dst->mode[9] = (char)buf[37]; - dst->mode[10] = (char)buf[38]; - dst->mode[11] = (char)buf[39]; - dst->mode[12] = (char)buf[40]; - dst->mode[13] = (char)buf[41]; - dst->mode[14] = (char)buf[42]; - dst->mode[15] = (char)buf[43]; - dst->mode[16] = (char)buf[44]; - dst->mode[17] = (char)buf[45]; - dst->mode[18] = (char)buf[46]; - dst->mode[19] = (char)buf[47]; - dst->mode[20] = (char)buf[48]; - dst->mode[21] = (char)buf[49]; - dst->mode[22] = (char)buf[50]; - dst->mode[23] = (char)buf[51]; - return 0; -} - -/** In-place endian swap for ControlRaw. */ -static inline void ControlRaw_endian_swap(void* data) { - if (!data) return; - uint8_t* p = (uint8_t*)data; - size_t off = 0; - - serializer_swap32(p + 0); - serializer_swap32(p + 4); - serializer_swap32(p + 8); - serializer_swap32(p + 12); - serializer_swap32(p + 16); - serializer_swap32(p + 20); - serializer_swap32(p + 24); -} - -/** Field-level schema descriptor table for ControlRaw. */ -static const FieldDesc ControlRaw_fields[] = { - { "seq", FIELD_KIND_UINT, (uint16_t)offsetof(ControlRaw, seq), 4, 1 }, - { "throttle", FIELD_KIND_FLOAT, (uint16_t)offsetof(ControlRaw, throttle), 4, 1 }, - { "brake", FIELD_KIND_FLOAT, (uint16_t)offsetof(ControlRaw, brake), 4, 1 }, - { "steering", FIELD_KIND_FLOAT, (uint16_t)offsetof(ControlRaw, steering), 4, 1 }, - { "speed", FIELD_KIND_FLOAT, (uint16_t)offsetof(ControlRaw, speed), 4, 1 }, - { "target", FIELD_KIND_FLOAT, (uint16_t)offsetof(ControlRaw, target), 4, 1 }, - { "error", FIELD_KIND_FLOAT, (uint16_t)offsetof(ControlRaw, error), 4, 1 }, - { "mode", FIELD_KIND_UNKNOWN, (uint16_t)offsetof(ControlRaw, mode), 1, 24 }, -}; -#define CONTROLRAW_FIELD_COUNT (sizeof(ControlRaw_fields)/sizeof(ControlRaw_fields[0])) - -/** Auto-register ControlRaw in type registry. */ -static inline void ControlRaw_register_type(void) { - TypeRegistryEntry e = { - .type_id = CONTROLRAW_TYPE_ID, - .schema_version = CONTROLRAW_SCHEMA_VERSION, - .struct_size = sizeof(ControlRaw), - .type_name = "ControlRaw", - .serialize = (SerializeFunc)ControlRaw_serialize, - .deserialize = (DeserializeFunc)ControlRaw_deserialize, - .endian_swap = (EndianSwapFunc)ControlRaw_endian_swap, - .schema_hash = CONTROLRAW_SCHEMA_HASH, - .fields = ControlRaw_fields, - .field_count = (uint16_t)CONTROLRAW_FIELD_COUNT, - }; - serializer_register_type(&e); -} - -/* ──────────────────────────────────────────────────────── */ -/* Struct: ControlCmd (size=18B, type_id=0x2d95c6d2) */ -/* Sig: ControlCmd:uint32_seq,float_throttle,float_brake,float_steering,Gear_gear,bool_e... */ - -#define CONTROLCMD_TYPE_ID 0x2d95c6d2u -#define CONTROLCMD_SCHEMA_VERSION 1 -#define CONTROLCMD_SCHEMA_HASH 0x8303b978u -#define CONTROLCMD_TYPE_NAME "ControlCmd" - -typedef struct { - uint32_t seq; /**< uint32 */ - float throttle; /**< float */ - float brake; /**< float */ - float steering; /**< float */ - int8_t gear; /**< Gear */ - bool emergency_stop; /**< bool */ -} ControlCmd; - -#ifdef __cplusplus -} /* close extern "C" — template specialization needs C++ linkage */ -/* C++ type traits for msg_cast(msg) */ -template<> struct msg_traits { - static constexpr uint32_t TYPE_ID = CONTROLCMD_TYPE_ID; - static constexpr uint8_t SCHEMA_VERSION = CONTROLCMD_SCHEMA_VERSION; - static constexpr const char* TYPE_NAME = "ControlCmd"; -}; -extern "C" { -#endif - -/** Serialize ControlCmd to buffer (endian-aware). */ -static inline int ControlCmd_serialize(const ControlCmd* src, - uint8_t* buf, size_t* out_size) { - if (!src) return -1; - size_t total = 18; - if (out_size) *out_size = total; - if (!buf) return 0; /* size query only */ - - if (buf) memcpy(buf + 0, &src->seq, 4); - if (buf) memcpy(buf + 4, &src->throttle, 4); - if (buf) memcpy(buf + 8, &src->brake, 4); - if (buf) memcpy(buf + 12, &src->steering, 4); - if (buf) buf[16] = (int8_t)src->gear; - if (buf) buf[17] = (uint8_t)src->emergency_stop; - return 0; -} - -/** Deserialize ControlCmd from buffer (endian-aware). */ -static inline int ControlCmd_deserialize(ControlCmd* dst, - const uint8_t* buf, size_t size) { - if (!dst || !buf) return -1; - if (size < 18) return -1; - memset(dst, 0, sizeof(*dst)); - - memcpy(&dst->seq, buf + 0, 4); - memcpy(&dst->throttle, buf + 4, 4); - memcpy(&dst->brake, buf + 8, 4); - memcpy(&dst->steering, buf + 12, 4); - dst->gear = (int8_t)((int8_t)buf[16]); - dst->emergency_stop = (bool)buf[17]; - return 0; -} - -/** In-place endian swap for ControlCmd. */ -static inline void ControlCmd_endian_swap(void* data) { - if (!data) return; - uint8_t* p = (uint8_t*)data; - size_t off = 0; - - serializer_swap32(p + 0); - serializer_swap32(p + 4); - serializer_swap32(p + 8); - serializer_swap32(p + 12); -} - -/** Field-level schema descriptor table for ControlCmd. */ -static const FieldDesc ControlCmd_fields[] = { - { "seq", FIELD_KIND_UINT, (uint16_t)offsetof(ControlCmd, seq), 4, 1 }, - { "throttle", FIELD_KIND_FLOAT, (uint16_t)offsetof(ControlCmd, throttle), 4, 1 }, - { "brake", FIELD_KIND_FLOAT, (uint16_t)offsetof(ControlCmd, brake), 4, 1 }, - { "steering", FIELD_KIND_FLOAT, (uint16_t)offsetof(ControlCmd, steering), 4, 1 }, - { "gear", FIELD_KIND_ENUM, (uint16_t)offsetof(ControlCmd, gear), 1, 1 }, - { "emergency_stop", FIELD_KIND_BOOL, (uint16_t)offsetof(ControlCmd, emergency_stop), 1, 1 }, -}; -#define CONTROLCMD_FIELD_COUNT (sizeof(ControlCmd_fields)/sizeof(ControlCmd_fields[0])) - -/** Auto-register ControlCmd in type registry. */ -static inline void ControlCmd_register_type(void) { - TypeRegistryEntry e = { - .type_id = CONTROLCMD_TYPE_ID, - .schema_version = CONTROLCMD_SCHEMA_VERSION, - .struct_size = sizeof(ControlCmd), - .type_name = "ControlCmd", - .serialize = (SerializeFunc)ControlCmd_serialize, - .deserialize = (DeserializeFunc)ControlCmd_deserialize, - .endian_swap = (EndianSwapFunc)ControlCmd_endian_swap, - .schema_hash = CONTROLCMD_SCHEMA_HASH, - .fields = ControlCmd_fields, - .field_count = (uint16_t)CONTROLCMD_FIELD_COUNT, - }; - serializer_register_type(&e); -} - -/* ── Batch registration ─────────────────────────────── */ - -/** - * Register all ADAS message types in the type registry. - * Call once during initialization (idempotent). - */ -static inline void adas_msgs_register_all(void) { - LidarFrame_register_type(); - GpsData_register_type(); - Obstacle_register_type(); - ObstacleList_register_type(); - EgoState_register_type(); - Localization_register_type(); - LatencyReport_register_type(); - ControlRaw_register_type(); - ControlCmd_register_type(); -} - - -#ifdef __cplusplus -} -#endif - -#endif /* ADAS_MSGS_GEN_H */ \ No newline at end of file