Skip to content

refactor(firmware): extract vehicle state estimator (LOS-166) - #309

Merged
LostPointer merged 3 commits into
developfrom
lostpointmeister/los-166-core-estimator
Jul 28, 2026
Merged

refactor(firmware): extract vehicle state estimator (LOS-166)#309
LostPointer merged 3 commits into
developfrom
lostpointmeister/los-166-core-estimator

Conversation

@LostPointer

Copy link
Copy Markdown
Contributor

Описание

Первый этап LOS-166: логика оценки состояния вынесена из ControlLoopProcessor в отдельный VehicleStateEstimator без изменения математики и внешних контрактов контура управления.

Тип изменения

  • Исправление ошибки
  • Новая функциональность
  • Критическое изменение
  • Рефакторинг
  • Тесты

Что изменено

  • Добавлены VehicleStateEstimator и явные структуры входного/выходного снимка.
  • Вынесена оркестрация Tilt/EKF, коррекции центра масс, компенсации гравитации, ZUPT, привязки скорости к модели двигателя и NHC.
  • Упрощён ControlLoopProcessor; добавлены 7 unit-тестов и регистрация новых файлов в host/ESP32 CMake.
  • Поведение ImuHandler, Madgwick и LOS-221 намеренно не изменялось.

Как протестировано

  1. Полная host-сборка и запуск unit-тестов: 995 тестов из 66 наборов прошли.
  2. Сборка sim_host.
  3. Сборка с RC_PROFILE_LOOP=ON; тесты estimator прошли.
  4. git diff --check — без ошибок.

Сборка ESP-IDF на целевую платформу не запускалась: idf.py недоступен в окружении. clang-format также отсутствует; новые файлы вручную проверены на длину строк.

Чек-лист

  • Код соответствует стилю проекта
  • Добавлены unit-тесты
  • Все доступные локальные тесты проходят
  • Выполнен self-review
  • Нет отладочного или закомментированного кода
  • Учтены граничные сценарии estimator
  • Проверена сборка ESP-IDF на целевой платформе

Breaking Changes

Нет.

Производительность

На целевом оборудовании не измерялась. Граница profiler stage сохранена.

Связанные задачи

Related to LOS-166.

На что обратить внимание при ревью

  • Эквивалентность поведения до и после выделения estimator.
  • Граница ответственности VehicleStateEstimator.
  • Копирование конфигурации на каждом такте.
  • Сохранение границы profiler stage.

@LostPointer
LostPointer marked this pull request as ready for review July 28, 2026 09:44

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2a25bdb3e7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread projects/rc_vehicle/firmware/common/control_loop_processor.cpp Outdated
@LostPointer
LostPointer merged commit 75d08a5 into develop Jul 28, 2026
8 checks passed
@LostPointer
LostPointer deleted the lostpointmeister/los-166-core-estimator branch July 28, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant