feat(track-core): add portable training runtimes

Move scheme and PID training runtime behavior into the pure track_core layer and expose render sinks for injected strip application.

Add ESP compatibility adapters, Python bindings/test scaffolding, and in-memory render support so app_track_bt can consume core render and runtime logic without duplicating it.

Cover circular/linear rendering boundaries, all scheme runtime types, scheme render_to parity, PID sample de-duplication, speed suppression, and live tuning in track-core tests.
This commit is contained in:
2026-05-18 16:15:45 +08:00
parent 84598cad20
commit 1005e50be0
24 changed files with 4169 additions and 15 deletions
+28 -1
View File
@@ -2,14 +2,27 @@ set(TRACK_CORE_SOURCES
src/memory_strip.cpp
src/model.cpp
src/pid_program.cpp
src/pid_runtime.cpp
src/render.cpp
src/scheme_decoder.cpp
src/scheme_runtime.cpp
)
if(DEFINED IDF_TARGET)
set(TRACK_CORE_IDF_SOURCES
src/esp/app_track_decoder.cpp
src/esp/app_track_drawer.cpp
src/esp/app_track_model.cpp
)
idf_component_register(
SRCS ${TRACK_CORE_SOURCES}
SRCS ${TRACK_CORE_SOURCES} ${TRACK_CORE_IDF_SOURCES}
INCLUDE_DIRS include
REQUIRES
app_proto
app_strip_if
app_utils
app_utils_clock
)
else()
cmake_minimum_required(VERSION 3.20)
@@ -25,7 +38,21 @@ else()
)
target_compile_features(track_core PUBLIC cxx_std_23)
option(TRACK_CORE_BUILD_PYTHON "Build Python bindings" OFF)
option(TRACK_CORE_BUILD_TESTS "Build track-core tests" ON)
if(TRACK_CORE_BUILD_PYTHON)
find_package(Python 3.9 COMPONENTS Interpreter Development.Module REQUIRED)
find_package(nanobind CONFIG REQUIRED)
nanobind_add_module(_core
src/python/bindings.cpp
)
target_link_libraries(_core PRIVATE track_core::track_core)
target_compile_features(_core PRIVATE cxx_std_23)
install(TARGETS _core LIBRARY DESTINATION track_core)
endif()
if(TRACK_CORE_BUILD_TESTS)
enable_testing()
add_executable(track_core_tests tests/track_core_tests.cpp)