fix(crane_world_model_publisher): グローバル減速度最適化の初速度推定を制約付き回帰に修正#1393
Open
HansRobo wants to merge 1 commit into
Open
fix(crane_world_model_publisher): グローバル減速度最適化の初速度推定を制約付き回帰に修正#1393HansRobo wants to merge 1 commit into
HansRobo wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
crane_world_model_publisherのグローバル減速度最適化(グリッドサーチ)における初速度 v0 の推定を、自由回帰の切片から固定傾きモデルの制約付き推定へ修正します。問題
simple_ball_physics_optimizer.cppのグローバル減速度探索では、減速度候補decelごとに固定減速度モデルv(t) = v0 - decel * tを仮定して各軌道の RMSE を評価しています。しかし v0 の推定にperformLinearRegression(expected_velocities, velocities)の切片を用いていたため、推定 v0 が傾きを自由に持つ回帰の切片となり、候補decelに依存しない定数になっていました。その結果、各
decel候補の RMSE 評価が固定傾き(-decel)モデルの最適 v0 を反映せず歪み、グローバル減速度選定がバイアスする問題がありました。原因
説明変数
x = expected_velocities (= -decel * t)に対する OLS の切片を v0 として採用していたため、モデルの傾きが 1 に固定されず、v0 が候補decelと無関係になっていました。固定傾きモデルの最適 v0 とは一致しません。修正内容
固定傾き(-decel)モデルの最適初速度は残差の平均で与えられます。
performLinearRegressionの切片を用いる処理を廃止し、各軌道についてmean(velocities[i] + decel * time_points[i])を直接計算してestimated_v0とするよう置換しました。これにより各decel候補ごとに正しい最適 v0 が用いられ、RMSE 評価とグローバル減速度選定のバイアスが解消されます。変更は当該推定ロジックのみに限定し、後続の RMSE 計算・品質フィルタリングなどは従来どおりです。
検証
cwm の独立オーバーレイ worktree 上で colcon build(
--no-rdeps)によるコンパイル確認を実施し、crane_world_model_publisherのビルドが成功することを確認しました(Build complete.)。本変更はオフライン較正ツールであり、実機・シミュレーション環境での減速度推定の数値検証を併せて推奨します。レビュー観点
本PRはソースコード監査ワークフローで検出・敵対的検証されたバグに対する単一修正です。