fix(crane_world_model_publisher): ボール較正の速度計算で平滑化/生位置混在を修正 - #1387
Open
HansRobo wants to merge 1 commit into
Open
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のボール較正(オフラインキャリブレーションツール)における Vision 生データからの速度計算で、平滑化済みの現在位置と生の前回位置を混在させて差分していた問題を修正します。問題
ball_calibration_data_extractor.cppの速度計算(rosbag からの抽出処理)では、現在位置に 5 点移動平均(applySmoothingFilter/applySmoothingFilterScalar)を適用したsmoothed_posと、平滑化前の生の前回位置prev_ball.posの差分を取って速度を算出していました。差分を取る 2 端点の平滑化状態が一致していないため、速度にバイアスが入ります。検証では符号反転かつ約 0.2 倍の過小評価となるケースが確認されました。この誤差はキック検出の速度閾値や較正データの品質ゲートに影響します。
原因
applySmoothingFilterは「現在位置 + 過去 4 点」の重み付き移動平均であり、戻り値の現在位置は過去側へ引っ張られます。この過去側に引っ張られた現在位置と、平滑化を施していない前回位置を混在させて差分していたことが原因です。速度差分の両端点で平滑化の有無が非対称になっていました。修正内容
速度差分の両端点の平滑化状態を一致させるため、現在位置・前回位置とも生の Vision 位置同士で速度を計算するようにしました。
vision_ball.pos - prev_ball.pos(生の現在位置 − 生の前回位置)に変更vision_ball.pos_z - prev_ball.pos_zに変更applySmoothingFilter/applySmoothingFilterScalarの呼び出しを除去差分計算後の妥当性チェック・外れ値除去(
validateAndFilterVelocity等)はそのまま維持しています。修正は当該速度計算箇所に限定しています。検証
cwm の独立オーバーレイ worktree 上で、対象パッケージ
crane_world_model_publisherの colcon build(--no-rdeps)によりコンパイルが通ることを確認しました(Build complete.、エラーなし)。レビュー観点
本PRはソースコード監査ワークフローで検出・敵対的検証されたバグに対する単一修正です。